ghostscript

Remove / Delete all images from a PDF using Ghostscript or ImageMagick

こ雲淡風輕ζ 提交于 2019-12-05 00:33:08
问题 I want to delete / remove all the images in a PDF leaving only the text / font in the PDF with whatever command Line tool possible. I tried using -dGraphicsAlphaBits=1 in a Ghostscript command but the images are present but like a big pixel. 回答1: No, AFAIK, it's not possible to remove all images in a PDF with a commandline tool. What's the purpose of your request anyway? Save on filesize? Remove information contained in images? Or ...? Workaround Whatever you aim at, here is a command that

combining pdf files with ghostscript, how to include original file names?

删除回忆录丶 提交于 2019-12-04 18:51:52
问题 I have about 250 single-page pdf files that have names like: file_1_100.pdf, file_1_200.pdf, file_1_300.pdf, file_2_100.pdf, file_2_200.pdf, file_2_300.pdf, file_3_100.pdf, file_3_200.pdf, file_3_300.pdf ...etc I am using the following command to combine them to a single pdf file: gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file*pdf It works perfectly, combining them in the correct order. However, when I am looking at finished.pdf, I want to have a reference that tells

How to Use Ghostscript DLL to convert PDF to PDF/A

蹲街弑〆低调 提交于 2019-12-04 17:51:44
How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, i'm using C#. serge_gubenko pls, try to run this from the command line to test if it's doing what you need. gswin32.exe -dPDFA -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=PDFA.pdf 1.pdf A Simple C# Wrapper for Ghostscript I've had it working using the following from ghostscriptsharp : [DllImport("gsdll32.dll", EntryPoint = "gsapi_new_instance")] private static extern int CreateAPIInstance(out

Using ghostscript as x11 viewer (gs x11 viewport positioning)?

非 Y 不嫁゛ 提交于 2019-12-04 16:06:07
I already know about Ghostscript front end viewers; but I was wondering how gs itself could be used for viewing PDF documents? The closest I could get to, is to specify explicitly x11 window as output device, specify width and height of the window via -g , and specify rasterization resolution via -r ; or, a command line like this: gs -sDevice=x11 -g500x500 -r150x150 -dFirstPage=3 fontspec.pdf ... which results with something like: ... which is, in fact, all good - except, it starts at lower left corner; and there are no keyboard shortcuts (as far as I can see) here to move the viewport, or to

PDF to Image using GhostScript. No image file has to be created

五迷三道 提交于 2019-12-04 15:58:41
I need to convert a PDF to JPEG (or any other image format as PNG...) with C# I have the path to the PDF and I want to obtain a MemoryStream of the image. I managed to do it with Ghostscript and GhostscriptSharp but I'm forced to create a file, the actual image, and then read this file to create the MemoryStream. Can I do it without this step? Thanks Yes, but you will need to interface directly to Ghostscript using the Ghostscript DLL (I'm assuming Windows since you mention C#). The simplest solution is probably to use the display device which sends an in-memory bitmap back to the parent

Rasterize PDF's with font not embedded using GhostScript

橙三吉。 提交于 2019-12-04 15:08:45
I need to generate JPEG's from PDF. JPEG must be created based on Trim Box and PDF's can be version 1.3 with extra Pantone colors that absolutely require Overprint Preview so only GhostScript (and Rip's of course can handle them). Both Photoshop, Image Magick and SIPS (Scriptable Image Processing System of OS X) cannot solve both problems (Crop to trim and composite handling overprint). I created an app to rasterize the PDF I receive and all works good EXCEPT that some chinese PDF have one font not embedded. This font is Chinese STXiHei TrueType (CID) with encoding G8pc-EUC-H (info extracted

ghostscript BoundingBox values

眉间皱痕 提交于 2019-12-04 13:54:15
问题 I'm just asking myself, what are those bbox values printed out by: gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox myfile.pdf %%BoundingBox: 46 911 1668 4537 %%HiResBoundingBox: 46.080002 911.520035 1667.520064 4536.000173 top-left-X, top-left-Y, ....? And what's the measurement of those values (1/72")? Thanks for helping 回答1: These values are given in PostScript "points": 72 points == 1 inch so yes, the measurement value is 1/72''... The four values need to be read as two pairs of coordinates

Creating JPG thumbnails from PDF causes problems with new version of ImageMagick

有些话、适合烂在心里 提交于 2019-12-04 12:56:26
I'm using Imagemagick to create thumbnails images of pdf files with this command: convert 'input.pdf[0]' -resize "100x140>" -colorspace 'rgb' 'output.jpg' 2>/dev/null Some of the PDFs are in CMYK color space, hence the specification of the expected -colorspace as rgb. This was working fine until I updated to the latest versions of Imagemagick(6.6.7-1) and ghostscript(9.01_0), now it looks like the conversion to rgb isn't working any longer, here is an example output: (The background should be white, not black) It seems though that the problem comes from the -resize option because if I remove

PDF-Print from C#-Program with Ghostscript on specific tray

前提是你 提交于 2019-12-04 12:39:16
in my current software I'm creating pdf-files and printing them out with ghostscript like this: ... string[] printParams = new string[] { "-q", "-sDEVICE=mswinpr2", "-sPAPERSIZE=a4", "-dNOPAUSE", "-dNoCancel", "-dBATCH", "-dDuplex", string.Format(@"-sOutputFile=""\\spool\{0}""", printerName), string.Format(@"""{0}""", filename) ... var p = new Process(); p.StartInfo.FileName = this.ghostScriptExePath; p.StartInfo.Arguments = string.Join(" ", printParams); p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.Start(); ... So far it works just fine and prints out on the specified printer. My

Python <No such file or directory: 'gs'> error even with GhostScript installed on Macintosh *Issue still Persisting!*

别说谁变了你拦得住时间么 提交于 2019-12-04 10:20:54
I have implemented the following save function in my program which allows the user to save as a JPEG file whatever he/she draws on the Tkinter canvas with the Turtle. How it is supposed to work is that it first captures the screen and Tkinter canvas and then creates a postscript file based on it. Then it converts that postscript file as a PIL (Python Imaging Library) readable file type, and then the PIL saves the converted file as a JPEG. My save function is shown below: def savefirst(): # Capture screen and Tkinter canvas cnv = getscreen().getcanvas() global hen # Save screen and canvas as