r/PostScript • u/Reasonable-Pay-8771 • Aug 30 '25
My Postscript book shelf
Ignore the new-age cultish books on the top left. The two sections happen to be next to each other.
r/PostScript • u/Reasonable-Pay-8771 • Aug 30 '25
Ignore the new-age cultish books on the top left. The two sections happen to be next to each other.
r/PostScript • u/brainvoice • Mar 22 '25
I created these notes to help others new to PostScript programming.
I started programming in PostScript just a few months ago, so there may be errors or omissions in my notes. Any suggestions on how my notes could be improved?
r/PostScript • u/Mammoth_Jellyfish329 • Feb 24 '26
I've been working on PostForge, a from-scratch PostScript interpreter written in Python. It's fully Level 2 compliant and implements most of Level 3 (all 7 shading types, Flate filters, CID/TrueType fonts, DeviceN, ICC color management, etc.). It outputs to PNG, PDF, SVG, TIFF, and has an interactive Qt display window.
The PDF output generates content streams directly and it preserves CMYK and Gray color spaces, embeds and subsets Type 1 and TrueType fonts, and produces searchable/selectable text.
This is actually my third PostScript interpreter. My first was PostMaster in 1991 (DOS, C, converted PS to Illustrator format). My second was a Level 2 interpreter I wrote for Tumbleweed Software in the mid-90s that served as the PostScript distiller for Envoy (the document format that shipped with WordPerfect Office Suite and competed with Acrobat). Both were in C. I started PostForge in Python as an experiment to see if the language could handle PostScript's VM save/restore semantics — and it turned out to be a surprisingly good fit.
Some numbers:
- 2,500+ unit tests (written in PostScript using a custom test framework)
- Full Level 2 operator coverage
- Optional Cython-accelerated execution loop (15–40% speedup)
- Working toward full Level 3 compliance (mostly there — the big features are done, just need a few remaining operators and Type 4 calculator functions)
What it's good for:
- Debugging and understanding PostScript programs
- Embedding a PS interpreter in Python workflows
- Learning how PostScript works (the code is readable — it's Python, not C)
- An alternative to GhostScript when you need transparency over raw speed
It's AGPL-3.0 licensed and on GitHub: https://github.com/AndyCappDev/postforge
I'd love feedback from anyone still working with PostScript. Are there specific documents or workflows where you've hit limitations with existing tools? That would help prioritize what to work on next.
r/PostScript • u/Dull_Replacement8890 • Feb 21 '25
I've just implemented Tetris in PostScript.
600 lines / 10 KB
realtime input, direct drop, increasing speed levels
7-tetrimino random bags
Nintendo-style scoring and high score tracking
It works in GhostView on macOS.
r/PostScript • u/sleepingsquirrel • Jul 12 '17
r/PostScript • u/Reasonable-Pay-8771 • Jun 25 '25
Of course you can just do a for loop and juggle indices and get and put and whatnot. But let's try to be functional, starting with "fun". How about iterating over two arrays together by mapping over the left-hand array with the right-hand array stuffed in an iterator closure?
<< /map { [ 3 1 roll forall ] }
/to-each { {ARRAY 0 get PROC exec SELF 1 2 copy get 1 add put }
dup length array copy cvx
dup 0 5 -1 roll put dup 3 4 -1 roll put dup 5 1 index put }
/+ { {add} to-each map }
>> begin
[1 2 3] [4 5 6] + ==Map over the left, curry the right.
Thank you very much.
r/PostScript • u/yankdevil • Feb 05 '25
Someone ported Linux to PDF. They did this by running a RISC V port of linux on a RISC V emulator written in Javascript running in a PDF.
It would seem to me that postscript is a fully fledged language that one could write an emulator in.
Has anyone tried that?
r/PostScript • u/nst021 • Apr 05 '24
I've written a Tic-Tac-Toe that you can send on a printer with netcat https://github.com/nst/PSTicTacToe/ can you beat it? :)
I've also written a chess engine working with GhostScript https://seriot.ch/projects/pschess.html still to be tested on a real printer, though.
r/PostScript • u/luserdroog • May 21 '16
r/PostScript • u/sleepingsquirrel • Jan 29 '13
r/PostScript • u/Reasonable-Pay-8771 • Jul 09 '25
This program expands upon the idea of performing a zipWith by mapping over the left array with the right array stuffed in an iterator. We apply this to the task of placing objects in a grid by dividing up the space and zipping the content into it. The code applies some fp concepts like lambdas, closures, currying, memoization to make it all happen. Generating a procedure with embedded bound variables is accomplished by executing the string representation of the procedure. ({//myvar}) cvx exec The PostScript tokenizer will perform the desired automatic substitution of names decorated with the double-slant //immediately-loaded-name. We merely have to do this within the begin ... end sequence where our variables are defined. The to-each function creates a curried iterator if the argument is an array or a curried sparse-array iterator if the argument is a dict with a /default key and any number of integer-keyed values, otherwise it just creates a curried proc the reuses the same argument whenever its called. So the right argument to the zip doesn't even need to be an array or array-like.
r/PostScript • u/frbnfr • Nov 20 '22
Does anyone have a download link for the first edition of the PostScript Language Reference Manual? The Adobe-link on the sidebar doesn't work anymore.
r/PostScript • u/[deleted] • Apr 03 '16
I have downloaded ghostScript and gsview, and I'm wondering how do I write a program in notepad and interpret it using the command line? Any help would be much appreciated.
r/PostScript • u/sleepingsquirrel • Sep 10 '15
r/PostScript • u/sleepingsquirrel • Sep 09 '14
r/PostScript • u/sleepingsquirrel • Jan 24 '13
r/PostScript • u/AddemF • Mar 01 '12
So I'm new to all this PostScript stuff and using GhostScript. I'm going through this book titled Mathematical Illustration which is based on GhostScript and tells me to make the procedure that takes arguments the "page coordinates" and returns to the stack the "user coordinates". I made the procedure
/page-to-user {
matrix defaultmatrix
matrix currentmatrix
matrix invertmatrix
matrix concatmatrix
} def
Now I'm guessing this is the right procedure but I want to test whether I'm right in some fairly plain way. But I basically have two tools for that: The GhostScript command line and GSview. The command line is too damn clumsy to use and GSview doesn't display the stack. What to do?
r/PostScript • u/Dull_Replacement8890 • Mar 04 '25
r/PostScript • u/AndyM48 • Mar 20 '24
I have googled this endlessly and each time I am more confused. I have read Red Books, Green Books, Blue Books and Pink Books, but I still don't know the answer.
My PS script uses the DejaVuSansMono range of ttf fonts. A huge number of characters are included in the ttf files, but when I print text, only the basic characters print correctly. Any accented characters (for example) print as gobbledegook. So I tried changing the encoding from Standard to ISO Latin 1 as per various googled suggestions, but that made little difference. Then I converted the DejaVuSansMono ttf file to Type 42, and embedded that in my PS script. The gobbledegook changed to whatsits but still no accented characters. Anyway, I find it difficult to believe that it should be necessary to create and embed Type 42 fonts for each of the various ttf fonts that are used in the script.
May be I need to hand craft a dictionary for each font? Again, hard to believe.
I don't think it can be that difficult, can it?
r/PostScript • u/Unknown272727 • Feb 20 '21
I’m printing a postscript file, but the image is about 1 inch too far to the right of the page, is there a simple way to shift the whole page setup left by 1inch? (Yes I am completely new to postscript)
r/PostScript • u/TinyFerret • Mar 08 '18
CvtPost is a *nix command line utility to convert various text files to postscript. It handles ASCII and EBCDIC natively, can do form overlays, all kinds of great things. Unfortunately, the author's site has disappeared from the net, and I need part of the source code again.
I would like to upgrade some equipment and move to a 64-bit kernel, but for one reason or another, the code was published in three pieces: The cvtpost source code, cvtpost list routines, and cvtpost hash routines. All three are required, and I'm lacking the list and hash routines. The wayback machine has the site archive from 2001, but none of the source code, which was hosted on an ftp site at manatee.nss.udel.edu.
Can anyone either direct me to another source for the cvtpost code, or a viable alternative? I need to be able to specify font sizes (both in points and height/width), alignment parameters, overlays, etc. Page by page is not an option, as I routinely handle 30-50k pages at a time.
r/PostScript • u/luserdroog • May 21 '16
r/PostScript • u/luserdroog • Feb 13 '16
r/PostScript • u/sleepingsquirrel • Feb 06 '13