change ocr command

This commit is contained in:
Cyberes 2023-03-14 11:53:47 -06:00
parent b577b81fb5
commit 336084d414
1 changed files with 2 additions and 3 deletions

View File

@ -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