postscript

Dynamically change print data

假如想象 提交于 2019-12-06 11:14:18
I am looking into a way to manipulate the data sent to a printer (inkjet for now. Probably an HP 2460). I want to change the data dynamically each time the printer tries to print. Ie. at point 1, the print will be of the page kept normally, but the paper might change its position, so I am looking for a way to rotate the input image to counter the rotation of the paper. I think I am looking for a way to specify the data to be printed pixel by pixel in real time. Data input available : rotation position of the print head with respect to the corner of the page at each instant provided in real

Converting PostScript to an image [closed]

牧云@^-^@ 提交于 2019-12-06 09:22:01
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 4 years ago . I'm having trouble converting a postscript (.eps) file to any kind of image. Whenever I use PIL to save the loaded .eps file the quality of it is horrible and text rendered in tkinter is unreadable. I think this is because the .eps file is some sort of vector image and saving it using PIL doesn't render the correct resolution but I'm not sure. Does anyone know how I could either save a PostScript file at a

Ghostscript ps to jpg output without white space

一个人想着一个人 提交于 2019-12-06 07:42:04
What I am trying to do is convert a ps which is just a image to a jpg using ghostcript here is what I started with gswin32c.exe -sDEVICE=jpeg -sOutputFile="test.png" example.ps however when I run this the jpg comes out with a lot of white space to the right and the bottom Also the picture comes out huge is there any way to crop out the whitespace in ghostscript? I tried this code gswin32c.exe -sDEVICE=jpeg -dBATCH -dNOPAUSE -dSAFER -r72x72 -g200x900 -sOutputFile="test.jpg" example.ps which decrease the width but the height is still huge. Any solutions? Firstly you need to set the 'correct'

Postscript: concatenate two strings?

二次信任 提交于 2019-12-06 02:52:23
问题 How do I concatenate two strings in Postscript? (foo) (bar) ??? -> (foobar) 回答1: PostScript doesn't have a built-in string concatenation operator. You need to write some code for that. See http://en.wikibooks.org/wiki/PostScript_FAQ#How_to_concatenate_strings.3F for instance. (update by mh: copied here) /concatstrings % (a) (b) -> (ab) { exch dup length 2 index length add string dup dup 4 2 roll copy length 4 -1 roll putinterval } bind def 回答2: Same idea generalized to any number of strings.

Rotate to North

你离开我真会死。 提交于 2019-12-06 02:26:54
After doing a complicated series of rotations and translations, I want to return the current direction to "North" pointing at the top of the page. How can I do that? The obvious answer is to keep track of what direction I am pointing each time I translate, but that seems like a lot of work. I want something like "0 rotateto" that leaves me at the current location but pointing to the absolute top of the page; similarly, "90 rotateto" would point right. I also want to know how to move to a specific point on the page after a series of rotations and translations. In other words, I'm looking for an

Windows 8 printing Postscript file programmatically

情到浓时终转凉″ 提交于 2019-12-05 14:32:50
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 successfully on both operating systems but the printing failes. Here is my source code which should print the file

Libraries for parsing PDF, PostScript, and/or DjVu

◇◆丶佛笑我妖孽 提交于 2019-12-05 07:32:21
问题 What I want to do is pretty simple: given a PDF/PS/DjVu file containing a paper/book, find the authors and title of the paper (any other metadata would be good, but less needed). This recognition doesn't have to be perfect, but I'd like to make it as good as I can. I am looking for open-source .NET and/or Java libraries (preferably .NET) which allow to access metadata and contents of these files. For PDF I've found PDFBox (.NET/Java) and PDF Library (.NET), but there may be better

How can I write arc text in postscript file

痴心易碎 提交于 2019-12-05 05:16:56
问题 I have this, But I want to have text alignment like an arc. Is it possible? /outputtext { /data exch def /rot exch def /xfont exch def /y1 exch def /x1 exch def /Times-Roman findfont xfont scalefont setfont x1 y1 moveto rot rotate data show rot neg rotate } def % x y fontsize rotation (text) outputtext 20 300 12 0 (text1) outputtext 20 400 12 90 (text2) outputtext 20 500 12 90 (text3) outputtext 20 600 12 0 (text4) outputtext showpage 回答1: Adobe's famous Blue Book ( PostScript Language

PDF to PostScript Using Ghostscript: large files having issues printing

随声附和 提交于 2019-12-05 03:24:13
问题 I'm currently using Ghostscript to convert 500 page PDF files into PostScript. I'm using Windows 7, Ghostscript x64 v 9.16, and a Kodak Digimaster Commercial Printer. I use the following arguments for GhostScript to convert a PDF into PS: C:\Program Files\gs\gs9.16\bin\gswin64c.exe" -dCompressFonts=true -dSubsetFonts=true -dEmbedAllFonts=true -sFONTPATH=C:\Windows\Fonts\ -dNOPAUSE -dBATCH -sDEVICE=ps2write -sOutputFile="PostScript.ps" "MyPdf.pdf" I then add %KDK (proprietary) commands to

How do you keep the `roll` operator straight?

烈酒焚心 提交于 2019-12-05 01:16:44
In postscript, the roll operator is very general and difficult to visualize. How do you make sure you're rolling in the right direction? I want to get a solid handle on roll because I want to be able to transform functions using variables /f { % x y z /z exch def /y exch def /x exch def x dup mul y dup mul z dup mul add add % x^2+y^2+z^2 } def into functions using stack manipulations, more like /f { % x y z 3 1 roll dup mul % y z x^2 3 1 roll dup mul % z x^2 y^2 3 1 roll dup mul % x^2 y^2 z^2 add add % x^2+y^2+z^2 } def or /f { % x y z 3 { 3 1 roll dup mul } repeat 2 { add } repeat % x^2+y^2+z