How to print PDF on default network printer using GhostScript (gswin32c.exe) shell command

I’ve finally made it working and easy for debugging. My final method code for those interested: /// <summary> /// Prints the PDF. /// </summary> /// <param name=”ghostScriptPath”>The ghost script path. Eg “C:\Program Files\gs\gs8.71\bin\gswin32c.exe”</param> /// <param name=”numberOfCopies”>The number of copies.</param> /// <param name=”printerName”>Name of the printer. Eg \\server_name\printer_name</param> /// <param name=”pdfFileName”>Name of the PDF file.</param> /// … Read more

Converting a PDF to PNG

You can use one commandline with two commands (gs, convert) connected through a pipe, if the first command can write its output to stdout, and if the second one can read its input from stdin. Luckily, gs can write to stdout (… -o %stdout …). Luckily, convert can read from stdin (convert -background transparent – … Read more

Cropping a PDF using Ghostscript 9.01

First, take note that the measurement unit for PDF is the same as for PostScript: it’s called a point [pt]. 72 points == 1 inch == 25.4 millimeters Assuming you have a page size of A4. Then the media dimensions are: 595 points width == 210 millimeters 842 points height == 297 millimeters Assuming you … Read more