postscript

Print PDF document with python's win32print module?

杀马特。学长 韩版系。学妹 提交于 2019-11-27 20:57:35
I'm trying to print a PDF document with the win32print module. Apparently this module can only accept PCL or raw text. Is that correct? If so, is there a module available to convert a PDF document into PCL? I contemplated using ShellExecute; however, this is not an option since it only allows printing to the default printer. I need to print to a variety of printers on servers across various networks. Thanks for your help, Pete I ended up using Ghostscript to accomplish this task. There is a command line tool that relies on Ghostscript called gsprint . You don't even need Acrobat installed to

How can I merge PDF files (or PS if not possible) such that every file will begin in a odd page?

余生长醉 提交于 2019-11-27 14:52:10
问题 I am working on a UNIX system and I'd like to merge thousands of PDF files into one file in order to print it. I don't know how many pages they are in advance. I'd like to print it double sided, such that two files will not be on the same page. Therefore it I'd the merging file to be aligned such that every file will begin in odd page and a blank page will be added if the next place to write is an even page. 回答1: Here's the solution I use (it's based on @Dingo's basic principle, but uses an

Intercepting data sent to a Windows printer (using RedMon)

半腔热情 提交于 2019-11-27 14:05:56
问题 I need to intercept data being sent to a ESC/POS printer on Windows and analyze it. So I wanted to get the data in plain text, so that I can extract and make sense of information being sent to the printer. Currently, I have tried using RedMon to get the data stream being sent to the printer port. But the data being sent is in the form of raster graphics i.e. dots to be printed, embedded within ESC/POS commands. So I was wondering if somebody can suggest me on how can I get the print data in

How to make stroke width immune to the current transformation matrix

[亡魂溺海] 提交于 2019-11-27 13:28:01
问题 In SVG (and Canvas, Quartz, Postscript, ...), the transformation matrix affects both the path coordinates and the line width. Is there a way to make an adjustment so the line width is not affected? That is, in the following example, the scale is different for X and Y, which makes the square into a rectangle, which is OK, but it also makes the lines wider on two sides. <g transform="rotate(30) scale(5,1) "> <rect x="10" y="10" width="20" height="20" stroke="blue" fill="none" stroke-width="2"/>

How to create a virtual printer in Windows?

一笑奈何 提交于 2019-11-27 10:58:13
I want to create a virtual printer driver for Windows. How and where can I start properly? The WDK has some printing drivers examples that do not seems a good introductory. MSDN also doesn't seems to be very helpful for a novice. There are a lot of virtual printers for Windows out there (mostly they generate PDFs), I wonder if someone could tell my how can I do the same? Any links to the elaborating documentations are appreciated in advance. Thanks. When I did it (which about 12 years ago) I started with the postscript driver sample, replaced all the postscript-specific stuff (in my case, to

overlay one pdf or ps file on top of another

↘锁芯ラ 提交于 2019-11-27 10:31:45
I have two pdf or postscript files (I can work with either one). What I want to do is merge each page on top of the other so that page1 of document A will be combined with page 1 of document B to produce page 1 of the output document. This isn't something I necessarily want need to do programatically, although that would be helpful. Any ideas? You can do this with pdf files using the command line tool pdftk using the stamp or background option. e.g. $ pdftk file1.pdf background file2.pdf output combinedfile.pdf This will only work with a one-page background file. If you have multiple pages,

How can I make a program overlay text on a postscript file?

戏子无情 提交于 2019-11-27 07:17:14
问题 I have some graphs in postscript format, generated by gnuplot. I need to place some identifying information on the graph. How can I script some instructions to do that? I want to write a number at the top right corner of the graph (a .ps file). 回答1: Ok, the example file you linked to is well behaving (and has not re-defined the showpage operator). So I'm now assuming the following: All your .ps files are similar to your example file. All your .ps files are 1 page only (like .eps files). All

How can I remove all images from a PDF?

拥有回忆 提交于 2019-11-27 04:07:59
I want to remove all images from a PDF file. The page layouts should not change. All images should be replaced by empty space. How can this be achieved with the help of Ghostscript and the appropriate PostScript code? Meanwhile the latest Ghostscript releases have a much nicer and easier to use method of removing all images from a PDF. The parameter to add to the command line is -dFILTERIMAGE gs -o noimages.pdf -sDEVICE=pdfwrite -dFILTERIMAGE input.pdf Even better, you can also remove all text or all vector drawing elements from a PDF by specifying -dFILTERTEXT or -dFILTERVECTOR . Of course,

How include img in postscript

帅比萌擦擦* 提交于 2019-11-27 03:34:28
问题 I want to add image to my postscript code %!PS-Adobe-3.0 /Times-Roman findfont 12 scalefont setfont 50 700 moveto (text) show showpage but i dont have idea to do that. Someone help? 回答1: ;tldr skip to the middle and start reading from Simpler Workflow to the end. convert to xbm, hack with vi, inline data with {currentfile} image It is documented in the Postscript Language Reference Manual , but the information can be a little hard to digest. As Ken says, you need to use the image operator. I

What are PostScript dictionaries, and how can they be accessed (via Ghostscript)?

冷暖自知 提交于 2019-11-27 02:58:44
问题 I usually look at ghostscript as a command line tool; however, I never cease to be amazed at the sheer amount of settings and options present there - which is due to the fact that ghostscript is a full blown PostScript language interpreter (which I often forget). For instance, in Querying Ghostscript for the default options/settings of an output device (such as 'pdfwrite' or 'tiffg4'); one learns how to retrieve default options for a given output device. However, what I'd like to know is -