PDFio is a simple C library for reading and writing PDF files.
Go to file
2021-05-02 09:59:33 -04:00
pdfio.xcodeproj Work on token parsing. 2021-05-01 17:50:52 -04:00
.gitignore Initial checkin. 2021-04-10 08:00:52 -04:00
FAQ.md Add start of FAQ. 2021-05-02 09:59:33 -04:00
LICENSE Initial checkin. 2021-04-10 08:00:52 -04:00
Makefile Work on token parsing. 2021-05-01 17:50:52 -04:00
NOTICE Initial checkin. 2021-04-10 08:00:52 -04:00
pdfio-array.c Add an Xcode project and fix some Clang-reported issues. 2021-05-01 07:36:19 -04:00
pdfio-common.c Token parsing code. 2021-05-01 22:38:11 -04:00
pdfio-dict.c Work on token parsing. 2021-05-01 17:50:52 -04:00
pdfio-file.c Work on token parsing. 2021-05-01 17:50:52 -04:00
pdfio-object.c Implement pdfioFileOpen reading of xref table. 2021-05-01 11:41:43 -04:00
pdfio-page.c Save work. 2021-04-27 21:22:34 -04:00
pdfio-private.h Token parsing code. 2021-05-01 22:38:11 -04:00
pdfio-stream.c Token parsing code. 2021-05-01 22:38:11 -04:00
pdfio-string.c Add an Xcode project and fix some Clang-reported issues. 2021-05-01 07:36:19 -04:00
pdfio-token.c Token parsing code. 2021-05-01 22:38:11 -04:00
pdfio-value.c Finish value copy, delete, and write methods. 2021-04-30 07:42:25 -04:00
pdfio.3 Initial checkin. 2021-04-10 08:00:52 -04:00
pdfio.h Token parsing code. 2021-05-01 22:38:11 -04:00
pdfio.html Initial checkin. 2021-04-10 08:00:52 -04:00
pdfio.md Initial checkin. 2021-04-10 08:00:52 -04:00
pdfio.pc.in Initial checkin. 2021-04-10 08:00:52 -04:00
README.md Update README to talk about Xcode project. 2021-05-01 07:43:39 -04:00
testpdfio.c Initial working pdfioFileOpen, test program. 2021-05-01 11:50:17 -04:00
testpdfio.pdf Add a simple PDF test document. 2021-05-01 09:29:10 -04:00
TODO.md Finish value copy, delete, and write methods. 2021-04-30 07:42:25 -04:00

pdfio - PDF Read/Write Library

pdfio is a simple C library for reading and writing PDF files. The primary goals of pdfio are:

  • Read any PDF file with or without encryption or linearization
  • Write PDF files without encryption or linearization
  • Extract or embed useful metadata (author, creator, page information, etc.)
  • "Filter" PDF files, for example to extract a range of pages or to embed fonts that are missing from a PDF
  • Provide access to objects used for each page

pdfio is not concerned with rendering or viewing a PDF file, although a PDF RIP or viewer could be written using it.

Installing pdfio

pdfio comes with a portable makefile that will work on any POSIX-compliant system with zlib installed. To make it, run:

make all

To test it, run:

make test

To install it, run:

make install

If you want a shared library, run:

make all-shared
make install-shared

The default installation location is "/usr/local". Pass the prefix variable to make to install it to another location:

make install prefix=/some/other/directory

The makefile installs the pdfio header to "${prefix}/include", the library to "${prefix}/lib", the pkg-config file to "${prefix}/lib/pkgconfig", the man page to "${prefix}/share/man/man3", and the documentation to "${prefix}/share/doc/pdfio".

The makefile supports the following variables that can be specified in the make command or as environment variables:

  • AR: the library archiver (default "ar")
  • ARFLAGS: options for the library archiver (default "cr")
  • CC: the C compiler (default "cc")
  • CFLAGS: options for the C compiler (default "")
  • CODESIGN_IDENTITY: the identity to use when code signing the shared library on macOS (default "Developer ID")
  • COMMONFLAGS: options for the C compiler and linker (typically architecture and optimization options, default is "-Os -g")
  • CPPFLAGS: options for the C preprocessor (default "")
  • DESTDIR" and "DSTROOT: specifies a root directory when installing (default is "", specify only one)
  • DSOFLAGS: options for the C compiler when linking the shared library (default "")
  • LDFLAGS: options for the C compiler when linking the test programs (default "")
  • LIBS: library options when linking the test programs (default "-lz")
  • RANLIB: program that generates a table-of-contents in a library (default "ranlib")
  • prefix: specifies the installation directory (default "/usr/local")

Xcode Project

There is also an Xcode project ("pdfio.xcodeproj") you can use on macOS which generates a static library that will be installed under "/usr/local" with:

sudo xcodebuild install

You can reproduce this with the makefile using:

sudo make 'COMMONFLAGS="-Os -mmacosx-version-min=10.14 -arch x86_64 -arch arm64e"' install

pdfio is Copyright © 2021 by Michael R Sweet.

This software is licensed under the Apache License Version 2.0 with an (optional) exception to allow linking against GPL2/LGPL2 software. See the files "LICENSE" and "NOTICE" for more information.