Search code examples
pdfprologpostscripteps

How to use Prolog to print a PDF file


I am a newbie to Prolog and was just wondering if there is a way to print something to a pdf file.


Solution

  • I recommend you create a PostScript file first and only then convert that file into a PDF file. If you worry about incompatibilities, PDF and PostScript are both from Adobe. PostScript was there first for a decade. PDF is essentially an unreadable form of PostScript. However, you can edit PostScript files as regular text files. And, even better, PostScript is a full programming language! It is a bit unconventional, and similar to but cleaner than Forth.

    I recommend as introductory text A first guide to PostScript by Peter Weingartner. Don't shy away reading it, it is definitely less effort than reading the documentations of libraries in other programming languages. And, in the end you have a truly device independent way to represent your graphics! Even more, you will be able to talk to a printer directly!

    To give you a head start, here is a tiny quiz about roman numerals as an eps-file. Thus an encapsulated postscript file.