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
18
votes
6 answers

Ghostscript PDF batch compression

I've installed Ghostscript on Windows as what I'm looking to do is compress/reduce the size of 12,000+ PDF files on a network share. This wouldn't be possible with any GUI software as it just bombs out after a while due to running out of resources,…
BabyPython
  • 307
  • 1
  • 2
  • 6
18
votes
3 answers

What is causing Ghostscript to return an error of -100?

So, I am using Matthew Ephraim's GhostscriptSharp, which is a simple C# wrapper for the unmanaged Win32 Ghostscript DLL in my ASP.Net MVC project. Some background: What I am attempting to do is have a user upload a PDF, and then convert that…
Mattygabe
  • 1,772
  • 4
  • 23
  • 44
18
votes
0 answers

Convert PDF to JPG / Images without using a specific C# Library

is there a free C# library (.dll) to convert PDF to images ? I tried this one : https://code.google.com/p/lib-pdf/ But it doesn't work, I got this error : Could not load file or assembly 'libpdf.DLL' or one of its dependencies. The specified …
baaron
  • 319
  • 1
  • 3
  • 9
18
votes
2 answers

convert png to pdf using ghostscript

as the title says I am trying to convert png to pdf. I could not find well described example anywhere about this. I used this command gs sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -sOutputFile=test.pdf test.png but all I get is Error: /syntaxerror…
Eugene Yu
  • 3,708
  • 4
  • 21
  • 27
18
votes
4 answers

How to extract images from PDF using Ghostscript or ImageMagick?

I need to render or fetch all the images from a specific PDF file. How can I achieve this using Ghostscript or ImageMagick ?
mmoghrabi
  • 1,233
  • 1
  • 14
  • 23
17
votes
5 answers

Linux: Command Line Utility Convert RTF to PDF?

Any recommendations to convert an RTF to a PDF? I need to do this from my LAMP application, so a command line utility like GhostScript would be ideal.
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
17
votes
2 answers

Add comments to PDF files automagically with regular expressions

I've been grading academic papers for a couple of years now and I've started to see numerous patterns in spelling and grammer mistakes. Also, I've noticed that less experienced academics tend to use certain constructs that immediately raise "smells"…
Slinger Jansen
  • 237
  • 2
  • 14
17
votes
3 answers

Using GhostScript to get page size

Is it possible to get the page size (from e.g. a PDF document page) using GhostScript? I have seen the "bbox" device, but it returns the bounding box (it differs per page), not the TrimBox (or CropBox) of the PDF pages. (See…
Aristoteles
  • 708
  • 2
  • 7
  • 15
16
votes
3 answers

Convert a PDF to a Transparent PNG with GhostScript

I am attempting, unsuccessfully, to use Ghostscript to rasterize PDF files with a transparent background to PNG files with a transparent background. I've searched high and low for questions from others attempting the same thing and none of the…
Jonathon Wolfe
16
votes
3 answers

Font metrics for the "base 14" fonts in the PDF specification

I've been writing software to parse content from PDFs, specifically text broken into regions. For this I need font metrics such as glyph displacements, font-wide ascent, descent and glyph bounding box, etc. In short, the type of metrics that should…
15
votes
4 answers

ps2pdf: preserve page size

I have myfile.ps with a vector image included. But when I run ps2pdf myfile.ps it seems that the output page size is A4: the vector image is too large and become cut away, so about one inch is lost. The following pseudo-header is printed in the…
BowPark
  • 1,340
  • 2
  • 21
  • 31
15
votes
2 answers

Ghostscript not writable

Trying to install octave on a new Macbook, but keep running into problems using Homebrew. I am following directions here: http://wiki.octave.org/Octave_for_MacOS_X I run into the error: Linking /usr/local/Cellar/ghostscript/9.14... Error: Could not…
chompbits
  • 321
  • 3
  • 7
15
votes
3 answers

Remove all text from PDF file

I am using Ghostscript to convert source PDF file into array of PNG images. Before I convert PDF page into PNG image I would need to extract (delete) all text from PDF so that converted page image would contain all other elements, excluding…
Primoz Rome
  • 10,379
  • 17
  • 76
  • 108
14
votes
1 answer

Ghostscript true black and white conversion

I'm trying to convert a colour pdf to a pure black and white tiff i.e. if the colour is anything other than white I want it to be pure black. At the moment I have colour lines turning speckled and faint which I believe is due to half-toning. Is…
DanY
  • 141
  • 2
14
votes
2 answers

How can you find a problem with a programmatically generated PDF?

My group has been using the itext-sharp library and C#/.NET to generate custom, dynamic PDFs. For the most part, this process is working great for our needs. The one problem we can run into during development/testing is layout issues which can cause…
Swoop
  • 1,423
  • 4
  • 18
  • 34