PDFio is a simple C library for reading and writing PDF files.
Go to file
2021-10-08 13:49:48 -04:00
.github Add prototype coverity Github Actions integration. 2021-10-05 18:06:03 -04:00
doc Tweak macOS build command. 2021-09-27 10:23:32 -04:00
pdfio.xcodeproj Add pdfioFileCreateOutput API (Issue #21) 2021-09-27 07:41:50 -04:00
testfiles Add ProPhotoRGB ICC profile. 2021-06-10 11:56:01 -04:00
.cppcheck Update Cppcheck exclusions. 2021-06-04 11:03:15 -04:00
.gitattributes Prep for first beta release. 2021-08-30 16:31:00 -04:00
.gitignore Add EPUB book cover. 2021-09-27 10:02:10 -04:00
.lgtm.yml Add LGTM exclusions file. 2021-08-24 12:06:27 -04:00
CHANGES.md Add some supporting documentation files. 2021-09-27 07:42:19 -04:00
CODE_OF_CONDUCT.md Add some supporting documentation files. 2021-09-27 07:42:19 -04:00
CONTRIBUTING.md Add some supporting documentation files. 2021-09-27 07:42:19 -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 Save work on AES and RC4. 2021-10-04 21:13:01 -04:00
makesrcdist Add ZIP file production. 2021-08-30 16:44:48 -04:00
NOTICE Rename as PDFio for consistency. 2021-05-30 07:10:44 -04:00
packages.config Add initial Nuget packaging files. 2021-07-30 20:33:21 -04:00
pdfio1.def Fix Windows DLL exports file. 2021-09-27 08:38:04 -04:00
pdfio_native.nuspec Fix pdfio_native.redist package name. 2021-10-08 13:49:48 -04:00
pdfio_native.props Update NuGet package info. 2021-09-01 17:09:05 -04:00
pdfio_native.redist.nuspec Fix pdfio_native.redist package name. 2021-10-08 13:49:48 -04:00
pdfio-array.c More efficiently implement reading of integers vs. indirect references. 2021-08-23 14:31:54 -04:00
pdfio-common.c Add pdfioFileCreateOutput API (Issue #21) 2021-09-27 07:41:50 -04:00
pdfio-content.c Fix LGTM warning, report errors to call. 2021-08-24 12:04:10 -04:00
pdfio-content.h Don't export color constants since that breaks with DLLs... (Issue #19) 2021-08-18 10:17:47 -04:00
pdfio-crypto.c Save work on AES and RC4. 2021-10-04 21:13:01 -04:00
pdfio-dict.c More efficiently implement reading of integers vs. indirect references. 2021-08-23 14:31:54 -04:00
pdfio-file.c Add placeholder password callback to support reading of encrypted PDF files in the future. 2021-09-27 08:37:14 -04:00
pdfio-md5.c Save work on AES and RC4. 2021-10-04 21:13:01 -04:00
pdfio-object.c Add pdfioFileCreateOutput API (Issue #21) 2021-09-27 07:41:50 -04:00
pdfio-page.c Rename as PDFio for consistency. 2021-05-30 07:10:44 -04:00
pdfio-private.h Save work on AES and RC4. 2021-10-04 21:13:01 -04:00
pdfio-rc4.c Save work on AES and RC4. 2021-10-04 21:13:01 -04:00
pdfio-stream.c Add pdfioFileCreateOutput API (Issue #21) 2021-09-27 07:41:50 -04:00
pdfio-string.c Doco updates. 2021-06-07 17:06:13 -04:00
pdfio-token.c More efficiently implement reading of integers vs. indirect references. 2021-08-23 14:31:54 -04:00
pdfio-value.c Fix bug with xref stream with no index. 2021-08-24 13:50:57 -04:00
pdfio.h Add placeholder password callback to support reading of encrypted PDF files in the future. 2021-09-27 08:37:14 -04:00
pdfio.pc.in Always require zlib. 2021-08-26 14:02:57 -04:00
pdfio.sln Add testpdfio target for MSVC. 2021-07-26 11:58:20 -04:00
pdfio.vcxproj Add pdfioFileCreateOutput API (Issue #21) 2021-09-27 07:41:50 -04:00
pdfio.vcxproj.filters Add testpdfio target for MSVC. 2021-07-26 11:58:20 -04:00
pdfio.vcxproj.user Initial Visual Studio support. 2021-06-21 11:39:06 -04:00
README.md Tweak macOS build command. 2021-09-27 10:23:32 -04:00
SECURITY.md Add some supporting documentation files. 2021-09-27 07:42:19 -04:00
testpdfio.c Add placeholder password callback to support reading of encrypted PDF files in the future. 2021-09-27 08:37:14 -04:00
testpdfio.vcxproj Add initial Nuget packaging files. 2021-07-30 20:33:21 -04:00
testpdfio.vcxproj.filters Add testpdfio target for MSVC. 2021-07-26 11:58:20 -04:00
testpdfio.vcxproj.user Add testpdfio target for MSVC. 2021-07-26 11:58:20 -04:00
ttf.c Expose CMap in TrueType files 2021-06-21 13:00:44 -04:00
ttf.h Expose CMap in TrueType files 2021-06-21 13:00:44 -04:00

pdfio - PDF Read/Write Library

Version Apache 2.0 Build Coverity Scan Status LGTM Grade LGTM Alerts

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

  • Read and write any version of PDF file
  • Provide access to pages, objects, and streams within a PDF file
  • Support reading encrypted PDF files
  • Support writing PDF files with digital signatures
  • 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.

Requirements

PDFio requires the following to build the software:

  • A C99 compiler such as Clang, GCC, or MS Visual C
  • A POSIX-compliant make program
  • ZLIB (https://www.zlib.net) 1.0 or higher

IDE files for Xcode (macOS/iOS) and Visual Studio (Windows) are also provided.

Documentation

See the man page (pdfio.3), frequently ask questions (FAQ.md), and full HTML documentation (pdfio.html) for information on using PDFio.

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")

Visual Studio Project

The Visual Studio solution ("pdfio.sln") is provided for Windows developers and generates the PDFIO1 DLL. You can also use NuGet to install the pdfio_native package.

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 arm64" 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.