Don't create inline images in output PDFs
...except that Ghostscript will sometimes turn out of line images into inline images on its own, possibly if file size is small.
This commit is contained in:
@@ -205,8 +205,8 @@ class HocrTransform():
|
||||
|
||||
# put the image on the page, scaled to fill the page
|
||||
if imageFileName is not None:
|
||||
im = Image.open(imageFileName)
|
||||
pdf.drawInlineImage(im, 0, 0, width=self.width, height=self.height)
|
||||
pdf.drawImage(imageFileName, 0, 0,
|
||||
width=self.width, height=self.height)
|
||||
|
||||
# finish up the page and save it
|
||||
pdf.showPage()
|
||||
|
||||
@@ -45,7 +45,6 @@ def _page_has_inline_images(page):
|
||||
data = contents.getData()
|
||||
begin_image, image_data, end_image = False, False, False
|
||||
for data in re.split(b'\s+', data):
|
||||
print(data)
|
||||
if data == b'BI':
|
||||
begin_image = True
|
||||
elif data == b'ID':
|
||||
|
||||
Reference in New Issue
Block a user