Questions tagged [ghostscript]

69 questions
73
votes
1 answer

Convert pdf to a different page size (US Letter -> A4)

I'm trying to print a simple US Letter document, but for some reason, I just cannot manage to fit it properly onto A4 when printing multiple pages per-list. I have tried converting the pdf using: gs -o print.pdf -sDEVICE=pdfwrite -sPAPERSIZE=a4…
Šimon Tóth
  • 8,098
  • 12
  • 40
  • 67
27
votes
2 answers

How do I insert a blank page into a PDF with ghostscript or pdftk?

I have a PDF file that needs a blank page inserted into it every so often. The pattern is unpredictable, so I need a command that will allow me to fit one in wherever necessary. How can i do this?
ixtmixilix
  • 13,040
  • 27
  • 82
  • 118
25
votes
7 answers

How to convert a color pdf to black-white?

I'd like to transform a pdf with some coloured text and images in another pdf with only black&white, in order to reduce its dimensions. Moreover, I would like to keep the text as text, without transforming the pages elements in pictures. I tried the…
BowPark
  • 4,811
  • 12
  • 47
  • 74
14
votes
5 answers

Extract even-numbered and odd-numbered pages of a PDF into two separate PDFs

I have a PDF that consists of several hundred pages of bilingual text. Since I need to use OCR on each language separately, I want to grab the even and odd pages and make two separate PDFs, using convert or ghostscript. The language I want to do…
ixtmixilix
  • 13,040
  • 27
  • 82
  • 118
12
votes
2 answers

How to make ghostscript not wipe PDF metadata

Ghostscript wipes the PDF metadata like author, title, subject etc. How can I tell ghostscript not to touch the metadata? I invoke it as follows: gs \ -dBATCH \ -dNOPAUSE \ -sOutputFile= \ …
Marco
  • 33,188
  • 10
  • 112
  • 146
10
votes
2 answers

How to convert a pdf to 4-up in landscape mode (ideally using ghostscript)?

I have pdf slides in landscape mode and would like to create a new pdf file containing the slides 4-up (in landscape mode again) like this: ----------------- | 1 | 2 | ----------------- | 3 | 4 | ----------------- I know that there…
Marius Hofert
  • 450
  • 2
  • 6
  • 15
10
votes
4 answers

How can I convert a scanned PDF with OCRed text to one without OCRed text?

I have a scanned PDF file, with low-quality OCRed text. I would like to have a PDF file without the OCRed text. How can I convert a scanned PDF with OCRed text to without OCRed text? I am thinking about what ways can recover the original scanned PDF…
Tim
  • 98,580
  • 191
  • 570
  • 977
7
votes
4 answers

Install Ghostscript v 9.05 (or newer) on CentOS

I need to use the ghostscript inkcov device on my CentOS server. The device is said to be available on GS versions 9.05 and newer. However, yum install ghostscript installs version 8.70. What is the easiest way to get the inkcov device to work?
Dušan Rychnovský
  • 285
  • 2
  • 4
  • 10
6
votes
1 answer

convert pdf to image [jpeg|png]

I need to convert pdf files into image files (like: png (prefer), jpeg). I used convert (from the ImageMagick package) but it takes more than 4 seconds for a 2 page pdf file with only tables (something like an invoice), so this pdf is really light.…
user1016265
  • 315
  • 1
  • 3
  • 6
6
votes
2 answers

Overlay text in PDF via command line

The following command produced the result of the following image using convert, where an overlay box containing the letter "A" was layered over the PDF: convert online_gauss.pdf -fill white -undercolor '#00000080' -pointsize 40 -gravity South…
Bruno Silva
  • 91
  • 1
  • 5
5
votes
1 answer

Merge several eps files into one PDF

I have several hundred encapulated postscript files, and I want to merge them all into one big PDF. How can I do this?
Dan
  • 9,372
  • 5
  • 25
  • 39
5
votes
2 answers

How to rotate an image in gs

How can I rotate an image with ghostscript? I am visualizing eps to screen. I am using the command: gs image.eps
simona
  • 1,001
  • 3
  • 13
  • 27
5
votes
6 answers

Can't print to PDF using cups-pdf; used to work, now "failed to set file mode" printing as non-root

Here's something really odd: something that used to work fine in Debian, and then broke, even without a dist-upgrade. I used to be able to use the CUPS PDF virtual printer to print anything to a PDF file. Now, it doesn't work: nothing shows up in…
user
  • 28,161
  • 13
  • 75
  • 138
4
votes
1 answer

Implementing a String -> PDF Stamp tool

I wrote a little shell function which creates a fixed-size PDF file (A4) from a character string using gs: make_stamp() { file=$1 string=$2 tmp=${file}-small.pdf gs -o "$tmp" -sDEVICE=pdfwrite -g500x200 \ -c "/Helvetica findfont 12 scalefont…
fommil
  • 623
  • 1
  • 5
  • 14
4
votes
3 answers

How to create a single page PDF file out of multiple EPS files with GhostScript

I'm trying to merge eps files into a pdf file using GS, however, I cannot get it to put multiple eps files without page breaks in between even if original files are small. The command I'm using is: gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite…
perreal
  • 221
  • 2
  • 6
1
2 3 4 5