ghostscript

Converting a pdf to an image with GhostScript - how do I reference gsdll32.dll?

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to create an image from a pdf using GhostScript. Here is my code: GhostscriptWrapper . ConvertToBMP ( inputPDFFilePath , outputBMPFilePath ); And here's my GhostscriptWrapper class: public class GhostscriptWrapper { public static void ConvertToBMP ( string inputPath , string outputPath ) { CallAPI ( GetArgs ( inputPath , outputPath )); } private static void CallAPI ( string [] args ) { IntPtr ptr ; CreateAPIInstance ( out ptr , IntPtr . Zero ); InitAPI ( ptr , args . Length , args ); Cleanup ( ptr ); } private static

How to convert PDF from CMYK to RGB, for displaying on iPad?

吃可爱长大的小学妹 提交于 2019-12-03 08:51:25
问题 According to this question: Displaying PDF documents on iPad - Color Problems some PDFs don't display right on iOS devices due to colors not being in RGB. It's also mentioned that converting PDFs from CMYK to RGB could be automated using ghostscript. Anyone know how the actual command might look like? 回答1: We use Ghostscript to convert from CMYK to RGB when generating PDFs from Postscript files. It should also work for PDF-to-PDF conversions. The followind command line is used: gs -sDEVICE

Python tkinter save canvas as postscript and add to pdf

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a simple python tkinter paint program (user use mouse to draw on the canvas). My objective is to save the final drawing and put it into a pdf file with other contents. After looking around, i realized that i can only save the canvas drawing as postscript file like this canvas.postscript(file="file_name.ps", colormode='color') So, i am wondering if there's any way (any python module?) that will allow me to insert the postscript files into pdf file as images. Is it possible? 回答1: As it is mentioned in this answer , a possible walkaround

Java printing quality in Linux on dot-matrix printer

拈花ヽ惹草 提交于 2019-12-03 08:34:44
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-out to port (it looks great), 'cause I need also to print graphics on the same page. It seems that

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

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: 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

How can I convert .eps file to .pdf in Mathematica?

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I convert .eps to .pdf inside Mathematica (perhaps using GhostScript?)? 回答1: After installing GhostScript and setting appropriate environment variables (for Windows you should add gs\bin and gs\lib to the PATH , where gs is the top-level Ghostscript directory) you can use for converting .eps to .pdf (all the glyphs will be outlined): gsEPS2PDF[epsPath_String, pdfPath_String] := Run["gswin64c.exe -sDEVICE=pdfwrite -dNOCACHE -sOutputFile=\"" <> pdfPath <> "\" -q -dbatch -dNOPAUSE \"" <> epsPath <> "\" -c quit"] Here gswin64c.exe is the

Ghostscript Multipage PDF to PNG

会有一股神秘感。 提交于 2019-12-03 05:55:21
问题 I've been using ghostscript to do pdf to image generation of a single page from the pdf. Now I need to be able to pull multiple pages from the pdf and produce a long vertical image. Is there an argument that I'm missing that would allow this? So far I'm using the following arguments when I call out to ghostscript: string[] args ={ "-q", "-dQUIET", "-dPARANOIDSAFER", // Run this command in safe mode "-dBATCH", // Keep gs from going into interactive mode "-dNOPAUSE", // Do not prompt and pause

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

戏子无情 提交于 2019-12-03 05:44:20
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 font metrics for the base 14 fonts? On Linux (and probably on Mac OS X too) you can easily use the

Print PDF using GhostScript

瘦欲@ 提交于 2019-12-03 04:53:12
I am in need of your support on the following issue since its pulling me for a while. We have a small c# utility, which print given PDF using GhostScript . This print as expected but fail to retain the page formatting’s. However, pages are printed as expected when I switch Adobe Acrobat in place of GhostScript . So I presume, I am making some obvious mistake on the GhostScript's command line arguments . Background Following is the core c# logic, which print a given PDF file with varying style across each pages. The given PDF file has pages; with inconsistent font style and colour some of the

Splitting a PDF with Ghostscript

依然范特西╮ 提交于 2019-12-03 04:23:59
I try to split a multipage PDF with Ghostscript, and I found the same solution on more sites and even on ghostscript.com , namely: gs -sDEVICE=pdfwrite -dSAFER -o outname.%d.pdf input.pdf But it seems not working for me, because it produces one file, with all pages, and with the name outname.1.pdf . When I add the start and end pages, then it is working fine, but I want it to work without knowing those parameters. In the gs-devel archive, I found a solution for this: http://ghostscript.com/pipermail/gs-devel/2009-April/008310.html -- but I feel like doing it without pdf_info . When I use a