README.md: add more examples (closes: #98)
This commit is contained in:
parent
ea2245757f
commit
80d24a1d49
1 changed files with 10 additions and 0 deletions
10
README.md
10
README.md
|
@ -199,6 +199,16 @@ The package can also be used as a library:
|
||||||
with open("name.pdf","wb") as f:
|
with open("name.pdf","wb") as f:
|
||||||
f.write(img2pdf.convert('test.jpg', layout_fun=layout_fun))
|
f.write(img2pdf.convert('test.jpg', layout_fun=layout_fun))
|
||||||
|
|
||||||
|
# use a fixed dpi of 300 instead of reading it from the image
|
||||||
|
dpix = dpiy = 300
|
||||||
|
layout_fun = img2pdf.get_fixed_dpi_layout_fun((dpix, dpiy))
|
||||||
|
with open("name.pdf","wb") as f:
|
||||||
|
f.write(img2pdf.convert('test.jpg', layout_fun=layout_fun))
|
||||||
|
|
||||||
|
# create a PDF/A-1b compliant document by passing an ICC profile
|
||||||
|
with open("name.pdf","wb") as f:
|
||||||
|
f.write(img2pdf.convert('test.jpg', pdfa="/usr/share/color/icc/sRGB.icc"))
|
||||||
|
|
||||||
Comparison to ImageMagick
|
Comparison to ImageMagick
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue