Portable Document Format (PDF)
Two packages on SqueakMap do PDF:
PDFReader by Hans-Martin Mosner says: Beginnings of a PDF file reader.
Use at your own risk.
General usage:
inspect (PDFReader new scan: (FileStream readOnlyFileNamed: 'harddisk:docs:pdf:PDFSPEC13.PDF'); xrefSectionAndTrailer)
inspect the "Root" entry in that dictionary.
execute "PDFPageMorph new page: (self pageAt: 1); openInWorld"
to see the first page
SPL PDF Library by Initials for Squeak Code says: Write PDF files directly from within Squeak using the PDF Library Initials for Squeak Code reported on 27 April 2003 that:
I have ported the SPDF Library from VisualWorks to Squeak. It allows to
generate PDF files without the need of external tools.
The latest version has support for text, lines and TIFF images. The
library was developed and extended at SPL WorldGroup for specific
projects, and does what was needed for those projects. It is expected
that the library will continue to be extended over time as feedback is
received from the people using it.
Once you have loaded the package from SqueakMap, have a look at
PDFReportingSelfTest class>>test to get an idea of what the framework
can do.
Question: How does the EPS which is generated relate to the PDF?
The answer may be in the Portable Document Format Reference Manual Version 1.3 (this site has several versions of the PDF reference for download)
Paragraph 2.3.1 states that
Like Postscript PDF "draws" in a turtle graphic like manner objects (text, graphics) on a page.
The page marking operators are similar to the operators in Postscipt. However PDF is not a programming language with procedures, variables and control constructs.
A PDF file is well structured; it is more like a database.
Adapting the MorphicPostscript support to output PDF shouldn't be too hard. DWH has obtained the Smalltalk port of the Java PDF generation package jPDF http://www.splwg.com/Global/1,1004,50227,00.html. Mail him at mailto:dwighth@ipa.net to obtain a Smalltalk port (note: this port is for vanilla VWNC 3.0).