PDF Command Line Tools Source
  • OCaml 69.7%
  • TeX 23.1%
  • HTML 2.6%
  • C 2.4%
  • Roff 2%
  • Other 0.1%
Find a file
2026-04-27 16:18:51 +01:00
compressor more 2023-04-13 16:56:32 +01:00
docsplits Ready for updated cpdfdocs.js 2024-05-10 14:20:36 +08:00
html_manual more 2026-03-16 15:09:20 +00:00
manualimages docs 2024-09-23 16:32:05 +01:00
.gitignore more 2017-01-12 19:53:46 +00:00
Changes.txt thinner lines 2026-04-13 12:09:47 +01:00
cpdf.1 Fix -text-* documentation 2026-04-06 13:11:49 +01:00
cpdf.1.html Fix -text-* documentation 2026-04-06 13:11:49 +01:00
cpdf.1.md Fix -text-* documentation 2026-04-06 13:11:49 +01:00
cpdf.install Move .install file to root 2023-08-15 17:58:29 +01:00
cpdf.opam v2.9 2026-03-13 14:21:37 +00:00
cpdfaddtext.ml Text boxes 2026-04-14 13:14:56 +01:00
cpdfaddtext.mli Adds -url-border 2026-03-31 14:10:15 +01:00
cpdfannot.ml Allow all annotation types to be listed 2025-10-31 15:42:28 +00:00
cpdfannot.mli more 2023-04-22 16:58:05 +01:00
cpdfattach.ml Remove debug printf 2026-01-29 11:16:55 +08:00
cpdfattach.mli Can add relationships and descriptions to doc level annotations now 2025-07-03 16:10:34 +01:00
cpdfbookmarks.ml Allow Int/Float to appear in CPDFJSON and CPDF bookmark JSON 2025-06-04 11:43:30 +01:00
cpdfbookmarks.mli preserve_actions 2025-03-15 14:43:42 +00:00
cpdfchop.ml Finished -chop-v, -chop-h 2024-02-05 15:29:54 +00:00
cpdfchop.mli Docstring fixes for v2.7 2024-03-04 15:16:14 +00:00
cpdfclip.ml Import GPC, prepare for redaction 2026-04-06 15:10:16 +01:00
cpdfclip.mli Import GPC, prepare for redaction 2026-04-06 15:10:16 +01:00
cpdfcolours.ml more 2023-06-07 16:35:26 +01:00
cpdfcolours.mli Documentation for new v2.6 features 2023-07-27 12:05:18 +01:00
cpdfcommand.ml Adds -reveal-text 2026-04-27 13:11:45 +01:00
cpdfcommand.mli Clean up Cpdfcommand/Cpdfdrawcontrol mutual recursion 2023-10-04 15:07:29 +01:00
cpdfcommandrun.ml Return cpdf.top to working order 2022-01-11 19:13:46 +00:00
cpdfcomposition.ml Add piece info to composition 2024-11-05 11:51:47 +00:00
cpdfcomposition.mli Docstring fixes for v2.7 2024-03-04 15:16:14 +00:00
cpdfcontent.ml Preparatory work for shadings 2026-04-27 16:18:51 +01:00
cpdfcontent.mli Preparatory work for shadings 2026-04-27 16:18:51 +01:00
cpdfcoord.ml Allows auto-calculation in -scale-to-fit 2025-06-20 16:21:11 +01:00
cpdfcoord.mli More docstrings 2026-01-01 14:28:33 +00:00
cpdfcreate.ml Newly-created files get IDs by default 2023-05-09 15:02:59 +01:00
cpdfcreate.mli more 2022-01-13 16:35:03 +00:00
cpdfdebug.ml more 2021-12-21 11:12:52 +00:00
cpdfdebug.mli more 2022-01-13 13:43:23 +00:00
cpdfdraft.ml progress on progress 2025-06-22 20:13:04 +01:00
cpdfdraft.mli more 2022-01-13 16:35:03 +00:00
cpdfdraw.ml Remove old ExtractText code 2026-03-27 16:19:53 +00:00
cpdfdraw.mli Fix source + docs for v2.7.2 2024-10-23 15:26:14 +01:00
cpdfdrawcontrol.ml Begin to allow PNGs with transparency 2025-09-23 17:49:53 +01:00
cpdfdrawcontrol.mli Begin to allow PNGs with transparency 2025-09-23 17:49:53 +01:00
cpdfembed.ml All TOC PDF/UA examples now work 2025-03-08 15:55:45 +00:00
cpdfembed.mli Move Standard 14 substitute loading into Cpdfembed 2024-04-01 19:03:31 +01:00
cpdferror.ml First working roundtrip structure tree 2024-06-05 15:26:12 +01:00
cpdferror.mli more 2022-01-13 13:43:23 +00:00
cpdfextracttext.ml more 2022-09-27 19:58:27 +01:00
cpdfextracttext.mli Documentation for new v2.6 features 2023-07-27 12:05:18 +01:00
cpdffont.ml More injectible checks 2025-04-24 17:24:34 +01:00
cpdffont.mli New font strategy for 10_001 2025-01-28 16:39:10 +08:00
cpdfimage.ml Plumbing for CCITTG4 external 2025-12-29 15:41:09 +00:00
cpdfimage.mli More docstrings 2026-01-01 14:28:33 +00:00
cpdfimpose.ml Implement -relative-to-[trim|bleed|art]box 2026-01-26 13:58:43 +08:00
cpdfimpose.mli Impose/Artifact 2025-03-19 15:48:46 +00:00
cpdfjpeg.ml Allow external JPEG dimens getter as backup 2025-07-05 13:46:41 +01:00
cpdfjpeg.mli Allow external JPEG dimens getter as backup 2025-07-05 13:46:41 +01:00
cpdfjpeg2000.ml Silence no-return warning 2024-04-16 07:49:11 +08:00
cpdfjpeg2000.mli Skeleton for JPEG2000 support 2024-03-20 20:24:44 +00:00
cpdfjs.ml Finishes -contains-javascript and -remove-javascript 2025-06-03 16:03:13 +01:00
cpdfjs.mli Finishes -contains-javascript and -remove-javascript 2025-06-03 16:03:13 +01:00
cpdfjson.ml More state, fix flatness representation 2026-04-16 17:10:41 +01:00
cpdfjson.mli v2.6 documentation 2023-07-27 13:21:15 +01:00
cpdfmanual.pdf manual 2026-04-07 14:59:34 +01:00
cpdfmanual.tex Adds -reveal-text 2026-04-27 13:11:45 +01:00
cpdfmetadata.ml Adds -extract-all-metadata 2025-09-09 16:45:06 +01:00
cpdfmetadata.mli Adds -extract-all-metadata 2025-09-09 16:45:06 +01:00
cpdfocg.ml Simplify 2026-03-24 16:47:13 +00:00
cpdfocg.mli Scaffolding for -ocg-list-json and -ocg-replace 2026-02-17 14:07:47 +08:00
cpdfpad.ml -pad-after and -pad-before fixed to allow unsorted range 2025-12-04 17:34:35 +00:00
cpdfpad.mli more 2022-01-13 16:18:54 +00:00
cpdfpage.ml Implement -relative-to-[trim|bleed|art]box 2026-01-26 13:58:43 +08:00
cpdfpage.mli Implement -relative-to-[trim|bleed|art]box 2026-01-26 13:58:43 +08:00
cpdfpagelabels.ml Tidy up new JSON methods after testing 2026-01-29 12:32:42 +08:00
cpdfpagelabels.mli Scaffolding for -add-page-labels-json 2026-01-28 15:20:26 +08:00
cpdfpagespec.ml Better debug text for nonexistant pages 2025-12-30 15:28:30 +00:00
cpdfpagespec.mli Remove unneeded pagespec stuff 2025-06-30 18:16:27 +01:00
cpdfpng.ml Allow Cpdfpng to read alpha-channel PNGs 2025-09-22 18:32:58 +01:00
cpdfpng.mli Extend PNG loading to greyscale and 16bpp 2024-01-01 11:46:32 +00:00
cpdfportfolio.ml Tidy up docs and remove cpdfform 2026-01-01 14:37:23 +00:00
cpdfportfolio.mli Tidy up docs and remove cpdfform 2026-01-01 14:37:23 +00:00
cpdfposition.ml More positions 2023-04-07 15:31:21 +01:00
cpdfposition.mli More positions 2023-04-07 15:31:21 +01:00
cpdfpresent.ml more 2021-12-17 16:12:03 +00:00
cpdfpresent.mli more 2022-01-13 15:18:21 +00:00
cpdfprinttree.ml Add Jambon's tree printer 2024-06-27 13:36:05 +01:00
cpdfprinttree.mli Docstrings 2024-07-24 15:05:02 +01:00
cpdfredact.ml Preparatory work for shadings 2026-04-27 16:18:51 +01:00
cpdfredact.mli Adds light bboxes 2026-04-22 14:54:59 +01:00
cpdfremovetext.ml progress on progress 2025-06-22 12:40:01 +01:00
cpdfremovetext.mli Documentation for new v2.6 features 2023-07-27 12:05:18 +01:00
cpdfshape.ml Removal or commenting of unused code 2024-02-23 16:17:12 +00:00
cpdfshape.mli Documentation for new v2.6 features 2023-07-27 12:05:18 +01:00
cpdfspot.ml Removal or commenting of unused code 2024-02-23 16:17:12 +00:00
cpdfspot.mli more 2022-01-13 16:18:54 +00:00
cpdfsqueeze.ml Avoid merging annotations when squeezing 2025-07-03 18:09:45 +01:00
cpdfsqueeze.mli Deprecate -squeeze-no-recompress 2023-06-21 15:38:32 +01:00
cpdfstrftime.ml Clear cruft 2025-12-09 17:17:43 +00:00
cpdfstrftime.mli stderr unbuffered 2021-07-23 16:26:07 +01:00
cpdftexttopdf.ml Clean up chains 2024-10-23 13:44:31 +01:00
cpdftexttopdf.mli Scaffolding for struct trees in typesetter 2024-10-02 13:27:57 +01:00
cpdftoc.ml TOC works in PDF/UA2 2025-03-20 14:53:44 +00:00
cpdftoc.mli Plumb subformat through to -table-of-contents 2025-03-19 16:28:06 +00:00
cpdftruetype.ml Truetype cmap matterhorns 2024-06-21 17:27:40 +01:00
cpdftruetype.mli Truetype cmap matterhorns 2024-06-21 17:27:40 +01:00
cpdftweak.ml Adds -reveal-text 2026-04-27 13:11:45 +01:00
cpdftweak.mli Adds -reveal-text 2026-04-27 13:11:45 +01:00
cpdftype.ml progress on progress 2025-06-22 20:41:02 +01:00
cpdftype.mli Support PDF/UA annotations 2025-02-26 16:37:27 +00:00
cpdfua.ml Complete 30_002 2025-03-27 13:05:47 +00:00
cpdfua.mli Stamp remove struct tree / artifacts 2025-03-11 14:28:55 +00:00
cpdfunicodedata.ml Removal or commenting of unused code 2024-02-23 16:17:12 +00:00
cpdfunicodedata.mli more 2022-01-13 13:43:23 +00:00
cpdfunicodedata.source.ml Removal or commenting of unused code 2024-02-23 16:17:12 +00:00
cpdfutil.ml progress on progress 2025-06-22 13:13:41 +01:00
cpdfutil.mli More docstrings 2026-01-01 14:28:33 +00:00
cpdfxmlm.ml Remove -w3 and fix deprecations 2022-04-09 14:13:12 +02:00
cpdfxmlm.mli Yojson in 2021-10-05 17:16:13 +01:00
cpdfxobject.ml progress on progress 2025-06-22 20:41:02 +01:00
cpdfxobject.mli more 2022-01-13 16:35:03 +00:00
cpdfyojson.ml Fix license, YoJson attribution 2024-08-02 18:11:37 +01:00
cpdfyojson.mli Fix license, YoJson attribution 2024-08-02 18:11:37 +01:00
doublemkinstall first 2025-04-25 13:08:27 +01:00
fixcpdfmanual PDF manual accessibility fixes 2024-12-08 12:45:35 +00:00
gpc.c Import GPC, prepare for redaction 2026-04-06 15:10:16 +01:00
gpc.h Import GPC, prepare for redaction 2026-04-06 15:10:16 +01:00
gpcml.c Import GPC, prepare for redaction 2026-04-06 15:10:16 +01:00
hello.pdf Update 2024-10-28 12:32:14 +00:00
LICENSE.md Fix license, YoJson attribution 2024-08-02 18:11:37 +01:00
logo.pdf Fixed building of cpdfmanual.tex by adding logo.pdf 2013-08-29 12:12:36 +01:00
Makefile Import GPC, prepare for redaction 2026-04-06 15:10:16 +01:00
META v2.9 2026-03-13 14:21:37 +00:00
mkinstall install script 2021-06-20 16:27:46 +01:00
mkman Remove groff 2026-01-27 09:45:43 +08:00
OCamlMakefile more 2025-05-05 14:45:48 +01:00
README.md Fix URLs 2026-04-23 17:56:49 +01:00

