1
0
Fork 0
forked from josch/img2pdf

make 2nd, 3rd and 4th argument optional by supplying None as default

This commit is contained in:
josch 2015-02-16 07:15:10 +01:00
parent c68ce6a48d
commit 18ca3b4491
2 changed files with 4 additions and 4 deletions

View file

@ -124,7 +124,7 @@ You can then test the converter using:
Note that the package can also be used as a library as follows: Note that the package can also be used as a library as follows:
import img2pdf import img2pdf
pdf_bytes = img2pdf.convert(['test.jpg'], dpi=150, x=0, y=0) pdf_bytes = img2pdf.convert(['test.jpg'])
file = open("name.pdf","wb") file = open("name.pdf","wb")
file.write(pdf_bytes) file.write(pdf_bytes)

View file

@ -205,9 +205,9 @@ class pdfdoc(object):
result += b"%%EOF\n" result += b"%%EOF\n"
return result return result
def convert(images, dpi, x, y, title=None, author=None, creator=None, producer=None, def convert(images, dpi=None, x=None, y=None, title=None, author=None,
creationdate=None, moddate=None, subject=None, keywords=None, creator=None, producer=None, creationdate=None, moddate=None,
colorspace=None, verbose=False): subject=None, keywords=None, colorspace=None, verbose=False):
pdf = pdfdoc(3, title, author, creator, producer, creationdate, pdf = pdfdoc(3, title, author, creator, producer, creationdate,
moddate, subject, keywords) moddate, subject, keywords)