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:
James R. Barlow
2015-07-26 21:43:49 -07:00
parent 5440d988fc
commit 6b9adef684
2 changed files with 2 additions and 3 deletions
+2 -2
View File
@@ -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()
-1
View File
@@ -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':