Skip to main content

Questions tagged [ghostscript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
165 views

How to stop Ghostscript from adding "Producer" metadata to PDF files

I processed a PDF file using Ghostscript: gs -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -q -o output.pdf input.pdf When I used a text/binary editor to look into the output PDF, I noticed that ...
Flux's user avatar
  • 2,978
0 votes
0 answers
166 views

How can I repair a pdf file without losing links within it?

I am using the following gs command: gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=/path/to/output.pdf /path/to/input.pdf to repair a pdf file which may have various unclear problems ...
Tim's user avatar
  • 103k
2 votes
0 answers
161 views

Combine PDFs to new PDF with filenames as bookmarks

I have a directory foo containing .pdf files named with pattern X01, X02, ..., each two pages long. I want to combine them to a new .pdf, named "all_YY-MM-DDTHHMMSS.pdf" that will contain ...
jay.sf's user avatar
  • 227
0 votes
2 answers
674 views

How can you compress images in a PDF (via a GUI, not batch or CLI util)?

While there's similar questions on how to compress a PDF using a command-line tool like ghostscript, is there a GUI experience to compress a PDF file's images? Previously on macOS I used tools like ...
Vivek Gani's user avatar
0 votes
0 answers
579 views

Using gs (Ghostscript) to extract fonts from PDF

I;m tried to use Ghostscript to extract fonts from PDF file. GPL Ghostscript 9.53.3 (2020-10-01) I downloaded extractFonts.ps tool and put it in same folder with PDF file. I also set permissions for ...
Lexx Luxx's user avatar
  • 1,403
0 votes
0 answers
56 views

Script portability to MacOS

Context Catalina (zsh) & Homebrew: man pages return successfully for pdftk & ps2pdf The goal is to execute: pdfBatesStamp.sh as described in https://unix.stackexchange.com/a/115537/182280 I ...
gatorback's user avatar
  • 1,396
1 vote
1 answer
2k views

Cannot open X display `(null)'. **** Unable to open the initial device, quitting

input: gs myPSFile.ps output: GPL Ghostscript 9.50 (2019-10-15) Copyright (C) 2019 Artifex Software, Inc. All rights reserved. This software is supplied under the GNU AGPLv3 and comes with NO ...
solidwaterslayer's user avatar
1 vote
1 answer
2k views

How to scale down PDF file (in pixels and in cm)?

I need to automatically convert my pupils' solutions which are photos and scans of various orientations, resolution, quality and file format into a single PDF with fitting dimensions. The dimensions ...
Photon's user avatar
  • 119
0 votes
1 answer
1k views

methods of PDF compression

The Problem I have a lot of old books that I want to scan and digitize. For this, I use some flatbed scanner, xsane and GImageReader, which works great. Back a few years ago, when I was still using ...
carsten's user avatar
  • 355
1 vote
0 answers
2k views

How can I standardize (normalize) the page size in a PDF with lots of small variations in page size?

My project is about processing a weekly newsletter into an annual PDF compilation. The hard copy originals were scanned by someone else using Abbyy FineReader. The original documents were US letter ...
Artmancc's user avatar
3 votes
1 answer
3k views

How to convert only the first page of a PDF to a JPG with Ghostscript

I have a large set PDF documents, many of which will be multiple pages. I am using Ghostscript [GS] to generate a JPG thumbnail image for each PDF. I only want one JPG per PDF, which should be an ...
Basil Bear's user avatar
0 votes
0 answers
785 views

Is it possible to turn off the "SAFER" option in Ghostscript?

I have a latex program that creates an svg file looking like this: *** WARNING - you have selected SAFER, indicating you want Ghostscript to execute in a safer environment, but at the ...
Brian Fitzpatrick's user avatar
1 vote
0 answers
420 views

cups remove jobs after 5 minutes

I have a print job that uses ghostscript as a filter to print a composite ps file. This file produces errors to the /var/log/cups/error_log and is not being removed from the queue even after 1 day (...
Panagiotis's user avatar
0 votes
0 answers
1k views

apt-get install - when running installed program: no such file or directory

I have installed and build ghostscript and graphicsmagick from source Have deleted both directories because I want to install them via apt-get apt-get install --reinstall graphicsmagick ghostscript ...
clarkk's user avatar
  • 1,847
2 votes
0 answers
68 views

Copy machine refuses my pdf [closed]

I regularly need to convert pdf document in A4 format into US letter format. Following Convert pdf to a different page size (US Letter -> A4), I use pdfjam --outfile out.pdf --paper letter in.pdf ...
Clément's user avatar
  • 378
1 vote
1 answer
2k views

Close ghostscript without "-c quit" or -dBATCH

i use ghostscript to save pdf files as tif. I've written a little function in the shell script i use to delete the uncomplete output folder when i abort the process. function lock-remove { rm -r ...
fmeier's user avatar
  • 331
-3 votes
1 answer
3k views

How can I fix the font problem of this pdf file?

I have a pdf file, whose text can be shown correctly in evince, but not when text are searched or copied and pasted outside the file. For example, "external transportation." is copied and pasted ...
Tim's user avatar
  • 103k
2 votes
2 answers
2k views

Ghostscrip Extract every nth Pages from PDF

I don't know if this can be done, I'm just learning ghostscript. Say I have multiple PDF files each about 500 Pages in length. Can I setup ghostscript to go extract every 100 pages from each ...
Josh Adams's user avatar
2 votes
0 answers
516 views

How do I rotate the orientation in the ghostscript plot for ps file?

I am plotting the (postscript) ps file using the ghostscript in the terminal. When I use the command"gs file.ps", it always gives the portrait orientation like following do you know how could I ...
徐世博's user avatar
2 votes
0 answers
175 views

PDF is corrupted after compressing with Ghostscript

Is there a way to revert a PDF after it is compressed? Every PDF is getting corrupted when it gets compressed with our script, which runs gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS="/...
Zach's user avatar
  • 21
1 vote
2 answers
2k views

Extract Part of a Single PDF Page from Bash

In order to extract a part of a PDF page on a Gnu/Linux machine I use the following command: gs -sDEVICE=pdfwrite -o out.pdf -g2300x2300 input.pdf The -g...x... option lets me choose coordinates on ...
user avatar
2 votes
1 answer
632 views

"Place" Letter Sized PDF to Larger pdf at specific position

Lulu is a print on-demand service. Part of the creation process is to upload a cover. The "cover" is 1 page that has the dimensions 17.25 inches wide by 11.25 inches high. There is a 0.125 "bleed area"...
Ra is dead's user avatar
1 vote
2 answers
2k views

Error while trying to compress pdf using ghostscript recursively via loop

I intend to compress a few thousand PDF files in a folder recursively. I tried with following loop: #!/bin/bash find "/home/user/original" -type f -name *.pdf | while read -r file do gs -sDEVICE=...
Umer's user avatar
  • 157
2 votes
1 answer
1k views

What is this GhostScript error? “/undefined in /BXlevel”

At first I thought this might have been a missing font issue but as far as I can tell from the output, GS is finding the font just fine.. Any hints as to what the problem might be? $ /usr/bin/gs -...
I wrestled a bear once.'s user avatar
0 votes
1 answer
166 views

Trouble installing GS from source

I'm trying to install Ghostscript 9.23 from source, and getting some errors I'm not familiar with. I'm using CentOS. $ cat /proc/version Linux version 2.6.9-67.ELsmp ([email protected]....
I wrestled a bear once.'s user avatar
2 votes
1 answer
2k views

ghostscript changes orientation of PDF

I have two single-page PDFs, and want to merge them into a single two-pages PDF. So I ran: gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf 1.pdf 2.pdf Problem: The result has each ...
Nicolas Raoul's user avatar
1 vote
1 answer
319 views

Finding the size (in points) of the descender of a font in Ghostscript / Postscript?

I would like to place a horizontal line immediately below some text. Is it possible to determine the distance between the baseline and lowest descender of a given font in Ghostscript, or is the ...
Chris's user avatar
  • 113
0 votes
1 answer
818 views

How to tell libgs to use another freetype implementation?

So after a year of use my printer decided to not print anymore. After troubleshooting for a bit I noticed that the cups error log shows something like gs: symbol lookup error: <path>/libgs.so....
WonderingUser's user avatar
3 votes
0 answers
1k views

problem adding cidfont to ghostscript

PREFACE I understand this is a little harder since I can't provide the actual pdf, but the question boils down to a more general ghostscript config question so I don't think the pdf is needed. I ...
chiliNUT's user avatar
  • 1,769
1 vote
1 answer
2k views

Barcodes too wide in a GoDEX printer with CUPS in Linux

I have a GoDEX RT700i printer (203 DPI) and I want to print barcodes in Linux (Ubuntu 16.04) The barcodes I have are in PDF format. There is a 8 digit number below the barcode. In Windows, there is ...
MouTio's user avatar
  • 113
1 vote
0 answers
672 views

why this ghostscript command is giving me error?

I am just trying to change the orientation of a file before piping it to lp since the -o option is not working : gs -sDEVICE=pxlcolor -sOutputFile="\|lp -dprintername" -dNOPAUSE -dBATCH -c "<</...
munish's user avatar
  • 8,057
1 vote
0 answers
258 views

Generating PDF handouts with ghostscript

I have several PPT files with slides, that I want to convert to a single PDF with slide per page + lines for notes. I then want to print that PDF and give it as handouts. What is the best and easiest ...
synhershko's user avatar
3 votes
2 answers
2k views

Add black border around PDF file with ghostscript

I'm using ghostscript to process some PDF files, and I would like to add a thin black border around the files. Is this something that can be done with ghostscript, or are there other (non-lossy) ...
astrofrog's user avatar
  • 131
3 votes
1 answer
3k views

Convert pdf font colors to monochrome black

What I want to do is convert a pdf file that has colorful fonts to one that all it's fonts' colors are black. This is not a duplicate of this question here. I don't want greyscale fonts I want them ...
orestisf's user avatar
  • 197
1 vote
0 answers
778 views

Flatten transparency in PDF to remove thin white lines?

I have a PDF created with Quark Xpress where some raster images are shown with thin white lines across them. Searching around I have found that the problem is due to the way PDFs readers apply partial ...
gioele's user avatar
  • 2,179
2 votes
1 answer
1k views

Piping multiple inputs into Ghostscript

I am trying to create a one-line Linux command to combine two PDF files - which are downloaded from a URL - using Ghostscript. However, I do not want to create any temporary files (everything should ...
Zak's user avatar
  • 123
0 votes
0 answers
910 views

how to print output of ghostscript program

In Linux, please, how do I direct output from a ghostscript program to my HP LaserJet printer? My eventual aim is to draw maps to scale from Natural Earth data . A test page from the printer is ...
Harry Weston's user avatar
  • 1,329
2 votes
1 answer
1k views

Merging pdf files using ghostscript: is it possible to pipe the find output to gs?

I want merge several pdf files into a single one. Found this great answer on SO, but there is a problem here. My pdfs are not in the same directory, so essentially I want to do a find call and pipe ...
posdef's user avatar
  • 579
1 vote
1 answer
963 views

"gv" stubborn complaints

I use "gv" command in my scripts to view *.pdf or *.ps files (I do that instead of using "acroread" or "okular" because "gv" has a nice option "-watch" that allows me to see changes in a troff or ...
Al Kap's user avatar
  • 91
2 votes
1 answer
2k views

Ghostscript + QPDF and PDF/A-1b validation: how to add EOL separator before endstreams

I'm trying to define an up to date method for converting any PDF into a PDF/A-1b able to pass 3-Heights validation. I came up with this script which uses ghostscript and qpdf: #! /bin/bash # ...
Luca C's user avatar
  • 41
3 votes
0 answers
2k views

evince: Bad PDF font rendering

I have a few PDF files which suffer the problem shown in the image: (the blue part is mouse-selected, the right part in black is how the entire document looks!) I tried /prepressing and even -...
Haix64's user avatar
  • 523
2 votes
0 answers
260 views

How to add printer to CUPS using Ghostscript hl7x0 driver?

I run Arch Linux 64-bit and strongly prefer not to add multiarch support for 32-bit software, so I do not want to install the proprietary 32-bit driver for my Brother MFC-J4710DW printer. Research ...
Tim's user avatar
  • 496
4 votes
0 answers
157 views

How do I trace why printing pdf from Ghostscript vs Evince is different?

I'm trying to get a better sense of how the "Print to File" option works on Linux Mint. Basically, when I open a PDF with Evince and print it to PDF, the output is different from the original, and ...
lobati's user avatar
  • 141
7 votes
2 answers
8k views

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 -...
Bruno Silva's user avatar
2 votes
0 answers
191 views

How to cut a really large raster image into smaller chunks?

I have a large poster as a pdf-file. I need to create a raster image from it (for instance because there seems to be no pdf viewer which allows me to zoom sufficiently to see the contents). So I ...
highsciguy's user avatar
  • 2,574
3 votes
1 answer
263 views

Extract completed slides of a slide show PDF

PDF files of slide show presentations distributed by my lecturers often contain a huge number of pages, because each animation step results in an new page (sometimes 20 pages per slide). This is nice ...
kassiopeia's user avatar
75 votes
1 answer
61k views

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 -...
Šimon Tóth's user avatar
  • 8,308
2 votes
2 answers
4k views

Splitting a PDF file with Ghostscript results in one extra blank page

I try to split the pages of one PDF file into a separated one-page PDF files. This command does the job so far: gs \ -q \ -dQUIET \ -dSAFER \ -dBATCH \ -dNOPAUSE \ -dNOPROMPT \ -dAutoRotatePages=/...
strudelkopf's user avatar
2 votes
1 answer
1k views

All PDF applications mix the width and height of a PDF file

I have this PDF file created by scanning. When viewing it in any PDF viewer, the page's width is greater than the height. But it seems like all the PDF applications I have tried mistake the width as ...
Tim's user avatar
  • 103k
10 votes
5 answers
7k views

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 ...
Tim's user avatar
  • 103k