PDFio is a simple C library for reading and writing PDF files.
Go to file
2023-12-03 19:23:36 -05:00
.github Fix CodeQL config file syntax. 2022-12-09 11:31:56 -05:00
afl-input Fix AFL target, remove excess PDF test files. 2021-11-30 08:13:41 -05:00
doc Update documentation. 2023-11-15 09:28:57 -05:00
pdfio.xcodeproj Bump version and put PDFIO_VERSION definition in the pdfio.h header. 2023-10-06 14:38:38 -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 Don't include AFL files in source archives. 2021-11-30 08:46:43 -05:00
.gitignore Fix some warnings. 2023-12-03 19:23:36 -05:00
afl-pdf.dict Add AFL++ PDF dictionary. 2021-11-29 18:47:04 -05:00
CHANGES.md Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
CODE_OF_CONDUCT.md Add some supporting documentation files. 2021-09-27 07:42:19 -04:00
config.guess Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
config.sub Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
configure Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
configure.ac Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
CONTRIBUTING.md Update security reporting and contribution text. 2023-10-06 14:40:28 -04:00
install-sh Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
LICENSE Initial checkin. 2021-04-10 08:00:52 -04:00
Makefile.in Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
makesrcdist Add ZIP file production. 2021-08-30 16:44:48 -04:00
NOTICE Fix denial-of-service attack when reading corrupt PDF files. 2023-02-03 20:39:04 -05:00
packages.config Add initial Nuget packaging files. 2021-07-30 20:33:21 -04:00
pdfio_native.nuspec Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
pdfio_native.props Update NuGet package info. 2021-09-01 17:09:05 -04:00
pdfio_native.redist.nuspec Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
pdfio-aes.c Fix some minor Coverity-reported issues (added a check to suppress a warning, 2021-10-31 07:04:17 -04:00
pdfio-array.c Fix a few stack/buffer overflow bugs discovered by Bart, Steffan, and Mark from 2021-11-29 17:46:56 -05:00
pdfio-common.c Save work (debug printfs, etc.) 2023-11-15 08:38:47 -05:00
pdfio-content.c Fix some warnings. 2023-12-03 19:23:36 -05:00
pdfio-content.h Get rid of superfluous comments. 2023-10-06 14:40:08 -04:00
pdfio-crypto.c Range check encrypted string length (Issue #52) 2023-11-18 18:22:11 -05:00
pdfio-dict.c Fix denial-of-service attack when reading corrupt PDF files. 2023-02-03 20:39:04 -05:00
pdfio-file.c Fix some warnings. 2023-12-03 19:23:36 -05:00
pdfio-md5.c Fix warnings, update Xcode project. 2021-10-08 14:08:07 -04:00
pdfio-object.c Rework CR/LF skip code to be more consistent. 2023-10-06 14:41:55 -04:00
pdfio-page.c Add missing pdfioPageGetNumStreams and pdfioPageOpenStream functions. 2022-02-28 15:00:25 -05:00
pdfio-private.h added windows.h header for GetTempPathA 2023-10-10 09:12:03 +02:00
pdfio-rc4.c Update crypto callback to return the number of output bytes (to account for AES 2021-10-23 14:37:25 -04:00
pdfio-sha256.c Fix build error due to mismatched function declarations. 2023-03-20 08:19:31 -04:00
pdfio-stream.c Save work (debug printfs, etc.) 2023-11-15 08:38:47 -05:00
pdfio-string.c Doco updates. 2021-06-07 17:06:13 -04:00
pdfio-token.c Fix a couple issues with parsing PDF files produced by Microsoft Reporting 2023-10-06 10:46:30 -04:00
pdfio-value.c Range check encrypted string length (Issue #52) 2023-11-18 18:22:11 -05:00
pdfio.h Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
pdfio.pc.in Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
pdfio.sln Add testpdfio target for MSVC. 2021-07-26 11:58:20 -04:00
pdfio.vcxproj Bump version and put PDFIO_VERSION definition in the pdfio.h header. 2023-10-06 14:38:38 -04:00
pdfio.vcxproj.filters Fix Windows builds. 2021-10-26 07:12:41 -04:00
pdfio.vcxproj.user Initial Visual Studio support. 2021-06-21 11:39:06 -04:00
pdfio1.def Adopt autoconf (Issue #54) 2023-12-03 19:16:34 -05:00
pdfiototext.c Fix pdfioStreamGetToken implementation (wasn't flushing input), update 2022-03-01 09:18:56 -05:00
README.md Remove LGTM badges. 2023-10-06 14:40:40 -04:00
SECURITY.md Update security reporting and contribution text. 2023-10-06 14:40:28 -04:00
testpdfio.c Drop the FEFF prefix on Unicode strings. 2023-11-19 07:30:17 -05: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
testttf.c Fix another bug in the CMAPv4 code, and a bug in the unit test program. 2023-11-19 07:06:35 -05:00
ttf.c Fix another bug in the CMAPv4 code, and a bug in the unit test program. 2023-11-19 07:06:35 -05:00
ttf.h Merge TTF changes to fix off-by-one error. 2023-10-06 16:44:20 -04:00

pdfio - PDF Read/Write Library

Version Apache 2.0 Build Status Coverity Scan Status

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 and writing of encrypted PDF files
  • 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 macos install

PDFio is Copyright © 2021-2023 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.