User Tools

Site Tools



Library for reading and writing PDF files.

PDF files can be opened and all PDF objects are available as Smalltalk objects, which can be manipulated in any way you like. Likewise, any Smalltalk PDF object (net) can be written out as conforming PDF file.

The library implements the PDF specification (ISO standard PDF 32000-1:2008) in Cincom's VisualWorks Smalltalk in version 7.10 and up. The syntax is covered comprehensively, which means that any PDF file can be read and any PDF object can be written in a conforming way.

The Library

The library is for programmers who need full control over all details of PDFs.

The licence is MIT.

PDF objects are typically dictionaries or arrays. The object types and their attributes are well documented by the PDF Specification. The library defines many PDF objects as Smalltalk objects (and it is easy to add more PDF types).

The code is as close to the specification as possible. The names of types and attributes are directly used for the implementation when appropriate. When studying the PDF specification (a nice read in most parts!), it is easy to find the relevant implementation in the library.

The library code is annotated with the original descriptions and definitions from the specification, so that learning about PDF itself is well supported.

Included is a UI tool to inspect PDFs: the PDFExplorer.

What's new

This is version 2.0 of the library (October 2017). See the release notes for details.

Name The new name is PDFtalk. The first version was called PDF4Smalltalk. The namespace changed from PDF to PDFtalk and the domain “” provides a home with a wiki dedicated to the library:

Typing The heard of the “PDF engine” is the typing system which allows the assignment of Smalltalk classes to raw PDF objects. The new version has a redesigned type system where PDF types are properly modeled independent from the Smalltalk class hierarchy. This allows to rename classes freely (i.e. adding prefixes) without affecting PDF types. Also, boxing of some simple objects like “null” and booleans is not necessary anymore. Instead, existing classes are declared as PDF types.

PDFtalk for Gemstone The new release was triggered by a contract to port the library to Gemstone (thanks to HTS and Bob Nemec). A talk about this was held at ESUG 2017: “PDFtalk for Gemstone” (slides are here).

Gemstone Fileout A VisualWorks to Gemstone translation tool. This tool, with project specific code transformation declarations, creates a Gemstone filein. Used to create the Gemstone PDFtalkLibrary from the Values package and PDFtalk bundle.

Both new projects are open source with MIT licence.

Get started

The slides "PDF in Smalltalk" (a talk at ESUG 2011), give an overview of what this project is about.

Load the {PDFtalk Project} bundle from the Cincom Public Store into your VisualWorks image.

Try the demos and examples.

To get the latest news and to participate in discussions, subscribe to the mailing list.


The PDF specification is extensive. The implementation covers the core mechanisms to read and write PDF objects in a conforming way. This is comparable to the virtual machine and core classes in Smalltalk. Many of the PDF features and possibilities are implemented by sets of PDF types and a clear definition of their structure and interplay. This compares to class libraries in Smalltalk.

PDF has many features which are more or less independent from each other. Implementing a PDF feature with the PDFtalk library means to define classes for each relevant PDF type for the feature and providing some automations or helpers for constructing the proper structures.

Some simple features are implemented by the library apart from the core mechanisms. Many others are not. For an overview see the state of the implementation. The documentation here is not comprehensive and covers only a few topics.

Using the library

  • Text Shows how to put text on a page.
  • Colors Usage of colorspaces and colors
  • Images Bitmapped images in PDF
  • Examples Various examples of Smalltalk generated PDF documents.

About the library

  • Implementation Notes the state of the implementation of the features structured along the specification chapters.
  • Typing PDF attributes are typed. To make use of this, the typing system was implemented. Since this is complex, it deserves its own topic.
  • Extending How to add a new PDF Object to the library from the specification.
  • Complex Values The paper and slides about the basic values framework.

Brief descriptions of the releases are documented in the History of the project.


The slides "PDF in Smalltalk" from the ESUG 2011 talk give an overview.

The slides "PDFtalk for Gemstone" from the ESUG 2017 talk.

The project was discussed in a podcast (German) from Smalltalk Inspect (mentioned in Joachims Small World).

Bob Nemec is using the library to build a report generator!

start.txt · Last modified: 2017/10/12 14:48 by christian