postscript

Print PDF document with python's win32print module?

自闭症网瘾萝莉.ら 提交于 2019-12-17 15:59:14
问题 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 回答1: I ended up using Ghostscript to accomplish this task. There

How to create a virtual printer in Windows?

点点圈 提交于 2019-12-17 10:18:00
问题 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. 回答1: When I did it (which about 12 years

overlay one pdf or ps file on top of another

99封情书 提交于 2019-12-17 08:11:06
问题 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? 回答1: 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

Convert TIFF to PostScript

落花浮王杯 提交于 2019-12-13 21:26:44
问题 I'm writing .net code (Windows Forms Application) which reads a TIFF image (CMYK) and sends it to printer (using WritePrinter). Before I send it, I need to convert the TIFF image to PostScript. Could any of you share the code how to create PostScript out of TIFF image? I appreciate it! 回答1: My company's product, dotImage includes an encode for EPS, but it will also generate page generation operators. Typical usage might be something like this: public void ConvertToPS(Stram tiffStm, int frame,

Postscript: watermark with varying page sizes

霸气de小男生 提交于 2019-12-13 06:12:13
问题 I am trying to use postscript to watermark postscript files. I am doing this with setpagedevice like so: << /EndPage { exch pop 2 lt { /Times-Roman 40 selectfont .6 setgray 300 300 moveto 30 rotate (Watermark) show true} {false} ifelse } bind >> setpagedevice (file_to_watermark.ps) run This works great, but I would like the watermark to be centered on the page, regardless of page size (this code needs to work for varying sizes of file_to_watermark.ps). My code right now is positioning the

.pbm file image render - [vhold] scanline-wiggles?

北慕城南 提交于 2019-12-13 04:40:17
问题 I'm trying to hack-up a program to read a pbm, pgm, or ppm file and render the image to the postscript output device using the image operator. Just testing the P4 input (binary portable (1-bit) bitmap) path, but my output is all screwy. %! % cf. http://en.wikipedia.org/wiki/Netpbm_format % cf. http://en.wikipedia.org/wiki/Computer_Graphics (origin of image) % $ wget http://upload.wikimedia.org/wikipedia/commons/thumb/2/23/Spacewar%21-PDP-1-20070512.jpg/320px-Spacewar%21-PDP-1-20070512.jpg % $

Creating a code to decompress byte-oriented RLE image

孤者浪人 提交于 2019-12-13 03:47:25
问题 I'm trying to create a code to decompress an RLE Byte-Oriented image from a PostScript File I've already tried solutions found around the web and also tried to build my own ; but none of them produced the result i need. After decompressing the rle image, i should have an RAW image i can open on photoshop (informing width, height and number of channels). However when i try to open the extracted image it doesn't work ; only a black output is show. My inputs are an Binary ASCII Encoded file

How to handle a stackoverflow?

♀尐吖头ヾ 提交于 2019-12-13 00:19:43
问题 I'm trying to fix up the error handling in my postscript interpreter, and I'm having difficulty coming up with ways for the handler to execute when one of the stacks is full. The postscript-level handler procedure I'm using is the "standard" one described in Frank Merritt Braswell, Inside Postscript. /.error { //$error exch /errorname exch put //$error exch /command exch put //$error /newerror true put //$error /errorname get /VMerror ne { //$error /ostackarray get null eq { //$error

PostScript: Does `cvs` terminate the string buffer?

淺唱寂寞╮ 提交于 2019-12-12 16:48:36
问题 One idea when using cvs is to help the garbage collector by re-using a string buffer, like /s 5 string def s 2 cvs %... s 66 cvs %... However when doing such a thing in a loop, the strings actually found in the buffer were: (-40.0) (-30.0) (-20.0) (-10.0) (0.0.0) (10.00) (20.00) (30.00) (40.00) So it seems the strings are not terminated when conversion ended (Found in GhostScript 9.26). Unfortunately the GhostScript reference manual is somewhat silent about whether the string will be

How to determine printer's postscript support using Win32 API?

为君一笑 提交于 2019-12-12 16:16:38
问题 I'm developing remote printing client (native Win32 app). It simply prints files that come from server. I wish to have the ability to programmatically check if printer supports Postscript before sending data to it. How it can be done? GETTECHNOLOGY escape doesn't help much. Say it returns "PCL XL" for HP printers that also support Postscript. 回答1: I don't think there's any way to be certain from the Win32 API that a printer is a PostScript printer,if it accepts multiple Page Description