postscript

How include img in postscript

老子叫甜甜 提交于 2019-11-28 10:24:23
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? ;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 usually go for the "old school" form which is width height bits-per-pixel matrix proc image ‐ For some

How to use non-ASCII characters in Matlab figures (for use in LaTeX doc)?

巧了我就是萌 提交于 2019-11-28 10:07:02
I am using including Matlab-drawn figures into LaTeX. My usual workflow is as following: Script in matlab creates figure(s), I tweak what I find needs to be tweaked in visual figure editor, Figure is saved as .fig (for future modification) and .eps (for including in LaTeX), I convert .eps files to .pdf, PDF files are referenced in LaTeX source code. To the point: when I try to use in axis labels, legend, titles, etc. non-ASCII chars, (to be exact: Polish national chars e.g. 'ą', 'ę', 'ś', 'ć') encoding in Matlab figure editor is fine and characters display properly. After exporting to .eps,

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

◇◆丶佛笑我妖孽 提交于 2019-11-28 09:26:40
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 - are these options related to so-called PostScript dictionaries? Or, to put it in other words - what are

How to get Ghostscript to use embedded fonts in PDF

∥☆過路亽.° 提交于 2019-11-28 08:43:00
gs -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH \ -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf I'm using (trying anyway) to use Ghostscript to reduce my PDF file size. The command above looks like it works, it reduces file size greatly, but then several of the fields are garbled. As for as I can track it down, It's doing font substitution. IE, The same text = same garbled text. The fonts are embedded in the PDF when it gets to me. Additionally, I have tried to add all the fonts to the Fontmap. Any ideas, Ideally I would like it to use the embedded fonts without me

How to merge two postscript files together?

百般思念 提交于 2019-11-28 07:49:01
I am trying to merge two or more postscript files into one. I tried concatenation but it does not work as each postscript file may have different resource header. Have anyone done this before? Are there any libraries (commercial or open source) out there? I do not mind C++, C# or even Java libraries. Edited These are large postscript files (more than 200 Mb) and their purpose is only for color printing (not for online viewing). Conclusion ps2write is not the answer as it does not support DSC. pswrite as reader pipitas has correctly pointed out produces L1 output. It is not the soluton. Using

Send Postscript Document to Printer using VC++

[亡魂溺海] 提交于 2019-11-28 05:57:37
问题 I have a postscript file. How can I send it to a printer using Visual C++? This seems like it should be simple. 回答1: 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);

How can I add a footer to the bottom of each page of a postscript or pdf file in linux?

偶尔善良 提交于 2019-11-28 00:54:05
问题 So I'd like to add a "footer" (an attribution) to the bottom of every page of a pdf file I am generating via postscript with groff in linux. I am converting the file from ps to pdf myself, with the ps2pdf tool, so I have access to both formats. These two posts have been somewhat helpful: How to add page numbers to Postscript/PDF How can I make a program overlay text on a postscript file? I'm not against using the first method, but I don't have access to the pdflatex utility mentioned in the

Is it possible in Ghostscript to add watermark to every page in PDF

房东的猫 提交于 2019-11-28 00:01:50
I convert PDF -> many JPEG and many JPEG -> many PDF using ghostscript . I need to add watermark text on every converted JPEG (PDF) page. Is it possible using only Ghostscript and PostScript? The only way I found: gswin32c -q -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=output.pdf watermark.ps input.pdf But this will insert watermark.ps watermark on first separate page in output.pdf . Can I do this on output PDF pages directly? Can I do this on output JPEG pages directly? << /BeginPage { gsave /Helvetica_Bold 120 selectfont .85 setgray 130 70 moveto 50 rotate (Sample) show grestore } bind

How do Bezier Patches work in the Utah Teapot?

ε祈祈猫儿з 提交于 2019-11-27 23:15:22
I prematurely posted a code golf challenge to draw the Utah Teapot using this dataset ( just the teapot ). ( Revised and Posted teapot challenge ) But when I looked deeper at the data in order to whip up a little example, I realized I have no idea what's going on with that data. I have a good understanding of Bezier curves in 2D, implemented deCasteljau. But for 3D does it work the same? Yes! It does! The data contains patches containing 16 vertices each. Is there a standard ordering for how these are laid out? And if they correspond to the 2D curves, then the four corner points actually touch

How to determine string height in PostScript?

寵の児 提交于 2019-11-27 22:14:00
问题 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. 回答1: Are you familiar with the