Most popular among them are ps2pdf and pdf2ps. Also, the definition of the PostScript ‘run’ operator works with the new PDF interpreter, so you can still use code such as ‘ (/home/myfile.pdf) run’. Ghostscript can do many more things other than just converting PDF and Postscript files to images such as viewing files, printing, changing the resolution of the images, rasterize a document, rendering a file in grayscale etc., There are also a number of utility scripts the invokes Ghostscript with appropriate options for converting PDF to Postscript and vice versa. The new code has been integrated following the old PDF interpreter if all you want to do is process a PDF file then simply putting the file on the Ghostscript command line is sufficient. Gs -dNOPAUSE -dBATCH -sDEVICE=png16m –dFirstPage=3 –dLastPage=4 -sOutputFile="Pic-%d.png" input.pdf For example, to convert that pages 3 and 4 of a pdf document named input.pdf, the command is: You could use the options –dFirstPage and –dLastPage to convert specific pages of a multi-page PDF document. If you leave it out ps2pdf gives the PDF file the name of the PostScript file and a. You don’t need to include the name of the PDF file on the command line. ![]() For example: ps2pdf gundam.ps HeavyArms.pdf. Convert specific page(s) of multi-page PDF to PNG Then, type ps2pdf followed by the name of your PostScript file. dBATCH option causes Ghostscript to exit when processing of the file specified in the command has finished. dNOPAUSE option disables the prompt and pause after each page is processed. The %din the output file name is replaced by the page number hence the PNG files are named pic-1, pic-2, pic3, and so on., for pages 1, 2, 3, respectively. The above command will generate a separate PNG file for each page in the pdf file input.pdf. I thing there is information is PS file that does not interfere with content of the printed data which 'says' to ps to pdf converters that this file is printed from encrypted pdf file. ![]() Gs -dNOPAUSE -dBATCH -sDEVICE=png16m -sOutputFile="Pic-%d.png" input.pdf PS file is not corruped because i can print this file on PS phyisical printer. To convert a multi-page pdf file and generate separate png file for each page the command is: It can be any available device such as jpeg, tiff32nc, pngmono, etc., For a list of all available devices check help using the command gs -h Convert multi page PDF to PNG files SDevice option specifies the output device. This command will convert a single page pdf file named input.pdf and saves the output to pic-1.png Gs -sDevice=png16m -sOutputFile="pic-1.png" input.pdf In its very simple form Ghostscript can be executed as below: ![]() Ghostscript is an interpreter for PDF and PostScript and is available on Windows, Unix, Linux and OpenVMS platforms. However if you want to batch process / automate the conversion of several PDF files then the most efficient tool for this purpose is the Ghostscript. There are several ways you can convert a PDF to an image format such as PNG or JPEG.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |