Questions tagged [ghostscript]

Ghostscript is a suite of software based on an interpreter for Adobe Systems' PostScript and Portable Document Format (PDF) page description languages.

Ghostscript is software which converts and processes different graphic formats:

  • Inputs: it can read in Portable Document Format (PDF), PostScript (PS) and Encapsulated PostScript (EPS)
  • Outputs: it can output PDF, PS, EPS and many graphic and raster image formats such as TIFF, JPEG, PNG, PNM, PPM, PCL.

Ghostscript's executables are frequently named...

  • ...gs (on Linux, Unix and Mac), and gswin32c.exe or gswin64c.exe for commandline-only interface,
  • ...gsx (on Linux, Unix and Mac), and gswin32.exe or gswin64.exe for the interface that also pops up a window with the rendered file.

The GhostPDL "extension" to Ghostscript can additionally process the Extensible Paper Specification (XPS), and Hewlett Packard's PCL and convert these to most of the above mentioned output formats.

The commandline tools of the GhostPDL extension are named...

  • ...pcl6 for PCL input,
  • ...gxps for XPS input,

Ghostscript can also be described as a PostScript interpreter and as a PDF interpreter as well as a PDF distiller. As such it aims to be as compatible as possible with Adobe Systems' PostScript interpreter and Acrobat Distiller products. That means you can ask Ghostscript to process (most of) the same setdistillerparams as are documented by Adobe.

2294 questions
11
votes
7 answers

Ghostscript PDF -> TIFF conversion is awful for me, people rave about it, I alone look sullen

My stomach churns when I see this kind of output. http://www.freeimagehosting.net/uploads/e1097a5a10.jpg and this was my command as suggested by Best way to convert pdf files to tiff files gswin32c.exe -q -dNOPAUSE -sDEVICE=tiffg4 -sOutputFile=a.tif…
Setori
  • 10,326
  • 11
  • 40
  • 46
11
votes
2 answers

Ghostscript color detection

I seem to be unable to find whether Ghostscript is able to simply detect whether job is color or grayscale. I use Ghostscript for conversion of print jobs to PNG, but I also need to have information about color of the job, so I don't have to search…
Martinecko
  • 1,719
  • 4
  • 22
  • 35
10
votes
1 answer

How to covert svg to eps in ghostscript

Can you please help me with a command to convert svg file to eps in ghostscript? I tried to open the svg file in Gimp but it is very big so it looks like gimp cannot open it or it take too long. I have two files which I want to convert. Note: I have…
John Boe
  • 3,501
  • 10
  • 37
  • 71
10
votes
3 answers

Call Ghostscript in Windows by its invocation name?

What should I do to be able to call Ghostscript in Windows by its invocation name? I added Ghostscript bin folder to Windows PATH and Path variables but it doesn't work, neither does 'gswin32c.exe' nor 'gswin32c'. Logging out and then logging back…
clumpter
  • 1,898
  • 6
  • 27
  • 38
10
votes
1 answer

Cropping a PDF / Adding crop box using Ghostscript

I have a few hundred PDFs that I need to crop - I'm willing to either crop the actual documents or simply add a crop box to each so the correct viewable area shows when the PDF is opened. How can I do this using Ghostscript (v8.71)? I found…
Brian
  • 2,107
  • 6
  • 22
  • 40
10
votes
2 answers

GhostScript: Error: /invalidfileaccess in --file--

I get the well known error if I try to include a file which is outside the known paths: Error: /invalidfileaccess in --file-- I know that I could use -DNOSAFER but I want to avoid this, since this would allow malicious code to be executed. Is there…
guettli
  • 25,042
  • 81
  • 346
  • 663
10
votes
1 answer

PDF on Linux: Combine font subsets and replace Type 3 with Type 1

I have a PDF file that I'd like to post-process on Linux. In particular I'd like to: Replace Type 3 fonts with Type 1 fonts Replace multiple subsets of the same font with a single subsets (the subsets are the result of including figures in LaTeX,…
steve20
  • 101
  • 1
  • 3
10
votes
2 answers

How can I shift page images in PDF files more to the left or to the right?

We have a bunch of scanned pages (about 600) for which every PDF viewer displays the image with zero margin on the right edge, but about 2 inch margin on the left. (Presumably while scanning, there was a wrong setting used...) We want to print…
simplybest55
10
votes
5 answers

Failed attempt to compress pdf with ghostscript - Device 'pdfwrite' requires output file

I tried to compress a pdf-file with the following command: gswin64c -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=test-compressed.pdf test.pdf I am in the directory of test.pdf and I can also open it, but when I…
MEVIS3000
  • 521
  • 3
  • 18
10
votes
2 answers

Embed ICC color profile in PDF

I am generating a PDF where all the graphics are drawn in \DeviceRGB in the sRGB color space. I would like to convert the PDF into a different Color Profile using an ICC profile and embed the ICC profile, but I can't find a good tool to do this. I…
Thayne
  • 6,619
  • 2
  • 42
  • 67
10
votes
1 answer

Modify existing PDF to add "Page N of NNN" footer

How can I use pdftk either from the command line (or preferably from Ruby) to add page numbers to the bottom of a pre-existing PDF? I'm looking for this format: Page 1 of 2 Page 2 of 2
jrhicks
  • 14,759
  • 9
  • 42
  • 57
10
votes
2 answers

PDF to JPEG conversion using Ghostscript

I'm using Ghostscript to convert my PDF files to JPEGs with Ghostscript which works great. For my output images I'm using %03d in the file name, so the file names come out 001, 002 ... and so on according to the page numbers. But i want in some case…
Daniel Katzan
  • 526
  • 1
  • 7
  • 29
10
votes
1 answer

How to get Ghostscript to use embedded fonts in PDF

gs -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH \ -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf I'm using (trying anyway) to use Ghostscript to reduce my PDF file size. The command above looks like it works, it reduces…
Sheldon Ross
  • 5,364
  • 7
  • 31
  • 37
10
votes
3 answers

Forcing Ghostscript to use antialiasing when converting a PDF to PNG?

I'm using GPL Ghostscript 9.07 (2013-02-14) on OS X (10.8.4) to convert many PDFs to PNGs. It works fine except for one of the PDFs which turns into a PNG with jagged edges. In other words, Ghostscript turns off antialiasing for that particular PDF…
Dae
  • 2,345
  • 2
  • 22
  • 34
10
votes
2 answers

Can't find initialization file gs_init.ps

I have a .net windows form application that uses ghostscript. Only on 1 machine do i get an error message. On all others (100s) it works find. This is in a Citrix environment. The error is "AFPL Ghostscript 8.53: Can't find initialization file…