I am a newbie to Prolog and was just wondering if there is a way to print something to a pdf file.
2 Answers
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.

- 10,264
- 13
- 101
- 209
-
1Nit: while based on earlier work from the 70s, Postscript came out in 83 or 84. – luser droog Nov 30 '11 at 16:54
-
From the preface of the 1985 reference manual: "The language had its beginnings in 1976 ...". 1978: JaM. 1982: PostScript. – false Nov 30 '11 at 19:47
-
1Thanks. Did you have a look at the quiz above? – false Nov 30 '11 at 21:42
-
1wow. an excellent example: DSC, distinct procset/script, In-Line SpecialFX! I could almost understand the whole thing before previewing. Is that the "real" roman style, with backwards letters? (I lent my paleography books to my mom.) – luser droog Nov 30 '11 at 23:17
-
You find that kind of roman numbers when glyphs are real types, cast in brass, gilded, thus not engraved, in particular in the 17th and 18th century, like [on the inscription below the quadriga](http://commons.wikimedia.org/wiki/Image:Wien_Josefsplatz.jpg). So the mold from the C was reused. BTW, it never looks good in Unicode: ⅭⅠↃ – false Nov 30 '11 at 23:47
I'm no expert but I think you'd have better chance by calling prolog from a c/c++/java program and export from there.

- 7,490
- 3
- 31
- 58