This repository is a fork of bblanchon/pdfium-binaries that adds extra PDFium API functions useful for advanced PDF text extraction and analysis.
All additional patches live in patches/llamaparse/. The patches expose functions for:
- Font type detection (
FPDFFont_GetType) - Charcode-based glyph width and path retrieval (
FPDFFont_GetGlyphWidthFromCharCode,FPDFFont_GetGlyphPathFromCharCode) - Original character code access (
FPDFText_GetCharCode) - Annotation object numbers (
FPDFAnnot_GetObjNum) - Structure element child object numbers (
FPDF_StructElement_GetChildObjNum)
Here are the download links for the latest release:
| OS | Env | CPU | PDFium | PDFium V8 |
|---|---|---|---|---|
| Linux | glibc | arm | pdfium-linux-arm.tgz | pdfium-v8-linux-arm.tgz |
| arm64 | pdfium-linux-arm64.tgz | pdfium-v8-linux-arm64.tgz | ||
| ppc64 | pdfium-linux-ppc64.tgz | not available | ||
| x64 | pdfium-linux-x64.tgz | pdfium-v8-linux-x64.tgz | ||
| x86 | pdfium-linux-x86.tgz | pdfium-v8-linux-x86.tgz | ||
| macOS | arm64 | pdfium-mac-arm64.tgz | pdfium-v8-mac-arm64.tgz | |
| x64 | pdfium-mac-x64.tgz | pdfium-v8-mac-x64.tgz | ||
| univ | pdfium-mac-univ.tgz | pdfium-v8-mac-univ.tgz | ||
| Windows | arm64 | pdfium-win-arm64.tgz | pdfium-v8-win-arm64.tgz | |
| x64 | pdfium-win-x64.tgz | pdfium-v8-win-x64.tgz | ||
| x86 | pdfium-win-x86.tgz | pdfium-v8-win-x86.tgz | ||
| WebAssembly | pdfium-wasm.tgz | not supported | ||
See the Releases page to download older versions.
-
Unzip the downloaded package in a folder (e.g.,
C:\Libraries\pdfium) -
Set the environment variable
PDFium_DIRto this folder (e.g.,C:\Libraries\pdfium) -
In your
CMakeLists.txt, addfind_package(PDFium) -
Then link your executable with PDFium:
target_link_libraries(my_exe pdfium) -
On Windows, make sure that
pdfium.dllcan be found by your executable (copy it to the same folder, or add it to thePATH).
- Obtain PDFium source from https://pdfium.googlesource.com/pdfium/ (requires using Google's toolchain for configuring/building Chromium)
- Apply the current patchset to PDFium source (from pdfium repo):
patch --verbose -p1 <path-to-pdfium-binaries>/patches/llamaparse/pdfium.patch - Make additional changes
- To test changes, build locally using
build.sh:On x64 Linux, replacePDFium_URL=~/git/my-pdfium-fork/pdfium ./build.sh mac arm64mac arm64withlinux x64.
- To test changes, build locally using
- Generate a new patch with your changes relative to PDFium
main(from pdfium repo):git diff origin/main > <path-to-pdfium-binaries>/patches/llamaparse/pdfium.patch - Commit and push your new patch in this repository
- If your patch is large enough to warrant its own patch file, you will also need to add a corresponding
apply_patchcall insteps/03-patch.sh
- If your patch is large enough to warrant its own patch file, you will also need to add a corresponding
By default, the build scripts look for Xcode where it is installed on GitHub Actions (/Applications/Xcode_26.0.app).
If you have only one Xcode version installed, you may need to edit steps/01-install.sh to point to your local Xcode (i.e. /Applications/Xcode.app).
See the PDFium API documentation on developers.foxit.com.
This fork is based on bblanchon/pdfium-binaries. Additional patches by @pmrowla.
Disclaimer: This project isn't affiliated with Google or Foxit.
See LICENSE.