Skip to content

Commit

Permalink
Allow to set PDF version
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed May 19, 2022
1 parent 5091d36 commit d0be36b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pydyf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,16 @@ def write_line(self, content, output):
self.current_position += len(content) + 1
output.write(content + b'\n')

def write(self, output):
def write(self, output, version=b'1.7'):
"""Write PDF to output.
:param output: Output stream.
:type output: binary :term:`file object`
:param bytes version: PDF version, default is 1.7.
"""
# Write header
self.write_line(b'%PDF-1.7', output)
self.write_line(b'%PDF-' + version, output)
self.write_line(b'%\xf0\x9f\x96\xa4', output)

# Write all non-free PDF objects
Expand Down

0 comments on commit d0be36b

Please sign in to comment.