ghostscript

ImageMagick or GhostScript: convert a multi-page TIFF to a multi-page PDF

南笙酒味 提交于 2019-12-21 11:36:49
问题 I need to convert a multi-page TIFF to a multi-page PDF. I have access to ImageMagick and GhostScript (in *nix environment). How do I do this? Thanks. UPDATE: It turns out that my test file was wrong (it didn't have multiple pages), which made me think my command was wrong. This seems to work for me: convert input.tif output.pdf 回答1: Use a tool called tiff2ps from the tool set provided by libtiff: http://www.libtiff.org/tools.html Once you have the tiff in ps format, you can call ps2pdf to

Obey the MediaBox/CropBox in PDF when using Ghostscript to render a PDF to a PNG

删除回忆录丶 提交于 2019-12-21 03:54:14
问题 I've been using Ghostscript to convert my single figure plots rendered in PDF to PNG: gswin32c -sDEVICE=png16m -r300x300 -sOutputFile=junk.png ^ -dBATCH -dNOPAUSE Figure_001-a.pdf This works in the sense I get a PNG out and it contains the plot. But it contains a huge amount of white space as well (an example source image: http://cdsweb.cern.ch/record/1258681/files/Figure_001-a.pdf). If you view it in Acrobat you'll note there is no white space around the plot. If you use the above command

Java printing quality in Linux on dot-matrix printer

不羁岁月 提交于 2019-12-21 02:41:39
问题 I need to print the report from a Java desktop application to a dot-matrix printer (Epson LX-300 II). Report consists of text ang some graphics. Printer is connected via USB and I'm using CUPS to print. I'm printing using the Printable interface (pretty standard in Java). My problem: Text printing quality is very low on every printer resolution (60x60, 120x60, 120x72). It seems like there's no font hinting at all in some printer driver. Letters is looking very ugly. I can't use direct text

PDF crop even-odd pages with PHP + GhostScript

五迷三道 提交于 2019-12-20 03:53:20
问题 I am working in a routine for crop PDF's and import them into a PDF template. I am using GhostScript, invoked with exec() from a PHP script, and FPDI. All running server-side. So far, I am able to crop pdf documents with GhostScript using the procedure explained in this post (setting CropBox ). The next step is to crop differently the even and odd pages of a document. So I tried the method explained in this other post in SuperUser site, passing custom PostScript code into -c parameter to

So transparent that i can't catch it…Using Rghost to emulate ghostscript command as would be on virtual printer

假装没事ソ 提交于 2019-12-20 03:50:28
问题 as a ruby newb i've been on a little ghost hunt that you might be of some help I read a lot and was told the best way to get these sneaky fellows was using a script : ghostscript. I'm trying to execute the ghostscript command that i run in a virtual printer, but in the context of a ruby (shoes) file : My command is : C:\Programas\gs\gs9.05\bin\gswin64c.exe -IC:\Programas\gs\gs9.05\lib;C:\Programas\gs\fonts -sDEVICE=pdfwrite -r300 -dNOPAUSE -dSAFER -sPAPERSIZE=a4 -sOutputFile=c:\tempRep\temp

How to change Ghostscript output file (in printer spooler)

99封情书 提交于 2019-12-19 11:57:12
问题 I am using Ghostscript to print a PDF by command line arguments. But it shows the printed document's name as Ghostscript output in printer spooler. I want to change it to a custom name (as letter's name). 回答1: Please refer to the documentation in http://www.ghostscript.com/doc/9.06/Devices.htm#Win In particular there is an example in section 10.2 with explanation of the parameters that can be specified in section 10.3. Just changing the document name can be done by: mark /UserSettings <<

How can I extract color values from an EPS file?

自闭症网瘾萝莉.ら 提交于 2019-12-19 11:27:43
问题 I'm trying to find all fill and stroke values used in an EPS file. I can parse the file, I just can't figure out how color values are defined in the EPS postscript section. I have converted the file to SVG (using ghostscript) and I can get the hex values, but an EPS to SVG conversion with a gradient produces files 20x the size. Is there a standard format for color values in postscript that I can extract from an EPS file? 回答1: PostScript is a programming language, not a simple file format, so

How can I extract color values from an EPS file?

一曲冷凌霜 提交于 2019-12-19 11:26:08
问题 I'm trying to find all fill and stroke values used in an EPS file. I can parse the file, I just can't figure out how color values are defined in the EPS postscript section. I have converted the file to SVG (using ghostscript) and I can get the hex values, but an EPS to SVG conversion with a gradient produces files 20x the size. Is there a standard format for color values in postscript that I can extract from an EPS file? 回答1: PostScript is a programming language, not a simple file format, so

Resize A4 PDF to SRA4 and center content

不打扰是莪最后的温柔 提交于 2019-12-19 10:08:33
问题 I'd like to be able to resize an A4 PDF to the slightly bigger SRA4 format, used by printing professionals. The content shouldn't be resized, but only centered. In other words, I'd like to add margins to my A4 document. I managed more or less to do that with this Ghostscript (9.05) call: gs -dPDFSETTINGS=/default -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf -dDEVICEWIDTHPOINTS=637 -dDEVICEHEIGHTPOINTS=907 -dFIXEDMEDIA in.pdf The problem is that the A4 content is not centered in

ghostscript 9.26 update breaks imagick readImage for multipage PDF

大憨熊 提交于 2019-12-19 04:18:22
问题 Since the ghostscript update 9.25 -> 9.26 (on debian) last morning we get this error: ErrorMessage: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r300x300' -dFirstPage=1 -dLastPage=1 '-sOutputFile=/tmp/magick-39903EapVvuyNQxL4%d' '-f/tmp/magick-39903VD0GMIpLPaIN' '-f/tmp/magick-399031owlSOb4aOEw'' (-1) @ error/delegate.c