ghostscript

Embed ICC color profile in PDF

自作多情 提交于 2019-11-27 01:58:52
问题 I am generating a PDF where all the graphics are drawn in \DeviceRGB in the sRGB color space. I would like to convert the PDF into a different Color Profile using an ICC profile and embed the ICC profile, but I can't find a good tool to do this. I have tried ImageMagick, but that rasterizes the PDF which is undesirable, and I have tried using Ghostscript. But while that converts the colors, it doesn't embed the ICC profile. Is there any tool or library (preferably Java or Scala) available for

Reducing PDF file size using Ghostscript on Linux didn't work

最后都变了- 提交于 2019-11-27 00:24:16
问题 I have about 50-60 pdf files (images) that are 1.5MB large each. Now I don't want to have such large pdf files in my thesis as that would make downloading, reading and printing a pain in the rear. So I tried using ghostscript to do the following: gs \ -dNOPAUSE -dBATCH \ -sDEVICE=pdfwrite \ -dCompatibilityLevel=1.4 \ -dPDFSETTINGS="/screen" \ -sOutputFile=output.pdf \ L_2lambda_max_1wl_E0_1_zg.pdf However, now my 1.4MB pdf is 1.5MB large. What did I do wrong? Is there some way I can check the

PDF Text Extraction with Coordinates

时光怂恿深爱的人放手 提交于 2019-11-26 23:50:24
I would like to extract text from a portion (using coordinates) of PDF using Ghostscript. Can anyone help me out? Kurt Pfeifle Yes, with Ghostscript, you can extract text from PDFs. But no, it is not the best tool for the job. And no, you cannot do it in "portions" (parts of single pages). What you can do: extract the text of a certain range of pages only. First: Ghostscript's txtwrite output device (not so good) gs \ -dBATCH \ -dNOPAUSE \ -sDEVICE=txtwrite \ -dFirstPage=3 \ -dLastPage=5 \ -sOutputFile=- \ /path/to/your/pdf This will output all text contained on pages 3-5 to stdout. If you

Script (or some other means) to convert RGB to CMYK in PDF?

99封情书 提交于 2019-11-26 22:42:23
问题 Is it possible to write a script for Adobe Illustrator or some other tool that will read the contents of a number of PDF files and convert all the RGB colours to CMYK? If so, could somebody please point out some of the steps involved, or where to find more information on this? 回答1: This answer is not for Illustrator, but for 'some other tool' , namely Ghostscript (download gs871w32.exe or gs871w64.exe ). Ghostscript allows you to 're-distill' PDFs ( without an intermediate conversion to

Is it possible in Ghostscript to add watermark to every page in PDF

你离开我真会死。 提交于 2019-11-26 22:25:36
问题 I convert PDF -> many JPEG and many JPEG -> many PDF using ghostscript . I need to add watermark text on every converted JPEG (PDF) page. Is it possible using only Ghostscript and PostScript? The only way I found: gswin32c -q -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=output.pdf watermark.ps input.pdf But this will insert watermark.ps watermark on first separate page in output.pdf . Can I do this on output PDF pages directly? Can I do this on output JPEG pages directly? << /BeginPage {

How to print PDF on default network printer using GhostScript (gswin32c.exe) shell command

冷暖自知 提交于 2019-11-26 22:03:02
I'd like to print PDF file(s) on windows' network printer via GhostScript. (I dont want to use Adobe Reader) I've read gswin32c.exe which can do the job. I experimented with many commands and coudn't find the way how to force gs to print PDF on my (windows default) network drive. I don't need point exact network printer- default can be used. But if there is no such option I'm happy to pass printer name as well. (I've tried with param -SDevice="\server_IP\printer_name" but this didnt work as well...) Command working under Windows cmd: gswin32c -dPrinted -dBATCH -dNOPAUSE -dNOSAFER -q

Converting a PDF to PNG

混江龙づ霸主 提交于 2019-11-26 19:24:31
I'm trying to convert a PDF to a PNG image (at least the cover of one). I'm successfully extracting the first page of the PDF with pdftk. I'm using imagemagick to do the conversion: convert cover.pdf cover.png This works, but unfortunately the cover.png comes through incorrectly rendered (some of the alpha object in the PDF aren't rendered properly). I know ImageMagick uses GhostScript to do the conversion and if I do it directly with gs I can get the desired results, but I'd rather use the convert library as it has other tools I'd like to leverage. This command in GhostScript accomplishes the

Using GhostScript to get page size

僤鯓⒐⒋嵵緔 提交于 2019-11-26 17:46:29
问题 Is it possible to get the page size (from e.g. a PDF document page) using GhostScript? I have seen the "bbox" device, but it returns the bounding box (it differs per page), not the TrimBox (or CropBox) of the PDF pages. (See http://www.prepressure.com/pdf/basics/page_boxes for info about page boxes.) Any other possibility? 回答1: Meanwhile I found a different method. This one uses Ghostscript only (just as you required). No need for additional third party utilities. This method uses a little

Querying Ghostscript for the default options/settings of an output device (such as 'pdfwrite' or 'tiffg4')

被刻印的时光 ゝ 提交于 2019-11-26 16:47:17
问题 In this answer to 'GhostScript command line parameters to convert EPS to PDF'; it is stated that the default resolution for the pdfwrite device of Ghostscript is 720x720, which I initially found unbelievable! Is there a way to list the default options of a Ghostscript device? 回答1: Since Ghostscript is a full-blown PostScript interpreter, you can also send PostScript snippets to it which do not cause the drawing of page elements, but which query it for its internal state. If you want to know

Converting PDF to CMYK (with identify recognizing CMYK)

有些话、适合烂在心里 提交于 2019-11-26 15:09:04
问题 I am having much trouble to get ImageMagick's identify to, well, identify a PDF as CMYK. Essentially, let's say I'm building this file, test.tex , with pdflatex : \documentclass[a4paper,12pt]{article} %% https://tex.stackexchange.com/questions/13071 \pdfcompresslevel=0 %% http://compgroups.net/comp.text.tex/Making-a-cmyk-PDF %% ln -s /usr/share/color/icc/sRGB.icm . % \immediate\pdfobj stream attr{/N 4} file{sRGB.icm} % \pdfcatalog{% % /OutputIntents [ << % /Type /OutputIntent % /S/GTS_PDFA1 %