PyX is a Python package for the creation of PostScript, PDF, and SVG files. It combines an abstraction of the PostScript drawing model with a TeX/LaTeX interface. Complex tasks like 2d and 3d plots in publication-ready quality are built out of these primitives.
This is CamlPDF, an OCaml library for reading, writing and manipulating Adobe portable document files. CamlPDF consists of a set of low level modules for representing, reading and writing the basic structure of PDF, together with an initial attempt at a higher level API.