postscript

Overriding postscript /setcmykcolor

人走茶凉 提交于 2020-07-09 12:13:25
问题 I'm trying to change the color from EPS files that contain only vectors (no rasters). Currently, I convert them to SVG, manipulate the colors, and convert them back to PDF or EPS with Inkscape. This works perfectly but doesn't allow me to apply CMYK coloring, only RGB. After investigating a little bit and finding answers like this or this I'm trying to override the /setcmykcolor function my EPS file uses. You can download it from here. The EPS looks like this: And I want to convert the color

Why does this PostScript/PS file create way more top-margin than specified?

你离开我真会死。 提交于 2020-03-05 04:04:49
问题 The PS script takes a plaintext document and produces a PDF from it. A big thank you to @RedGrittyBrick for digging up this snippet: %! % % From: Jonathan Monsarrat (jgm@cs.brown.edu) % Subject: PostScript -> ASCII *and* ASCII -> PostScript programs % Newsgroups: comp.lang.postscript % Date: 1992-10-01 04:45:38 PST % % "If anyone is interested, here is an interesting program written by % Professor John Hughes here at Brown University that formats ASCII % in PostScript without a machine

Getting the page sizes of a PostScript document

半腔热情 提交于 2020-03-05 03:55:41
问题 I want to get page size of each page of a PostScript document in a simple program or shell script. Is there any program or library that can get the page sizes. (Like pdfinfo, but dealing with PostScript) 回答1: No doubt, there's some program for that, but you can try using Ghostscript: gs -q -sDEVICE=nullpage -dBATCH -dNOPAUSE \ -c '/showpage{currentpagedevice /PageSize get{=}forall showpage}bind def' \ -f test.ps But then you may need to filter out any warnings or DSC comments. E.g. one of

Breaking Down Type 1 .pfa Font File Format Using t1dsasm in C Programming

你说的曾经没有我的故事 提交于 2020-03-05 03:26:26
问题 I've peered into several references that very exhaustively or minimally (it's hard to tell) convey instructions on how to program a .pfa font type (purportedly obsolete since 2005) t1utils has a t1disasm.c programming disassembly tool written in C that is made for decoding postscript and related packaged font program and charstring dictionaries. Would anyone like to break this down, specifically, in terms of the components that do not remain constant? 回答1: You might find some components of

PDF: What is DeviceRGB?

穿精又带淫゛_ 提交于 2020-01-24 09:44:05
问题 Is this (a) an own color space like AdobeRGB and sRGB or is this (b) a name for the RGB color space that the device uses? (in case it is (b) , what color space should be used to render a pdf? is sRGB the default to use? should a pdf viewer application be able to change this 'device' color space?) 回答1: DeviceRGB simply means that its a 3 component space with Red Green and Blue colourants, it is not calibrated. sRGB is a calibrated space (I believe 'standard' RGB, which is where the 's' comes

Windows 8 printing Postscript file programmatically

拟墨画扇 提交于 2020-01-23 09:11:07
问题 I've spotted a strange problem while printing a Postscript file . So here is my setup: I have a Windows 8 PC , on this PC there is an C# application "NetworkPrintTest.exe", which, when executed, should open a PDF, generate a Postscript file and ultimately should print it. But it doesn't do anything. I don't get an error but it won't print either. The same program runs error free on windows 7 and i even get the printer to print the file. As mentioned above the .ps file is generated

How can I programatically generate venn diagram images with labels on top of the image?

左心房为你撑大大i 提交于 2020-01-14 13:49:24
问题 I'm trying to generate Venn diagrams for a pdf report, with text on top of the distinct regions. We're using htmldoc to generate pdfs, which precludes text on top of background images. We use the google charts api for other images, but their Venn diagrams don't support text on top of the diagram (from what I can tell). The easiest path would be some way to generate an image of the venn on our server using a 3rd party library, and then link the image into the document, I just don't know any

PostScript String Token

a 夏天 提交于 2020-01-14 02:12:26
问题 I have a loop that takes out each word in a string using token, then I want to be able to do computations on it like this: (1 2 add 3 4 add) But any way you code it i keep getting 7 add 2 1 I want it to be 7 3 This is what I am working with { %loop pstack (repl> )print flush (%lineedit)(r)file dup bytesavailable string readstring pop { token {}{exit}ifelse exch dup () eq {pop exec exit}if exec }loop }loop 回答1: I would advise you to write stack comments at the end of each line. It really helps

Thumbnail generation with Ghostscript rotates my device size definition for landscape pdf pages

末鹿安然 提交于 2020-01-13 19:44:22
问题 I want to use GS to generate thumbnails from pdf files. The thumbnail must fit a 90x120 pixel rectangle The image should not be rotated The image should be resized to fit the rectangle with keeping aspect ratio I use the following command: gswin32 -dPDFFitPage -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 -dDEVICEWIDTH=90 -dDEVICEHEIGHT=120 -dORIENT1=true -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=output.%d.jpg input

How to do a space-partitioning of the Utah Teapot?

蹲街弑〆低调 提交于 2020-01-13 16:55:37
问题 Having dealt with converting the Bezier Patches into triangles, I need to do a Binary Space Partition in order to draw the projected triangles using the Painter's Algorithm. I've implemented the algorithm from Wikipedia with much help with the math. But it's making a Charlie Brown tree! That is most of the nodes have one branch completely empty. The whole strategy is all wrong. Since the teapot is essentially spherical, the entire shape is only on one "side" of any particular component