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
34
votes
5 answers

How to downsample images within PDF file?

Need a Java-based solution or, at the worst, command-line for Linux. I tried to use Ghostscript: gs -sDEVICE=pdfwrite -dPDFA -dBATCH -dNOPAUSE -dUseCIEColor \ -sProcessColorModel=DeviceCMYK -sPDFACompatibilityPolicy=1 \ …
macromaniac
  • 407
  • 1
  • 4
  • 11
34
votes
6 answers

Using Ghostscript to convert JPEG to PDF

What are the parameters that I should pass? The Ghostscript version I'm using is 8.71.
Chry Cheng
  • 3,378
  • 5
  • 47
  • 79
32
votes
4 answers

How do I embed fonts in an existing PDF?

Background: I have PDF's I am programmatically generating. I need to be able to send the PDF directly to a printer from the server (not through an intermediate application). At the moment I can do all of the above (generate PDF, send to printer),…
hanzworld
  • 1,289
  • 1
  • 14
  • 22
31
votes
6 answers

Converting PDF to CMYK (with identify recognizing CMYK)

I am having much trouble to get ImageMagick's identify to, well, identify a PDF as CMYK. Essentially, let's say I'm building this file, test.tex, with pdflatex: \documentclass[a4paper,12pt]{article} %%…
sdaau
  • 36,975
  • 46
  • 198
  • 278
28
votes
1 answer

Ghost Script - extract a single page from a pdf and convert it to a jpg

I'm using ubuntu 10.10 and I have ghost script installed. What I need to do is to extract one page from my PDF and then convert that page to a jpg. The aim is to create a PDF previewer.... Here's some settings I found that apply to a windows version…
Jason
  • 15,064
  • 15
  • 65
  • 105
27
votes
2 answers

How to change page orientation of PDF? (Ghostscript or PostScript solution needed)

Given a PDF document, how do I change individual page orientation? I'm using latest version of Ghostscript.
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
27
votes
4 answers

How to set custom page size with Ghostscript

I have scanned some materials at 600 dpi, ~ 9.36x12.67 inches and prepared in PostScript (PS) format. Now when I try to transform PS to PDF with Ghostscript (GS), I get clipped output, as I assume GS's default page size is set to A4. I found…
theta
  • 24,593
  • 37
  • 119
  • 159
25
votes
9 answers

How to convert a PDF to grayscale from command line avoiding to be rasterized?

I'm trying to convert to grayscale this PDF: https://dl.dropboxusercontent.com/u/10351891/page-27.pdf Ghostscript (v 9.10) with pdfwrite Device fails with a "Unable to convert color space to Gray, reverting strategy to LeaveColorUnchanged."…
Panda
  • 275
  • 1
  • 4
  • 7
23
votes
3 answers

Replace all font glyphs in a PDF by converting them to outline shapes

I am looking for a way to 'outline' all text/fonts in a PDF file, i.e. convert them to curves. I would prefer to do this without having to convert the PDF to PostScript and back. Also, I would like to use free lightweight cross-platform tools that…
Szabolcs
  • 24,728
  • 9
  • 85
  • 174
22
votes
2 answers

Ghostscript command line parameters to convert EPS to PDF

Just installed Ghostscript 8.54 for Windows. Does anyone know of the minimum parameters to pass to gswin32c.exe to make it convert, say, someFile.eps to someFile.eps.pdf?
Chry Cheng
  • 3,378
  • 5
  • 47
  • 79
22
votes
5 answers

Ghostscript: PDF total pages

I'm using Ghostscript library API (wrapping from C#) to print PDF documents from my application. With the '-dFirstPage' and '-dLastPage' parameters I'm able to select an range of pages to be printed, but how about the total number of a PDF's pages? …
lorenzoff
  • 1,120
  • 3
  • 15
  • 32
19
votes
1 answer

What does this Ghostscript error message mean?

I get this error message from a Ghostscript call: Error: /syntaxerror in -file- Operand stack: Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- …
Kit Fisto
  • 4,385
  • 5
  • 26
  • 43
19
votes
5 answers

Convert scanned pdf to text python

I have a scanned pdf file and I try to extract text from it. I tried to use pypdfocr to make ocr on it but I have error: "could not found ghostscript in the usual place" After searching I found this solution Linking Ghostscript to pypdfocr in…
Michal
  • 255
  • 1
  • 3
  • 12
18
votes
9 answers

How can I merge PDF files (or PS if not possible) such that every file will begin in a odd page?

I am working on a UNIX system and I'd like to merge thousands of PDF files into one file in order to print it. I don't know how many pages they are in advance. I'd like to print it double sided, such that two files will not be on the same page.…
RanZilber
  • 1,840
  • 4
  • 31
  • 42
18
votes
3 answers

Ghostscript Multipage PDF to PNG

I've been using ghostscript to do pdf to image generation of a single page from the pdf. Now I need to be able to pull multiple pages from the pdf and produce a long vertical image. Is there an argument that I'm missing that would allow this? So…
Josh Bush
  • 2,708
  • 4
  • 24
  • 25