This is an updated fork of the archived pvginkel/PdfiumViewer project. It is available as PdfiumViewer.Updated
via nuget and includes the following changes/ updates:
- Merged all relevant open pull requests of the original repo
- Updated to newer PDFium binaries from https://github.com/bblanchon/pdfium-binaries
- Added .NET Core 3.1 and .NET 6 as new targets
PdfiumViewer is a PDF viewer based on the PDFium project.
PdfiumViewer provides a number of components to work with PDF files:
-
PdfDocument is the base class used to render PDF documents;
-
PdfRenderer is a WinForms control that can render a PdfDocument;
-
PdfiumViewer is a WinForms control that hosts a PdfRenderer control and adds a toolbar to save the PDF file or print it.
The PdfiumViewer library has been tested with Windows XP and Windows 8, and is fully compatible with both. However, the native PDFium libraries with V8 support do not support Windows XP. See below for instructions on how to reference the native libraries.
The PdfiumViewer control requires native PDFium libraries. These are not included in the PdfiumViewer NuGet package. See the Installation instructions Wiki page for more information on how to add these.
The PdfiumViewer library primarily consists out of three components:
- The
PdfViewer
control. This control provides a host for thePdfRenderer
control and has a default toolbar with limited functionality; - The
PdfRenderer
control. This control implements the raw PDF renderer. This control displays a PDF document, provides zooming and scrolling functionality and exposes methods to perform more advanced actions; - The
PdfDocument
class provides access to the PDF document and wraps the Pdfium library.
The PdfViewer
control should only be used when you have a very simple use
case and where the buttons available on the toolbar provide enough functionality
for you. This toolbar will not be extended with new buttons or with functionality
to hide buttons. The reason for this is that the PdfViewer
control is just
meant to get you started. If you need more advanced functionality, you should
create your own control with your own toolbar, e.g. by starting out with
the PdfViewer
control. Also, because people currently are already using the
PdfViewer
control, adding more functionality to this toolbar would be
a breaking change. See issue #41
for more information.
Instructions to build the PDFium library can be found on the Building PDFium wiki page. However, if you are just looking to use the PdfiumViewer component or looking for a compiled version of PDFium, these steps are not required. NuGet packages with precompiled PDFium libraries are made available for usage with PdfiumViewer. See the chapter on Using the library for more information.
Alternatively, the PdfiumBuild project
is provided to automate building PDFium. This project contains scripts to
build PdfiumViewer specific versions of the PDFium library. This project
is configured on a build server to compile PDFium daily. Please refer to
the PdfiumBuild project page
for the location of the output of the build server. The PdfiumViewer specific
libraries are located in the PdfiumViewer-...
target directories.
Bugs should be reported through github at http://github.com/pvginkel/PdfiumViewer/issues.
PdfiumViewer is licensed under the Apache 2.0 license. See the license details for how PDFium is licensed.