postscript

Send Postscript Document to Printer using VC++

只谈情不闲聊 提交于 2019-11-29 12:24:19
I have a postscript file. How can I send it to a printer using Visual C++? This seems like it should be simple. If the printer supports PostScript directly you can spool a raw print jobs like this: HANDLE ph; OpenPrinter(&ph, "Printer Name", NULL); di1.pDatatype = IsV4Driver("Printer Name") ? "XPS_PASS" : "RAW"; di1.pDocName = "Raw print document"; di1.pOutputFile = NULL; StartDocPrinter(ph, 1, (LPBYTE)&di1); StartPagePrinter(ph); WritePrinter(ph, buffer, dwRead, &dwWritten); EndPagePrinter(ph); EndDocPrinter(ph) Repeat the WritePrinter until you have spooled the whole file. IsV4Driver()

How to change page orientation of PDF? (Ghostscript or PostScript solution needed)

两盒软妹~` 提交于 2019-11-29 11:10:35
问题 Given a PDF document, how do I change individual page orientation? I'm using latest version of Ghostscript. 回答1: Why do you require usage of Ghostscript? Would it be acceptable to use another Free, Open Source Software tool running on the commandline, such as pdftk ? Anyway, here is how to rotate pages with Ghostscript. However, this may not work for your intentions, because you cannot force a certain orientation for an individual page only. It relies on an internal Ghostscript algorithm that

Can't add new Redirected Port in Windows 7 after installing RedMon

馋奶兔 提交于 2019-11-29 08:55:15
问题 My operating system is Windows 7 32bit. I installed RedMon1.7 , Ghostscript 8.71 and GSview 4.9 ; installations were successful. I went to Add New Local Printer in Windows Devices and Printers , clicked on Create A New Port , and selected Redirected Port from the Type of Port list. Clicked Next and in the Add New Port window I named RPT1: and clicked OK but it says Specified port cannot be added. Operation could not be completed (error 0x00000001) I tried giving different names to the port,

Convert: Postscript delegate failed

眉间皱痕 提交于 2019-11-29 04:49:06
问题 I am trying to convert a PDF to JPEG: $ convert pdf-test.pdf pdf-test.pdf.jpg However, I am getting this error: convert: Postscript delegate failed `pdf-test.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/664. convert: missing an image filename `pdf-test.pdf.jpg' @ error/convert.c/ConvertImageCommand/3015. Currently I am using this version of GS and ImageMagick on Mac OS X Lion: $ gs -v GPL Ghostscript 9.02 (2011-03-30) Copyright (C) 2010 Artifex Software, Inc. All rights reserved

How to determine string height in PostScript?

这一生的挚爱 提交于 2019-11-29 03:50:44
I need to determine the height of a string (in given scale and font) in postscript. /Helvetic-Oblique findfont 10 scalefont setfont 10 10 1 0 360 arc fill 10 10 moveto (test) dup stringwidth pop 2 div neg 0 rmoveto show will print test centered horizontally (but not yet vertically) at (10,10). (to see this, I also show a small circle at 10,10). I also need to determine the string height to center the text vertically as well, but I cant find a function for it. Are you familiar with the PostScript code you're using? Or is it just blindly copied and pasted from someplace? If you want to

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

浪尽此生 提交于 2019-11-29 01:53:14
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. Here's the solution I use (it's based on @Dingo's basic principle, but uses an easier approach for the PDF manipulation): First, I create a PDF file with a single blank page somewhere, e.g

Intercepting data sent to a Windows printer (using RedMon)

╄→尐↘猪︶ㄣ 提交于 2019-11-28 21:55:39
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 text format so as to be able to extract some information from it. The data which is sent to a ESC/POS

How to make stroke width immune to the current transformation matrix

a 夏天 提交于 2019-11-28 21:06:13
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"/> </g> I can see that would be useful in many cases, but is there a way to opt out of it? I suppose I

How to add page numbers to Postscript/PDF

坚强是说给别人听的谎言 提交于 2019-11-28 15:54:56
If you've got a large document (500 pages+) in Postscript and want to add page numbers, does anyone know how to do this? This might be a solution: convert postscript to pdf using ps2pdf create a LaTeX file and insert the pages using the pdfpages package ( \includepdf ) use pagecommand={\thispagestyle{plain}} or something from the fancyhdr package in the arguments of \includepdf if postscript output is required, convert the pdflatex output back to postscript via pdf2ps Brian M. Hunt Based on rcs's proposed solution, I did the following: Converted the document to example.pdf and ran pdflatex

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

拟墨画扇 提交于 2019-11-28 13:00:22
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). 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 your filenames are like constructed as gnp-NNN.ps (like gnp-544.ps is). The number you want to appear in the