ghostscript

Ghostscript: “Unrecoverable error: undefinedfilename in setpagedevice”

爱⌒轻易说出口 提交于 2019-12-10 16:29:07
问题 I'm trying to compress pdf files using ghostscript like this: gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -sOutputfile=output.pdf input.pdf I've done this successfully in the past, but for some reason now it won't work. I get the following error: GPL Ghostscript 9.15 (2014-09-22) Copyright (C) 2014 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. **** Unable to open the initial device,

GhostscriptLibraryNotInstalledException running under 32-bit process requires native library

旧城冷巷雨未停 提交于 2019-12-10 14:07:29
问题 Using nuget in Visual Studio 2013, I installed Ghostscript.NET into my project on my Windows x64 PC. Just to make sure I wasn't crazy, I checked it: PM> Install-Package Ghostscript.NET 'Ghostscript.NET 1.2.0' already installed. Project already has a reference to 'Ghostscript.NET 1.2.0'. PM> The project is used by multiple developers. It targets Any CPU, and needs to remain that way. Here is my code: public static void GhostscriptNetProcess(String fileName, String outputPath) { var version =

imagemagick identify gives “dyld: Library not loaded: /usr/local/lib/libtiff.3.dylib”

强颜欢笑 提交于 2019-12-10 12:57:12
问题 after brew install imagemagick and brew install ghostscript on osx when i run identify i get: $ identify dyld: Library not loaded: /usr/local/lib/libtiff.3.dylib Referenced from: /usr/local/bin/identify Reason: image not found Trace/BPT trap: 5 回答1: this fixes it ln -s /usr/local/Cellar/libtiff/3.9.5/lib/libtiff.3.dylib /usr/local/lib/libtiff.3.dylib thanks to rlaraujo on this link https://github.com/mxcl/homebrew/issues/12099 回答2: I ran into the same problem recently on 10.6.8. I had

How to execute postscript file to a particular page number?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 12:13:39
问题 I have postscript file of 100 lines. I'm trying to merge 2 pdfs in to the single one with the help of ghostscript. What I want to do is, merge both pdf into one and than apply my postscript code in following manner: 1) first 50 lines of the postscript file should be applied on only page 1 of the generated pdf 2) remaining 50 lines to be applied on the 2nd page of the generated pdf. I have used following code to do that: gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=output.pdf test.ps

Ghostscript postscript pswrite is encoding text

一曲冷凌霜 提交于 2019-12-10 11:38:58
问题 Why is Ghostscript pswrite encoding my text in its output? Consider the following MWE: %!PS-Adobe-3.0 %%Title: mwe.ps %%Pages: 001 %%BoundingBox: 0 0 595 842 %%EndComments %%Page: 1 1 %%PageBoundingBox: 0 0 595 842 0 0 1 setrgbcolor 0 0 595 842 rectfill 1 0 0 setrgbcolor 247 371 100 100 rectfill /Times-Roman findfont 72 scalefont setfont newpath 247 300 moveto (Chris) show showpage Saving this MWE to file and viewing in GSview will display a blue page with red square and my name underneath.

Ghostscript: adding BleedBox

大兔子大兔子 提交于 2019-12-10 10:47:02
问题 I have a pdf with such pdfInfo: pdfinfo -f 1 -l 1 -box book.pdf Title: Hibaby book Author: Hibaby.biz Creator: HIBABY Producer: TCPDF 5.9.193 (http://www.tcpdf.org) CreationDate: Tue Mar 5 17:25:23 2013 ModDate: Tue Mar 5 17:25:23 2013 Tagged: no Form: none Pages: 21 Encrypted: no Page 1 size: 595.276 x 841.89 pts (A4) Page 1 rot: 0 Page 1 MediaBox: 0.00 0.00 595.28 841.89 Page 1 CropBox: 0.00 0.00 595.28 841.89 Page 1 BleedBox: 0.00 0.00 595.28 841.89 Page 1 TrimBox: 0.00 0.00 595.28 841.89

Ghostscript ps to jpg output without white space

烈酒焚心 提交于 2019-12-10 10:32:25
问题 What I am trying to do is convert a ps which is just a image to a jpg using ghostcript here is what I started with gswin32c.exe -sDEVICE=jpeg -sOutputFile="test.png" example.ps however when I run this the jpg comes out with a lot of white space to the right and the bottom Also the picture comes out huge is there any way to crop out the whitespace in ghostscript? I tried this code gswin32c.exe -sDEVICE=jpeg -dBATCH -dNOPAUSE -dSAFER -r72x72 -g200x900 -sOutputFile="test.jpg" example.ps which

What are best parameters to run ImageMagick to convert low quality pdf to images (for OCR)

早过忘川 提交于 2019-12-09 16:13:48
问题 I have several low quality pdfs. I would like to use OCR -- to be more precise Ocropus to get text from them. To do use, I use first ImageMagick -- a command line tool to convert pdf to images -- to transforms these pdfs into jpg or png. However ImageMagick produces very low quality images and Ocropus hardly recognizes anything. I would like to learn what are the best parameters for handling low quality pdfs to provide as-good-as-possible-quality images to OCR. I have found this page, but I

Changing the text and background color of a PDF file

大兔子大兔子 提交于 2019-12-09 11:34:34
问题 I'd like to change the background color and text color programmatically in PDF documents so that they're nicer to read at night (kinda like in Adobe Reader: Edit -> Preferences -> Accessibility -> Replace Document Colors ). Is there any good command line tool or API for Windows that can do that? So far I haven't found any. It's OK if it needs to save the newly colored PDF into a new file. 回答1: There is no way to do this directly, with no (Free Software or gratis) tool I'm aware of. (Because

Font metrics for the “base 14” fonts in the PDF specification

江枫思渺然 提交于 2019-12-09 05:16:06
问题 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 be available in the FontDescriptor dictionary of a font definition in a PDF. Unfortunately a FontDescriptor doesn't have to be included for fonts whose base font is one of the "base 14" set of standard fonts. Where can I find or how can I generate