cpdf logo

Coherent PDF Command Line Tools

(If you are looking for binaries, there are here: https://www.github.com/coherentgraphics/cpdf-binaries )

CPDF is distributed under the AGPL - see LICENSE.md. If you are unable to abide by the terms of the AGPL, you will need a commercial license.

See also original copyright and/or license statements in cpdfxmlm.ml*, cpdfyojson.ml*, cpdfua.ml, and cpdfunicodedata.*

For commercial licenses, email contact@coherentgraphics.co.uk or visit https://www.coherentpdf.com/

Copyright Coherent Graphics Ltd 2026.

Keep up to date by joining the very low volume cpdf-announce mailing list:

https://groups.google.com/g/cpdf-announce/

This code builds two things:

a) The CPDF PDF command line tool for editing PDF files.

b) cpdf as an OCaml library, for which documentation is here:

https://coherentpdf.com/cpdf/

Prerequisites to build

The OCaml compiler

https://ocaml.org

The camlpdf library

https://github.com/johnwhitington/camlpdf

The ocamlfind library manager

https://projects.camlcity.org/projects/findlib.html

If you are using the OPAM package manager:

https://opam.ocaml.org

these can be installed by:

opam install camlpdf

To build

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

  1. Type make to make the cpdf executable and the library

  2. Type make install to install the OCaml cpdf library.

