Coherent PDF Command Line Tools
Download Free Trial Evaluation
See manual
Custom Development
News Archive
Free PDF Library
Command Line Manual (HTML)
Proview: Mac PDF Editor

Back to main page

CamlPDF now lives at Github. The following information is for historical interest only.


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.

CamlPDF is released under a BSD licence with special exceptions. See the LICENCE file in the source for details.

CamlPDF forms the basis of our PDF Command-line Tools, our PDF Editor for Mac OS X and the PDF import for a major commercial vector graphics package.


  • Support for PDF versions 1.0-1.7;
  • Large file support: 64-bit file handles and fully tail-recursive;
  • Lazy data reading, lexing and parsing - Optionally reads and processes data only when it's required;
  • Depends only on zlib.

Notable Omissions

  • External streams.

Introduction to PDF with CamlPDF (PDF Document)


Utility Generic functions
Pdfio Generic I/O
Transform Affine transforms in two dimensions
Units Units and unit conversion
Paper Media sizes
Pdf Basic data types
Pdfcrypt Encryption / Decryption
Pdfwrite Write to file
Pdfcodec Compression and decompression
Pdfread Lexing and parsing
Pdfpages Lexing and parsing of graphics streams
Pdfdoc Document-level functions
Pdfannot Annotations
Pdffun PDF function parsing and evaluationSome types of function missing
Pdfspace Colour spacesSome types of colourspace missing
Pdfimage Image extractionIncomplete and unsupported
Fonttables / Glyphlist    Ancilliary font support
Pdftext Fonts and text extractionText extraction incomplete
Pdfgraphics Structured GraphicsIncomplete and unsupported
Pdfshapes Basic shapes
Pdfdate Representing and parsing PDF dates
Pdfmarks BookmarksIncomplete and unsupported
CFF Type 1 fontsIncomplete and unsupported


  • Pdfhello (create a Hello World PDF)
  • Pdfmerge (merge several files by concatenation)
  • Pdfdecomp (decompress all streams in a file)
  • Pdfdraft (replace images to produce a draft document)
  • Pdftest (read, decompress, recompress and write a PDF)
  • Pdfdecrypt (decrypt an encrypted PDF)


Version 0.5

source code and online documentation.

Earlier versions: Version 0.4 | Version 0.3 | Version 0.2 | Version 0.1


By email

PDF Solutions

We can supply Custom PDF tools.

Other software

Proper pages for these coming soon:

Camlpy - Ocaml / Python integration

Storing colours in 31 bits

A Caml Interface for the General Polygon Clipper

GraphPDF: A PDF Version of OCaml's Graphics Module

Page last updated: 3rd January 2016


Our Customers

Send us an email...

We will endeavour to respond the same day.

company logo
US: 8345 NW 66TH ST #5134, MIAMI FL 33166
1-877-398-7534 (Toll Free)
UK: 617 Fox Hollies Road, Hall Green, Birmingham, B28 9DR
Privacy Policy
© Coherent Graphics Ltd 2016,
Registered in London No 5971029
PDF and PostScript are trademarks of Adobe Inc