But I already wrapped this small library for Pharo/Squeak two years ago with a more natural Smalltalk interface. So one can write:
| document page image |
document := PDFDocument new.
page := document addPage.
image := document loadPNGImage: 'Image.png'.
page drawImage: image rectangle: (Rectangle origin: 72@72 extent: 144@144).
document saveToFile: 'documentWithImage.pdf'
My library is also mentioned as one of the options for generating PDF on the seaside PDF page.
I made the code available at http://www.squeaksource.com/HPDF.html and licensed it with MIT. Would be good if Marten will have a look and maybe port my code to VAST before doing any unnecessary work on his side...
Independent from that I would still like to write/see a PDF framework written in plain Smalltalk (similar to Java's iText).
The more I think about it the more I like the idea:
- Solutions like using external libraries or frameworks (LibHaru, ApacheFOP, ...) always have limits
- If any work would be done in Smalltalk one would have full control
- PDF is a nice document format that is usable on nearly any platform
- PDF is now more than just text and images - you can have interactive PDF forms, annotations, ...
- There is no unify way for reporting and printing in current Smalltalks
- Yes, there is a rough plain Smalltalk PDF Generator from Bruce Badger but the license is AFAIK restricted (I would prefer MIT)
- it would make up a nice GSOC/CampSmalltalk/Community project
- Smalltalk streams are much easier to use than Java streams
- the code would be nicely testable using unit tests
However - time is limited. But if anyone is interested feel free to contact me...
BTW: did you know that Bruno Lowagie (author of iText) changed the license of his Java PDF library to block his government.