The cpdf executable should be manually placed somewhere suitable.

Alternatively, the library and command-line binary can be installed by

opam install cpdf

Binaries: https://www.github.com/coherentgraphics/cpdf-binaries

Cpdf may also be included in your package manager, but do check the version.

Documentation

The file cpdfmanual.pdf in this folder is the documentation for the command line tools. The documentation for the cpdf OCaml library is in doc/html/cpdf/ in this folder once the library has been built.

C API

A C interface to cpdf is available, in source and binary form:

https://github.com/johnwhitington/cpdflib-source

https://github.com/coherentgraphics/cpdflib-binary

Python API

A Python interface to cpdf is available:

https://pypi.org/project/pycpdflib

Java API

A Java interface to cpdf is available:

https://github.com/coherentgraphics/jcpdf

.NET API

A .NET interface to cpdf is available:

https://github.com/coherentgraphics/dotnet-libcpdf

JavaScript API

A JavaScript version of cpdf, for server and client side is available:

Distribution: https://www.npmjs.com/package/coherentpdf

Source: https://github.com/coherentgraphics/coherentpdf.js

Acknowledgments

The file cpdfxmlm.ml was written by Daniel Bünzli.

The file cpdfyojson.ml was written by Martin Jambon and others.

The files gpc.c and gpc.h were written by Alan Murta.

Unicode Data Files are under the Unicode Inc. License agreement.

The error descriptions for -verify "PDF/UA-1(matterhorn)" come from the PDF Association, and are licensed under the Creative Commons Attribution 4.0 International license.

PDF/UA support in Cpdf was implemented under NLnet grant 2023-12-031.

Contact

contact@coherentgraphics.co.uk