Giter VIP home page Giter VIP logo

pdfiumviewer's Introduction

PdfiumViewer

Apache 2.0 License.

Download from NuGet.

Introduction

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.

Compatibility

The PdfiumViewer library has been tested with Windows XP and Windows 8, and is fully compatible with both. However, do not that the standard DLL's won't work on Window XP. To build for Windows XP, you need:

  • The DLL's from the directory Libraries\Pdfium\Without V8;
  • Also, you need to distribute a recent version of dbghelp.dll. These are also located in the Libraries\Pdfium\Without V8 directory. Note that these are not part of the standard distribution and won't be loaded automatically.

Using the library

To use the library, you must first add a reference to the NuGet package.

After you've added this reference, two files will be added to your project:

  • x86\pdfium.dll is the 32-bit version of the Pdfium library;

  • x64\pdfium.dll is the 64-bit version of the Pdfium library.

You have two options. If your application is 32-bit only or 64-bit only, you can remove the DLL that won't be used. You can leave this file in the x86 or x64 directory, or move it to the root of your project. PdfiumViewer will find the DLL in both cases.

When building your project, the pdfium.dll library(s) must be placed next to your application, either in the root or the x86 or x64 sub directory. The easiest way to accomplish this is by changing the properties of that file, changing the Copy to Output Directory setting to Copy always.

Note that in the directory Libraries\Pdfium\Without V8, there are versions of the Pdfium DLL's without V8 support. These are a lot smaller and work on Windows XP. See Compatibility above for instructions on how to use these.

The versions in this project are snapshots of the PDFium library which may be out of date. Up to date versions of the PDFium library are automatically generated using the PdfiumBuild project. Have a look there for where to find daily builds of the PDFium library.

Note on the PdfViewer control

The PdfiumViewer library primarily consists out of three components:

  • The PdfViewer control. This control provides a host for the PdfRenderer 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.

Building PDFium

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. A compiled version of the PDFium library is included in the NuGet package and precompiled libraries can be found at https://github.com/pvginkel/PdfiumViewer/tree/master/Libraries/Pdfium.

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

Bugs should be reported through github at http://github.com/pvginkel/PdfiumViewer/issues.

License

PdfiumViewer is licensed under the Apache 2.0 license. See the license details for how PDFium is licensed.

pdfiumviewer's People

Contributors

pvginkel avatar mafshin avatar iemiya avatar jasonhendrix avatar stefanoraggi avatar peter0302 avatar sirmossi avatar hrhrprasath avatar jmh3142 avatar shameleo avatar pablot avatar dmester avatar

Watchers

weimingtom avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.