Need help with camlpdf?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

137 Stars 19 Forks Other 273 Commits 12 Opened issues


OCaml library for reading, writing and modifying PDF files

Services available


Need anything else?

Contributors list


CamlPDF is an OCaml library for reading, writing and modifying PDF files. It is the basis of the commercial "CPDF" command line tool, which is available at


Copyright Coherent Graphics Ltd 2007 - 2013. Released under the LGPL with special linking exception. See "LICENSE" for details.

To Build

If downloading from Github, obtain the correct source. This means choosing the tag for a particular version, such as "v2.1.1". The head of the master branch is unstable.

  1. Run "make". This will build camlpdf.a, camlpdf.cma, camlpdf.cmxa and the documentation (in doc/camlpdf/html).

  2. If your environment has "ocamlfind", "make install" will install the library. Otherwise, use the built outputs as you will.


The API documentation, which is built by the makefile in doc/camlpdf/html, can also be accessed online at

The file introduction-to-camlpdf.pdf will help the beginner.

Some level of knowledge of the PDF file format itself, which is large, may be required. The standard texts are the author's book:

and the ISO standard for PDF:


The file miniz.c is a (very slightly modified) version of the miniz.c zlib implementation by Rich Geldreich, available here:

The files flatestubs.c, and pdfflate.mli are a slightly modified version of some parts of CamlZip by Xavier Leroy. The originals are available here:

OCamlMakefile was written by Markus Mottl. It is available here:

These works are also released under the LGPL with special linking exception, as described in LICENCE.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.