change ocr command
This commit is contained in:
parent
b577b81fb5
commit
336084d414
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import time
|
||||
import subprocess
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
import img2pdf
|
||||
|
@ -216,7 +216,6 @@ bar.close()
|
|||
driver.close()
|
||||
del driver
|
||||
|
||||
|
||||
print('Building PDF...')
|
||||
page_files = [str(ebook_files / f'{x}.jpg') for x in move_romans_to_front(roman_sort_with_ints([try_convert_int(str(x.stem)) for x in list(ebook_files.iterdir())]))]
|
||||
pdf = img2pdf.convert(page_files)
|
||||
|
@ -228,7 +227,7 @@ with open(ebook_output, 'wb') as f:
|
|||
title = 'test title'
|
||||
|
||||
print('Running OCR...')
|
||||
subprocess.run(f'ocrmypdf -l {args.language} --rotate-pages --deskew --title "{title}" --jobs $(nproc) --output-type pdfa "{ebook_output}" "{ebook_output_ocr}"', shell=True)
|
||||
subprocess.run(f'ocrmypdf -l {args.language} --title "{title}" --jobs $(nproc) --output-type pdfa "{ebook_output}" "{ebook_output_ocr}"', shell=True)
|
||||
|
||||
# TODO: scrape table of contents and insert
|
||||
|
||||
|
|
Loading…
Reference in New Issue