mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-12-29 16:10:06 +00:00
Try img2pdf 0.2
This commit is contained in:
parent
60593b5ad3
commit
e9b87cefcc
@ -592,9 +592,15 @@ def select_image_layer(
|
||||
re_symlink(page_pdf, output_file)
|
||||
else:
|
||||
pageinfo = get_pageinfo(image, pdfinfo, pdfinfo_lock)
|
||||
dpi = round(max(pageinfo['xres'], pageinfo['yres'], options.oversample))
|
||||
dpi = round(max(pageinfo['xres'], pageinfo['yres'],
|
||||
options.oversample))
|
||||
imgsize = '{0}dpix{1}dpi'.format(dpi, dpi)
|
||||
layout_fun = img2pdf.get_layout_fun(None, imgsize, None, None, None)
|
||||
|
||||
with open(output_file, 'wb') as pdf:
|
||||
img2pdf.convert([image], dpi=dpi, outputstream=pdf)
|
||||
pdf.write(img2pdf.convert(
|
||||
[image], producer="img2pdf", with_pdfrw=False,
|
||||
layout_fun=layout_fun))
|
||||
|
||||
|
||||
@active_if(options.pdf_renderer == 'hocr')
|
||||
|
||||
@ -2,5 +2,4 @@ ruffus==2.6.3
|
||||
Pillow==3.1.1
|
||||
reportlab==3.2.0
|
||||
PyPDF2==1.25.1
|
||||
git+https://github.com/jbarlow83/img2pdf.git@0.1.5.dev
|
||||
|
||||
img2pdf==0.2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user