What are the parameters that I should pass? The Ghostscript version I'm using is 8.71.
Ghostscript is an interpreter for the PostScript® language and PDF files. It is available under either the GNU GPL Affero license or licensed for commercial use from Artifex Software, Inc. It has been under active development for over 30 years and has been ported to several different systems during this time.
This paper intends to introduce some of the ways the Ghostscript tools can be used to manipulate a PDF file, including creation of bookmarks, annotations, and setting document properties.
Open a cmd window and (assuming your Ghostscript installation ended up in c:\path\to\gs ...) then type set path=c:\path\to\gs\gs9. 02\bin;%path% . From this same cmd window you can now simply use gswin32c to start Ghostscript (use gswin64c on 64 bit Windows)...
If you use Windows 10, open the JPG file and give the Print command i.e. Ctrl + P. In the Printer Settings, select Microsoft Print to PDF. Check the photo size and fit you want for the PDF > click Print. On the next page, enter the file name > select the location where you'll like to save the file > hit save.
https://gitlab.mister-muffin.de/josch/img2pdf
As mentioned by PleaseStand, GhostScript (edit: prior to v9.23) will decode the JPEG data, resulting in generation loss, as well as performance "ten to hundred" times worse than img2pdf.
Edit: Ghostscript 9.23 (2018-03-21) added a "JPEG Passthrough" capability that resolves the generation-loss/performance issue.
ImageMagick (i.e. convert
) also decodes and re-encodes the images.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With