9 ms·
PostScript Language Reference (1999) [pdf]
- triska 5y agoPostScript is an amazing programming language, and this language reference manual is one of the greatest technical documentations I have ever seen, I highly recommend it! One of the few mistakes I found is on page 700, where the snippet (apparently accidentally copied from the documentation of fill on page 589): gsave fill grestore should be replaced by: gsave stroke grestore PostScript allows very concise and elegant programs, ideal to visualize information in readable and scalable ways. Also check out Display Postscript for inspiration: https://en.wikipedia.org/wiki/Display_PostScript https://en.wikipedia.org/wiki/Display_PostScript Rest in peace Charles Geschke, and thank you and your colleagues for PostScript!
- kenniskrag 5y agowhy does the fonts looks weird on ps documents compared to pdf?
- triska 5y agoThis highly depends on the software you use and how you generate PostScript files. To program with PostScript, and to display and print PostScript documents, I highly recommend Ghostscript, a PostScript interpreter: https://www.ghostscript.com/ https://www.ghostscript.com/ It is available on several platforms and can show the graphical output using windowing systems such as X11. Please see the project's documentation for more information, and consider filing an issue if it behaves in unexpected ways. The IRC channel #ghostscript on Freenode, and the newsgroup comp.lang.postscript are also good resources to learn more about PostScript and to ask questions. One interesting fact about PostScript fonts is that fonts are encoded in the same language as entire documents! This shows how versatile and general PostScript is. Here is more information about PostScript fonts: https://en.wikipedia.org/wiki/PostScript_fonts https://en.wikipedia.org/wiki/PostScript_fonts PostScript defines a set of fonts that must be supported by conforming interpreters, the so called Core Font Set: https://www-cdf.fnal.gov/offline/PostScript/PL3corefont.pdf https://www-cdf.fnal.gov/offline/PostScript/PL3corefont.pdf
- svat 5y agoJust a guess, but you may have in mind certain PS files generated by TeX/LaTeX from the 80s and 90s, back in the day when both PS-based workflows and raster (bitmap) fonts were more common than they are today. So, although it's not really a limitation of PostScript, for purely historical reasons there may be a correlation among academic documents between PS files and raster fonts, which (because of a lack of hinting) look worse on the screen, at resolutions other than the one they were tuned for. For such documents (try this if you have one of them), there is the amazing pkfix tool by Heiko Oberdiek: I had once written a blog post about this (https://shreevatsa.wordpress.com/2011/05/05/converting-old-ps-files https://shreevatsa.wordpress.com/2011/05/05/converting-old-p...) but you can read the TeX FAQ (http://www.texfaq.org/FAQ-pkfix http://www.texfaq.org/FAQ-pkfix) or even Wikipedia (https://en.wikipedia.org/w/index.php?title=Pkfix&oldid=712506547 https://en.wikipedia.org/w/index.php?title=Pkfix&oldid=71250...) or see it in action in this answer by the author: https://tex.stackexchange.com/questions/120260/making-low-quality-pdf-files-clearer/120273#120273 https://tex.stackexchange.com/questions/120260/making-low-qu...
- hnick 5y agoReally depends on the file, the font format, and viewing program (if you aren't talking about printing). Printed PS can look fine, and is still used in some industries for essential mail. Viewing programs are usually the poorer cousin of PDF viewers, presumably because PDF is much more easily parsed. PDF files tend to use TrueType fonts more, while PS might be using Type1, but that shouldn't matter much.
- aduitsis 5y agoI remember Sun Solaris workstations where the Display PostScript logo was visible when the X server was starting!
- WCSTombs 5y agoPostScript was one of the first two languages I took up pretty seriously (C being the other one) and helped get me into programming in general. I quickly fell in love with the elegant syntax and intuitive graphical capabilities. Sadly, I found PostScript itself not to be very convenient for general-purpose programming just due to the limited set of primitives available in the standard library, but as a special-purpose language, I got a lot of mileage out of it.
- techdragon 5y agoI have a copy of the 2nd edition Red Book PostScript reference manual and the section on Display PostScript always fascinated me, I really wish there was a good way to give it a shot but by the time I really got into it, it was already falling too far behind to remain compatible with anything I could readily get my hands on.
- anthk 5y agoYou can play Zork and any Infocom game with GhostScript: http://zzo38computer.org/zmachine/interp/zmachine.ps http://zzo38computer.org/zmachine/interp/zmachine.ps Also, Curses!. (curses.r10.z3).
- sega_sai 5y agoI liked how, back in the day, when the figures for the papers were in .eps format, I could just change the line-width on the plots by just editing the file. Now they are mostly pdf which is better for the file size, but worse for tinkering, or removing bits from the plots.
- axiolite 5y agoIt's easy to convert from PDF to EPS. Are you saying the PDF conversion step mangles it beyond recognition?
- sega_sai 5y agoI've just tried out of the interest making a plot in matplotlib, (1) save it to eps and (2) save it to pdf then convert to ps. And the original .eps is pretty readable, but the ps converted from pdf has some kind of "stream" encoding string. I.e. it's not really editable.
- exikyut 5y agoI think you're describing stream compression, which appears to be utterly ubiquitous to the point that the knobs to turn it off have either technically bitrotted or faded well below our collective awareness threshold. After poking around a bit I noticed ps2pdf supports a "CompressPages" option (https://web.mit.edu/ghostscript/www/Ps2pdf.htm https://web.mit.edu/ghostscript/www/Ps2pdf.htm), which might be what you're looking for. Alternatively you might use something like `qpdf --stream-data=uncompress input.pdf output.pdf`. qpdf (http://qpdf.sourceforge.net/ http://qpdf.sourceforge.net/) seems to be a good recommendation to add to the "mentally index the entire man page to know what it can do" list for anyone interested in PDF in general.
- hnick 5y agoI worked in a mail house and really liked the editable nature of PS files that we got. We could run them through data processing and easily add/remove/adjust data. Sometimes the clients would ask us to do it in our monthly work because engaging their internal IT was too much effort, so we simple edited the files in the same way every month automatically before printing. With the shift to PDFs though, it's way harder. Your simplest course to 'remove' data for printing is often drawing a white box on top of it but that but it won't reflow anything. It's more of an append-only format, core editing is possible but annoying, you need to use an actual PDF reader tool for text extraction and parsing rather than a Perl regex, you can't just reorder pages by cutting/pasting around the DSC %%Page: comments, etc.
- pavlov 5y agoHere’s an unpopular opinion: A language like PostScript would have been a much better foundation for the web than HTML+CSS+JS. Browser engines would be much simpler. The platform would have had rich design capabilities much earlier and easier. A simple Forth-style language would have been a much better compilation target for high-level app development languages than JS. And having programmability built in from the start would have forced browser developers to think about security models as an integral part of the platform.
- triska 5y agoI agree completely. At the very least, embedded PostScript should have been supported for scalable graphics from the beginning. We now have this "sort of" available with the HTML <canvas> element, which uses essentially PostScript primitives for drawing with JavaScript. However, this format is not amenable to easy automated processing within the language, because in contrast to PostScript, JavaScript is not a homoiconic language. A useful compromise between simplicity, security and flexibility could have been Encapsulated PostScript (EPS), a subset of PostScript with certain restrictions.
- gwright 5y agorelated: https://en.wikipedia.org/wiki/NeWS https://en.wikipedia.org/wiki/NeWS
- xpressvideoz 5y agoWouldn't that be slower? To this day, despite the continued efforts to improve the rendering speed, I hesitate a bit before opening PDF files due to their heaviness. In that alternative universe, would it be possible to optimize PS renderers to be on a par with HTML+CSS+JS renderers? I also guess such "webpages" would require more bandwidth because they need to include every font glyph used.
- kccqzy 5y agoPDF files can be heavy or light, just like a webpage can be heavy or light. These days most PDF files are machine generated without much care for file size and you get their stereotypical heaviness. If you take a bad webpage generator (such as Word 2003) you get highly complex and redundant markups too. Also PDFs can embed font glyphs. That doesn't mean they have to. Common fonts like Helvetica are even guaranteed to be available in any PDF viewer.
- satya71 5y agoTim Edwards of Open Circuit Design [1] created XCircuit, which allows drawing electrical circuits and the file format is PS. It’s still one of the best programs for publication quality circuit diagrams. [1] http://opencircuitdesign.com/xcircuit/ http://opencircuitdesign.com/xcircuit/
- neilv 5y agoIIRC, for PostScript development, you got two Adobe books -- the "red book" reference, and the "blue book" tutorial and cookbook. (I vaguely recall getting both of these Adobe PS books bundled by Sun for NeWS or OpenWindows development, maybe together with the traditional white&green Sun binders and/or the O'Reilly X books.) I learned enough from the Adobe blue book to do some snazzy printing. (HP PCL for non-PS LaserJets, which I also did, wasn't as cool.) IMHO, PS was a lot of fun, and a good way to be exposed to stack-based programming. (Forth also looks like it'd be fun, but PS had the visual construction aspect.) Looks like the blue book is available at: http://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF http://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF
- CodeWriter23 5y agoI had the same reaction after doing some PostScript last year, I wanted to go learn Forth.
- bear8642 5y agoLeo Brodie's book Starting Forth's good tutorial
- CodeWriter23 5y agoThanks!
- bear8642 5y agoYou're very welcome. For later exploration, JonesForth <https://github.com/phf/forth/tree/master/x86 https://github.com/phf/forth/tree/master/x86> is excellent exploration of Forth's internals. There were quite a few Forth stories a month or so ago if want more resources.
- DonHopkins 5y agoMitch Bradley (who's a Forth guru who wrote OpenFirmware) wrote a subset of Forth in PostScript: https://donhopkins.com/home/archive/forth/forth.ps https://donhopkins.com/home/archive/forth/forth.ps https://en.wikipedia.org/wiki/Open_Firmware https://en.wikipedia.org/wiki/Open_Firmware https://github.com/openbios/openfirmware https://github.com/openbios/openfirmware
- drfuchs 5y agoCreated with FrameMaker, as were many reference and user manuals in the day. The first editions of the PS and related manuals were done with FrameMaker when Frame was a separate company; Adobe liked it so much, they’d bought us by the time of this third edition. I wrote the code that outputs PostScript for a FrameMaker document; plus that which handles automatically generating the index, table of contents, list of figures, etc. Tricky back in the day that each chapter was a separate file, since large books could be too big to fit comfortably in memory all at once.
- wsh 5y agoThat’s true for the later editions, but the first (1985) editions of the red and blue books were produced using Scribe: https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF#page=242 https://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF#pag...
- drfuchs 5y agoRight; Frame was still beta in 86.
- DonHopkins 5y agoFrame even implemented an OPEN LOOK version of FrameMaker for The NeWS Toolkit in PostScript! https://en.wikipedia.org/wiki/Adobe_FrameMaker https://en.wikipedia.org/wiki/Adobe_FrameMaker >Sun Microsystems and AT&T were promoting the OPEN LOOK GUI standard to win over Motif, so Sun contracted Frame Technology to implement a version of FrameMaker on their PostScript-based NeWS windowing system. The NeWS version of FrameMaker was successfully released to those customers adopting the OPEN LOOK standards. We used to call it "PainMaker", because it was "riddled with features". I used NeWS FrameMaker to write the SimCity and HyperLook manuals. That was using a desktoptop publishing app with a PostScript user interface to write PostScript documents about a PostScript programmable and rendered hypercard-like user interface system used to implement an interactive resizable zoomable multiple view PostScript user interface to a game that lets you print your cities annotated with a PostScript graphics editor on a PostScript printer! (See pages 10-12 of the SimCity manual for a summary of features and screen snapshots.) https://donhopkins.com/home/HyperLook-SimCity-Manual.pdf https://donhopkins.com/home/HyperLook-SimCity-Manual.pdf https://donhopkins.com/home/HyperLook-Manual-Part-1-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-1-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-2-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-2-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-3-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-3-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-4-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-4-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-5-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-5-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-6-of-6.pdf https://donhopkins.com/home/HyperLook-Manual-Part-6-of-6.pdf
- protomyth 5y agoI loved Adobe's PostScript documentation. Its all excellent. I gotta admit that I liked PostScript better than Forth. Its definitions and the little differences made it funner. I often think it would be fun to do a version of PostScript as a normal scripting language. It would be fun.
- e19293001 5y agoFor those who are interested in playing around with printer vulnerabilities[0], a lot of them had been scanned by shodan[1]. [0] - http://hacking-printers.net/wiki/index.php/Main_Page http://hacking-printers.net/wiki/index.php/Main_Page [1] - https://www.shodan.io/search?query=HP+printer https://www.shodan.io/search?query=HP+printer
- TacticalCoder 5y agoPostScript has something really beautiful to it and I'm still in awe when I "netcat" a .ps file to the local IP address of my good old and trusty HP LaserJet 4M+. Elegance from another era.
- lmilcin 5y agoI remember writing an application in PS. That was my first job, in IT support, over 20 years ago. I was asked to prepare employee cards and I found doing thousands of these manually was a waste of time. So I wrote a script in Perl to download employee data from database, write it to file and then merge it with a PostScript program. The PostScript program would read the list of employees and format cards, 8 cards per A4 page. The names would be automatically scaled in PostScript so that they fit the predefined space nicely and the background would include nice procedurally generated pattern that would otherwise be very difficult to get. It is fun when your application actually runs on the printer!
- Evidlo 5y agoHow is Postscript support on consumer network printers nowadays? I've been spoiled at university with business-class printers everywhere, but I had trouble recently with a consumer printer that would print out plaintext when I sent postscript to its AppSocket port.
- steerablesafe 5y agoI played around with PostScript some time ago, it's actually a very approachable language. I could implement some "turtle graphics" functions and draw some fractals logo-style.
- stevesimmons 5y agoI used to love programming in PostScript, around 25 years ago. I used the red, blue and green books, plus the PS Language Reference. This post prompted me to put some of my old math notes up on GitHub [1]. The final chapter on coupled differential equations sends the DE's parameters to the PostScript printer, where my PS code would execute the different equations and directly draw the resulting phase portrait. My PS code is in that repo's README [1]. The final results are in the notes.pdf file [2]. The best examples are in the last few pages. [1] https://github.com/stevesimmons/maths132-notes https://github.com/stevesimmons/maths132-notes [2] https://github.com/stevesimmons/maths132-notes/blob/main/notes.pdf https://github.com/stevesimmons/maths132-notes/blob/main/not...