Try img2pdf 0.2

This commit is contained in:
James R. Barlow 2016-02-05 14:38:37 -08:00
parent 60593b5ad3
commit e9b87cefcc
3 changed files with 10 additions and 5 deletions

View File

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

View File

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

View File

@ -214,7 +214,7 @@ setup(
'Pillow>=2.4.0',
'reportlab>=3.1.44',
'PyPDF2>=1.25.1',
'img2pdf==0.1.5.dev'
'img2pdf>=0.2.0'
],
tests_require=tests_require,
entry_points={