-
Notifications
You must be signed in to change notification settings - Fork 217
Project principles
The PDFWriter library enables you to quickly generate PDF files in a simple one-off method.
The principles of the project are:
- To create a free library that would allow generating PDF files.
- One-off file creation, to allow streaming and to maintain low memory consumption even for very large files.
- To be fast and memory-efficient.
- To be highly extensible, to account for features that will not be implemented.
- To support large files (to serve VDP, for example)
- To first build a simple rendering context.
The last point needs further explanantion. The library is first and foremost trying to make it possible for a driver writer that used to write for JPG, Postscript and others to also write PDF output. Therefore it is assumed that the client will know how to do “complex” and generic things such as to encode and compose text, while not know how to represent fonts in PDF. they will know how to describe content, but not how to write PDF dictionaries and streams.
The principles of creating one-off file creation as well as be fast and memory efficient, is to be fulfilled by the library objects writing method. any object that the user is adding to the PDF model is written directly to the output stream. Once written an object may no longer be changed. This allows the library to avoid holding a tree of all objects, but just keep a relatively small object model to provide for objects that must be accumulative, such as the page tree or the Xref object. This sort of implementation has some other side effects:
- Since most of the work is done as the process of building the PDF goes, and little is left for finalization, the PDF writing can potentially become multi-processed with high efficiency
- If makes sense – the PDF output file may be streamed. [right now PDF does not have a streaming model…but just in case]
There is one important trade-off with such a model and it is that objects already created/written cannot be modified. this requires planning at times. The effect may be lessened by using Forward referencing of objects, something which the library supports.
- First Steps In Creating a PDF file
- Creating PDF Pages
- Images Support
- Text Support
- Adding Content to PDF Pages
- Links
- Unicode and UnicodeString class
- PDF Embedding
- Custom input and output
- Using Form XObjects
- Forward Referencing
- JPG Images Support
- TIFF Images Support
- PNG Images support