Python2/3 compatibility on merging pages with eps img into single page

This commit is contained in:
Igor Mihaljevic 2015-12-14 18:09:11 +01:00 committed by Igor Mihaljevic
parent 7456f0acea
commit b06ac57a6f
2 changed files with 7 additions and 5 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
*.swp
.DS_Store
build
.idea/*

View File

@ -2724,14 +2724,14 @@ class ContentStream(DecodedStreamObject):
def _getData(self):
newdata = BytesIO()
for operands, operator in self.operations:
if operator == "INLINE IMAGE":
newdata.write("BI")
dicttext = StringIO()
if operator == b_("INLINE IMAGE"):
newdata.write(b_("BI"))
dicttext = BytesIO()
operands["settings"].writeToStream(dicttext, None)
newdata.write(dicttext.getvalue()[2:-2])
newdata.write("ID ")
newdata.write(b_("ID "))
newdata.write(operands["data"])
newdata.write("EI")
newdata.write(b_("EI"))
else:
for op in operands:
op.writeToStream(newdata, None)