Skip to content

run-llama/pdfium-binaries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

534 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pre-compiled binaries of PDFium (LlamaIndex fork)

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)

Download

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.

How to use PDFium in a CMake project

  1. Unzip the downloaded package in a folder (e.g., C:\Libraries\pdfium)

  2. Set the environment variable PDFium_DIR to this folder (e.g., C:\Libraries\pdfium)

  3. In your CMakeLists.txt, add

     find_package(PDFium)
    
  4. Then link your executable with PDFium:

     target_link_libraries(my_exe pdfium)
    
  5. On Windows, make sure that pdfium.dll can be found by your executable (copy it to the same folder, or add it to the PATH).

Contributing patches to PDFium

  1. Obtain PDFium source from https://pdfium.googlesource.com/pdfium/ (requires using Google's toolchain for configuring/building Chromium)
  2. Apply the current patchset to PDFium source (from pdfium repo):
    patch --verbose -p1 <path-to-pdfium-binaries>/patches/llamaparse/pdfium.patch
    
  3. Make additional changes
    • To test changes, build locally using build.sh:
      PDFium_URL=~/git/my-pdfium-fork/pdfium ./build.sh mac arm64
      
      On x64 Linux, replace mac arm64 with linux x64.
  4. 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
    
  5. 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_patch call in steps/03-patch.sh

macOS local development

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

PDFium API documentation

See the PDFium API documentation on developers.foxit.com.

Acknowledgments

This fork is based on bblanchon/pdfium-binaries. Additional patches by @pmrowla.

Disclaimer: This project isn't affiliated with Google or Foxit.

License

See LICENSE.

About

LlamaParse fork of bblanchon/pdfium-binaries

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors