ghostscript

c# PDF to Bmp for free

北慕城南 提交于 2019-12-07 14:32:50
问题 I am writing a program that uses OCR (tessnet2) to scan an image file and extract certain information. This was easy before I found out that I was going to be scanning attachments of PDFs from an Exchange server. The first problem I am working on is how to convert my PDFs to BMP files. From what I can tell so far of TessNet2, it can only read in image files - specifically BMP. So I am now tasked with converting a PDF of indeterminate size (2 - 15 pages) to BMP image. After that is done I can

GhostScript Error

不想你离开。 提交于 2019-12-07 12:33:37
问题 On a particular PDF, when running the following command: gs -dSAFER -dBATCH -dNOPAUSE -dQUIET -dFirstPage=1 -dLastPage=1 -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf I get this error: GPL Ghostscript 8.71: Warning: 'loca' length 188 is greater than numGlyphs 93 in the font MGOXZX+Arial-BoldMT. Any ideas what this error means and how to resolve the issue? 回答1: First, Ghostscript didn't declare this as an 'error', but a 'warning'. That's quite a difference. Second, you asked Ghostscript

How to confirm a TrueType PDF font is missing glyphs

对着背影说爱祢 提交于 2019-12-07 12:21:09
问题 I have a PDF which renders fine in Acrobat but fails to print during the PDF to PS conversion process on our printer's RIP. After uncompressing with pdftk and editing I've found if I replace the usage of a certain font it will print. The font is a strange one, a TrueType subset with a single character (space). If I pass the PDF through Ghostscript it reports no errors, however an Acrobat pre-flight check will report a missing glyph for space. This error is not reported for the original file.

Load C library (gsdll32.dll) from Metro Style App c#

余生颓废 提交于 2019-12-07 10:15:38
问题 I want to use gsdll32.dll from Metro Style App c#. I load dll as follow: [DllImport("gsdll32.dll", EntryPoint = "gsapi_delete_instance")] private static extern void gsapi_delete_instance(IntPtr instance); [DllImport("gsdll32.dll", EntryPoint = "gsapi_revision")] private static extern int gsapi_revision(ref GS_Revision pGSRevisionInfo, int intLen); [DllImport("gsdll32.dll", EntryPoint = "gsapi_set_stdio")] private static extern int gsapi_set_stdio(IntPtr lngGSInstance, StdioCallBack gsdll

Ghostscript PDF to PNG: output is always 595x842 (A4)

江枫思渺然 提交于 2019-12-07 08:28:57
问题 I try to convert PDF to PNG, but ouput image is always A4, however the source PDF is very huge. Here are my commands: -dNOPAUSE ^ -dBATCH ^ -dSAFER ^ -sDEVICE=png16m ^ -dFirstPage=1 ^ -sOutputFile="D:\PDF.png" ^ "D:\PDF.pdf" ^ -sPAPERSIZE=a1 I tried several options (-r, -g, -sDEFAULTPAPERSIZE), but none worked. How can I force the output image dimensions? P.S: my PDF file 回答1: Your linked-to PDF file has only 1 page. That means your commandline parameter -dFirstPage=1 doesn't have any

C# Ghostscript Wrapper

扶醉桌前 提交于 2019-12-07 05:45:21
问题 Has anyone encountered a nice wrapper for GhostScript in C#. My specific use is to take postscript and turn it into a pdf 回答1: Open-source PDFSharp has a namespace for using GhostScript. Even if you can't directly use it, you can probably graft whatever you need out of the source. 回答2: Matthew Ephraim has created a pretty simple C# wrapper called GhostScriptSharp that uses P/Invoke to access the unmanaged Ghostscript DLL in your C# application: http://mattephraim.com/blog/2009/01/06/a-simple

How to convert a multi-page PDF to single-page TIFFs

♀尐吖头ヾ 提交于 2019-12-07 04:59:18
问题 This thread asks for how to convert multi-page PDF to multi-page TIFF with Ghostscript; "Tools to convert multipage PDF to multipage TIFF" However, I want to covert a multi page PDF to a number of single-page TIFFs: Each page in the PDF is expected to be converted to a single TIFF file. So the above answer does not exactly match what I need. How can I achieve this? I am using Windows XP. 回答1: Be sure to have a recent version of Ghostscript installed. Then you can run these commands: gs \ -o

What dimensions do the coordinates in PDF cropbox refer to?

家住魔仙堡 提交于 2019-12-07 01:15:43
问题 If one has, for example, a pdf with the wrong page size specified one can crop away the unwanted portions of the document with ghostscript and the command parameter /CropBox . My question is, what do the numbers in the command refer to? I know they are point units (72nds of an inch) but what are their origins and axes? By dint of trail and error from this example I've come up with following to keep an area approximately 6"x4" from the top left corner of a 11"x8.5" page (example source pdf). I

Join multiple PDF files into a single page PDF - positioned join using PHP [closed]

倖福魔咒の 提交于 2019-12-06 22:36:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 months ago . This is not an attempt to join separate PDFs to one single PDF with multiple pages. It is an attempt to create a single page PDF from few other PDFs that already exists. I need to do this using PHP and the server is CentOS. I am already generating a set of single page PDF files based on individual templates

Script to compress all pdf files in a directory

不羁的心 提交于 2019-12-06 16:13:42
问题 I wish to compress all pdf files in a directory using ghostscript. I thought of using python to read files and the gs command that compress pdf is from __future__ import print_function import os for path, dirs, files in os.walk("/home/mario/books"): for file in files: if file.endswith(".pdf"): filename = os.path.join(root, file) gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -dQUIET -sOutputFile=file filename This gives syntax error at "/screen", For a