Top Related Projects
PDF Reader in JavaScript
qpdf: A content-preserving PDF document transformer
A Python library for reading and writing PDF, powered by QPDF
PyMuPDF is a high performance Python library for data extraction, analysis, conversion & manipulation of PDF (and other) documents.
iText for Java represents the next level of SDKs for developers that want to take advantage of the benefits PDF can bring. Equipped with a better document engine, high and low-level programming capabilities and the ability to create, edit and enhance PDF documents, iText can be a boon to nearly every workflow.
Quick Overview
The bblanchon/pdfium-binaries repository provides pre-built binaries of PDFium, Google's open-source PDF rendering engine. It offers easy access to PDFium libraries for various platforms and architectures, simplifying the integration of PDF functionality into applications without the need for complex compilation processes.
Pros
- Ready-to-use binaries for multiple platforms (Windows, macOS, Linux) and architectures (x86, x64, arm64)
- Regular updates to keep pace with the latest PDFium releases
- Simplifies the integration of PDF rendering capabilities into projects
- Saves time and resources by eliminating the need for manual compilation
Cons
- Limited to pre-built binaries, which may not be suitable for users requiring custom builds
- Dependency on third-party builds, which may introduce potential security concerns
- May not include all possible build configurations or optimizations
- Limited control over the compilation process and included features
Getting Started
To use the PDFium binaries in your project:
- Visit the releases page of the repository.
- Download the appropriate binary for your platform and architecture.
- Include the downloaded library in your project's build process or runtime environment.
- Link against the PDFium library in your application.
For example, in a C++ project using CMake:
# CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(MyPDFApp)
# Specify the path to the PDFium library
set(PDFIUM_DIR "/path/to/pdfium")
# Include PDFium headers
include_directories(${PDFIUM_DIR}/include)
# Link against PDFium library
link_directories(${PDFIUM_DIR}/lib)
add_executable(MyPDFApp main.cpp)
target_link_libraries(MyPDFApp pdfium)
Note: The exact integration process may vary depending on your development environment and project setup.
Competitor Comparisons
PDF Reader in JavaScript
Pros of pdf.js
- Written in JavaScript, making it easily integrable into web applications
- Renders PDFs directly in the browser without additional plugins
- Extensive documentation and active community support
Cons of pdf.js
- May have slower performance for large or complex PDFs
- Limited support for some advanced PDF features
- Relies on browser capabilities, which can vary across different environments
Code Comparison
pdf.js:
PDFJS.getDocument('https://example.com/sample.pdf').then(function(pdf) {
pdf.getPage(1).then(function(page) {
var scale = 1.5;
var viewport = page.getViewport(scale);
// Render page on canvas
});
});
pdfium-binaries:
FPDF_DOCUMENT document = FPDF_LoadDocument("sample.pdf", nullptr);
FPDF_PAGE page = FPDF_LoadPage(document, 0);
double width = FPDF_GetPageWidth(page);
double height = FPDF_GetPageHeight(page);
// Render page using native methods
Summary
pdf.js is a JavaScript-based PDF renderer ideal for web applications, offering easy integration and cross-browser compatibility. However, it may have performance limitations for complex PDFs. pdfium-binaries, on the other hand, provides native PDF rendering capabilities with potentially better performance but requires more setup and is less web-friendly. The choice between them depends on the specific requirements of your project, such as target platform, performance needs, and development environment.
qpdf: A content-preserving PDF document transformer
Pros of qpdf
- Standalone C++ library for PDF manipulation, offering more flexibility and control
- Extensive command-line interface for various PDF operations
- Active development with regular updates and improvements
Cons of qpdf
- Requires more setup and integration effort compared to pre-built binaries
- May have a steeper learning curve for developers new to PDF manipulation
Code Comparison
qpdf:
QPDF pdf;
pdf.processFile("input.pdf");
QPDFWriter w(pdf, "output.pdf");
w.setStreamDataMode(qpdf_s_compress);
w.write();
pdfium-binaries:
FPDF_DOCUMENT doc = FPDF_LoadDocument("input.pdf", nullptr);
FPDF_SaveAsCopy(doc, "output.pdf", 0);
FPDF_CloseDocument(doc);
Summary
qpdf is a comprehensive PDF manipulation library, offering more control and features but requiring more setup. pdfium-binaries provides pre-built binaries for easier integration but may offer less flexibility. The choice depends on project requirements and developer expertise.
A Python library for reading and writing PDF, powered by QPDF
Pros of pikepdf
- High-level Python library for reading, manipulating, and writing PDF files
- Extensive documentation and active community support
- Supports a wide range of PDF operations, including merging, splitting, and encryption
Cons of pikepdf
- Requires Python knowledge and environment setup
- May have a steeper learning curve for beginners compared to pre-compiled binaries
- Performance might be slower for certain operations compared to native C++ implementations
Code comparison
pikepdf:
import pikepdf
pdf = pikepdf.Pdf.open("input.pdf")
pdf.save("output.pdf")
pdfium-binaries:
FPDF_DOCUMENT doc = FPDF_LoadDocument("input.pdf", nullptr);
FPDF_SaveAsCopy(doc, "output.pdf", 0);
FPDF_CloseDocument(doc);
Summary
pikepdf offers a more user-friendly Python interface for PDF manipulation, with extensive features and documentation. pdfium-binaries provides pre-compiled binaries of PDFium, offering potentially faster performance but requiring more low-level programming knowledge. The choice between the two depends on the specific project requirements, programming language preference, and the level of PDF manipulation needed.
PyMuPDF is a high performance Python library for data extraction, analysis, conversion & manipulation of PDF (and other) documents.
Pros of PyMuPDF
- Comprehensive PDF manipulation capabilities, including text extraction, rendering, and editing
- Extensive documentation and active community support
- Cross-platform compatibility with Python bindings
Cons of PyMuPDF
- Larger library size compared to pdfium-binaries
- May have a steeper learning curve for beginners
- Potentially slower performance for certain operations
Code Comparison
PyMuPDF:
import fitz
doc = fitz.open("example.pdf")
page = doc[0]
text = page.get_text()
pdfium-binaries:
FPDF_DOCUMENT doc = FPDF_LoadDocument("example.pdf", nullptr);
FPDF_PAGE page = FPDF_LoadPage(doc, 0);
// Additional code required for text extraction
PyMuPDF offers a more straightforward API for common PDF operations, while pdfium-binaries provides lower-level access to PDF functionality. PyMuPDF is better suited for Python developers looking for a comprehensive PDF library, whereas pdfium-binaries is ideal for projects requiring fine-grained control and custom implementations in C/C++.
iText for Java represents the next level of SDKs for developers that want to take advantage of the benefits PDF can bring. Equipped with a better document engine, high and low-level programming capabilities and the ability to create, edit and enhance PDF documents, iText can be a boon to nearly every workflow.
Pros of itext-java
- Comprehensive Java-based PDF library with extensive features for creating, manipulating, and processing PDF documents
- Active development and regular updates, with a large community and commercial support options
- Well-documented API with numerous examples and tutorials available
Cons of itext-java
- Commercial license required for many use cases, which can be costly for some projects
- Steeper learning curve due to its extensive feature set and API complexity
- Larger footprint and potential performance overhead compared to native bindings
Code Comparison
itext-java:
PdfDocument pdf = new PdfDocument(new PdfWriter("output.pdf"));
Document document = new Document(pdf);
document.add(new Paragraph("Hello, World!"));
document.close();
pdfium-binaries:
FPDF_DOCUMENT doc = FPDF_CreateNewDocument();
FPDF_PAGE page = FPDFPage_New(doc, 0, 595, 842);
FPDF_PAGEOBJECT text = FPDFPageObj_CreateTextObj(doc, "Arial", 12.0f);
FPDFText_SetText(text, "Hello, World!");
FPDFPage_InsertObject(page, text);
FPDF_SaveAsCopy(doc, "output.pdf", NULL);
Note: pdfium-binaries provides C/C++ bindings, so the code comparison is not directly equivalent. The itext-java example is in Java, while the pdfium-binaries example is in C++.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Pre-compiled binaries of PDFium
This project hosts pre-compiled binaries of the PDFium library, an open-source library for PDF manipulation and rendering.
Builds have been triggered automatically every Monday since 2017.
Disclaimer: This project isn't affiliated with Google or Foxit.
Download
Here are the download links for latest release:
1: WebAssembly build is experimental; please provide feedback.
See the Releases page to download older versions of PDFium.
NuGet Packages
The following NuGet packages are available:
OS | PDFium | PDFium V8 |
---|---|---|
All (meta package) | bblanchon.PDFium | bblanchon.PDFiumV8 |
Android | bblanchon.PDFium.Android | bblanchon.PDFiumV8.Android |
iOS | bblanchon.PDFium.iOS | bblanchon.PDFiumV8.iOS |
Linux | bblanchon.PDFium.Linux | bblanchon.PDFiumV8.Linux |
macOS | bblanchon.PDFium.macOS | bblanchon.PDFiumV8.macOS |
Windows | bblanchon.PDFium.Win32 | bblanchon.PDFiumV8.Win32 |
WebAssembly1 | bblanchon.PDFium.WebAssembly | not supported |
1: WebAssembly build is experimental; please provide feedback.
HELP WANTED!
I can provide packages for your favorite package manager, but I need help from someone who knows the format. Contact me via GitHub issues if you want to help.
Documentation
PDFium API documentation
Please find the documentation of the PDFium API on developers.foxit.com.
How to use PDFium in a CMake project
-
Unzip the downloaded package in a folder (e.g.,
C:\Libraries\pdfium
) -
Set the environment variable
PDFium_DIR
to 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.dll
can be found by your executable (copy it on the same folder, or put it on thePATH
).
Related projects
The following projects use (or recommend using) our PDFium builds:
Name | Language | Description |
---|---|---|
dart_pdf | Dart | PDF creation module for dart/flutter |
DtronixPdf | C# | PDF viewer and editor toolset |
go-pdfium | Go | Go wrapper around PDFium with helper functions for various methods like image rendering and text extraction |
libvips | C | A performant image processing library |
PDFium RS | Rust | Rust wrapper around PDFium |
pdfium-vfp | VFP | PDF Viewer component for Visual FoxPro |
PDFiumCore | C# | .NET Standard P/Invoke bindings for PDFium |
PdfiumLib | Pascal | An interface to libpdfium for Delphi |
PdfLibCore | C# | A fast PDF editing and reading library for modern .NET Core applications |
PDFtoImage | C# | .NET library to render PDF content into images |
PDFtoZPL | C# | A .NET library to convert PDF files (and bitmaps) into Zebra Programming Language code |
PDFx | Dart | Flutter Render & show PDF documents on Web, MacOs 10.11+, Android 5.0+, iOS and Windows |
PyPDFium2 | Python | Python bindings to PDFium |
Spacedrive | Rust/TS | Cross-platform file manager, powered by a virtual distributed filesystem |
wxPDFView | C++ | wxWidgets components to display PDF content |
Did we miss a project? Please open a PR!
Contributors
Username | Contributions | |
---|---|---|
@bblanchon |
Main contributor | |
@ChristofferGreen |
Linux ARM build | |
@jerbob92 |
Musl build | |
WebAssembly build | ||
@mara004 |
Conda packages | |
Frequent help with many aspects of the project | ||
@sungaila |
NuGet packages | |
@TcT2k |
macOS build | |
V8 build |
Top Related Projects
PDF Reader in JavaScript
qpdf: A content-preserving PDF document transformer
A Python library for reading and writing PDF, powered by QPDF
PyMuPDF is a high performance Python library for data extraction, analysis, conversion & manipulation of PDF (and other) documents.
iText for Java represents the next level of SDKs for developers that want to take advantage of the benefits PDF can bring. Equipped with a better document engine, high and low-level programming capabilities and the ability to create, edit and enhance PDF documents, iText can be a boon to nearly every workflow.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot