Questions tagged [ghostscript]
The ghostscript tag has no summary.
71 questions
0
votes
1
answer
32
views
How to proportionally scale all pages in a PDF file to a given width without rotating them
I have some files, each of which consists of several pages. In most of the files the pages have no common width (and height). I'd like to define some common width and then scale all pages ...
1
vote
0
answers
70
views
With ghostscript, how to upscale a PDF file that is wider than taller so that the new width matches the width of a portrait A4 sheet of paper?
Let's take a PDF file that is slightly wider than taller, e.g., https://we.tl/t-iihJ3gMsrA :
pdfinfo input.pdf | grep "Page size"
Page size: 397.349 x 378.153 pts
Let's try to upscale ...
2
votes
1
answer
747
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 ...
2
votes
0
answers
409
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 ...
0
votes
2
answers
2k
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 ...
0
votes
0
answers
1k
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 ...
0
votes
0
answers
80
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 ...
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 ...
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 ...
0
votes
1
answer
2k
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 ...
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 ...
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 ...
0
votes
0
answers
968
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 ...
1
vote
0
answers
547
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 (...
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
...
2
votes
0
answers
82
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
...
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 ...
-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 ...
2
votes
2
answers
3k
views
Using Ghostscript to extract every nth page 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 ...
2
votes
0
answers
624
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 ...
2
votes
0
answers
203
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="/...
1
vote
2
answers
3k
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 ...
2
votes
1
answer
746
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"...
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=...
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 -...
0
votes
1
answer
206
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]....
2
votes
1
answer
3k
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 ...
1
vote
1
answer
394
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 ...
0
votes
1
answer
863
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....
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 ...
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 ...
1
vote
0
answers
723
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 "<</...
1
vote
0
answers
293
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 ...
3
votes
2
answers
3k
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) ...
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 ...
1
vote
0
answers
844
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 ...
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 ...
0
votes
0
answers
1k
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 ...
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 ...
2
votes
1
answer
1k
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 ...
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
# ...
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 -...
2
votes
0
answers
304
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 ...
4
votes
0
answers
180
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 ...
7
votes
2
answers
9k
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 -...
2
votes
0
answers
203
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 ...
3
votes
1
answer
306
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 ...
77
votes
1
answer
66k
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 -...
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=/...
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 ...