About PDF4NET

PDF enable your .NET applications.

PDF4NET is a .NET library for creating, editing and filling PDF documents on the fly from any .NET application. The library provides a simple API that allows to create complex PDF documents, or to edit existing PDF files with a few lines of code. Its core functionality can be divided into 3 main areas: PDF creation, PDF editing and PDF forms management. Using PDF4NET, a developer can create PDF files from any .NET compatible language, like C# or VB.NET. The drawing architecture is similar to GDI+, so if you know how to draw on the screen then you know how to create a PDF file. The PDF creation features include both basic and advanced features, allowing the developer to create PDF files of any complexity. The PDF4NET library can be used for creating reports of any types, invoices, business cards or any other types of PDF documents or it can be integrated in PDF processing workflows.

PDF4NET provides support for the following features when creating PDF files:

  • Support for document wide properties like: document information and XMP metadata with custom properties, viewer preferences.
  • Digitally sign PDF documents using X.509 certificates.
  • Create PDF portfolios
  • Read/write PDF files in XDP packages
  • Unlimited number of pages per document, each page with its size and orientation.
  • Create PDF/A-1b compliant PDF files.
  • Headers, footers, page templates and layers.
  • Native support for 1D (Codabar, Code 11, Code 128 A/B/C, Code 25, Code 25 Interleaved, Code 39, Code 93, COOP 25, EAN-13, EAN-8, IATA 25, ISBN, ISMN, ISSN, JAN-13, Matrix 25, MSI/Plessey, Planet, Postnet, RM4SCC, SCC-14, SSCC-18, UPC-A, UPC-E, Singapore Post, Royal Dutch TPG Post, PZN, Deutsche Post Identcode, Deutsche Post Leitcode, UCC/EAN128, USPS FIM, USPS Horizontal Bars, USPS Package Identification Code, FedEx Ground 96, Pharmacode, Code 32) and 2D (Codablock F, Code 16K, DataMatrix, MicroPDF417, PDF417) barcodes.
  • Automatic page numbering with support for roman and Arabic numerals.
  • Grid based layout when placing content on page, in this way drawing on a PDF page is much like drawing on the screen. The library also allows creating user defined units and coordinate systems.
  • Support for basic drawing primitives (lines, poly lines, arcs, pies, rectangles and rounded rectangles, ellipses, Bezier curves, paths, form XObjects). All primitives can be stroked or filled, and developer has full control over lines styles. Clipping regions are also supported by PDF4NET library. The library includes full support for transparency and blend modes. All drawing primitives can be filled with solid, hatched and gradient brushes.
  • Function-based, axial and radial shadings.
  • DeviceRGB, DeviceCMYK, DeviceGray, Indexed, CalGray, CalRGB, Lab, ICC, Separation and DeviceN colorspaces.
  • PANTONE colors.
  • Support for images, including jpeg, gif, bmp, png, emf; images can be placed anywhere on the page, scaled and rotated; Embedded images are cached, so when the same image is used multiple time in the PDF file, it is embedded only once. Images can be loaded from files, streams or System.Drawing.Bitmap. Transparent images are supported by default, support for color key masking, image masking and alpha channel transparency being also included. Windows Enhanced Metafiles are converted to PDF vector graphics.
  • CCITT G4 compression for B/W images. Tiff2PDF applications will benefit most of this feature.
  • Support for various text layouts using single text lines or text boxes with automatic word wrapping, text alignment (left, center, right or justified on horizontal, or top, middle bottom for vertical) and rotation;
  • Support for HTML formatting tags when drawing text.
  • Support for base 14 fonts, Type1 fonts, Unicode TrueType fonts, System.Drawing.Font and CJK fonts from Adobe Asian Language pack. Both Type1 and TrueType fonts can be embedded in the PDF document, and for TrueType fonts the library performs font sub setting automatically to reduce the size of the embedded font. The fonts are cached, so only one instance of the font is embedded in the final PDF file.
  • Support for PDF hyperlinks and document bookmarks. The target of a hyperlink can be a page in the same document, an external PDF file, an external non PDF file or a URL on the web.
  • PDF Actions are supported at document, page and bookmark level. Control how the PDF document is opened or add custom JavaScript code to your PDF document with a few lines of code.
  • Several types of annotations are supported, including 3D, text annotations, rubber stamp annotations and file attachment annotations. Annotations can be flattened to be included in page content.
  • Support for PDF security specification. Documents can be encrypted and password protected, both with user and owner passwords. The library supports AES and RC4 with 40bit, 128bit and 256bit (AES only) encryption keys. Also, operations on a document can be restricted using access rights (allow print, allow assemble, allow content extraction, etc).
  • PDF files can be saved to file or stream, including HTTP output streams.
  • Save documents page by page or page fragment by page fragment.
  • Partial document load and incremental document update, only the changed objects are saved.
  • The content of PDF files is compressed to reduce file size and download times when the library is used from a web application.

PDF editing capabilities of PDF4NET allow a developer to perform a wide range of operations on existing PDF files. All PDF editing capabilities are available also on encrypted PDF files.

  • PDF files merge – multiple PDF files can be merged together with a single line of code and the resulted PDF file can be saved to disk or to a stream. Also, the final PDF file can be encrypted.
  • PDF files split – PDF files can be split to single pages in a single step.
  • Apply security to existing PDF files – existing PDF files can be encrypted and protected by passwords. Both RC4 and AES encryption algorithms are supported.
  • Page extraction – pages from external PDF files can be extracted and added to new documents, thus allowing mixing existing PDF files into a single new one. When a page is extracted, also its annotations, links and form fields are extracted.
  • Content extraction – the content of a page or a layer can be extracted and placed on a new page. Multiple pages content can be placed on a single new page (page imposition) to reduce the number of pages in the final PDF document. Content can also be extracted as a sequence of graphic operators for custom page content processing.
  • Image extraction – images from a page can be extracted as Bitmap objects.
  • Extract and search text – extract and/or search text in PDF files.

PDF4NET library can create and fill PDF forms (AcroForms) and it can read and fill XFA forms. The following features are supported:

Create and modify PDF forms (Acroforms only)

  • Read and fill PDF forms (Acroforms)
  • Support for pushbuttons, single and multi lines text fields, checkboxes, radio buttons, comboboxes and listboxes (Acroforms)
  • Read and fill static XFA forms (Adobe Designer 7 static forms)
  • Support for pushbuttons, single and multi lines text fields, numeric fields, datetime fields, checkboxes, radio buttons, choice fields, image fields and barcode fields (XFA forms)
  • Support for encrypted forms
  • Form fields flattening, all fields or field by field.
  • Import/Export of form data in FDF, XFDF and XML 

The library includes a MSDN style help file. PDF4NET library has been developed entirely in C#, taking full advantage of .NET Framework. It supports both standard .NET Framework and Compact .NET Framework. The evaluation version is includes all the features but prints an evaluation message on document’s pages. The library is licensed per developer and can be distributed royalty free.