XFINIUM.PDF as a Portable Class Library

XFINIUM.PDF 4.0 has been released a few days ago and it brings support for a very requested feature: support for Portable Class Libraries. The XFINIUM.PDF product is now available also as a  Portable Class Library in the form of Xfinium.Pdf.Pcl.dll assembly. Continue reading “XFINIUM.PDF as a Portable Class Library”

Create and fill PDF forms in .NET

XFINIUM.PDF library can both create new PDF forms and fill existing PDF forms.
Each type of form fields supported in the PDF specification is represented by the corresponding class:

  • PdfTextBoxField – textbox fields
  • PdfCheckBoxField – checkboxes
  • PdfRadioButtonField – sets of radiobuttons
  • PdfComboboxField – comboboxes
  • PdfListboxField – listboxes
  • PdfPushbuttonField – push buttons
  • PdfSignatureField – signature fields

Continue reading “Create and fill PDF forms in .NET”

Encrypt and decrypt PDF documents in .NET

XFINIUM.PDF library can decrypt and encrypt PDF documents using RC4 and AES encryption, with 40 bit and 128 bit keys for RC4 and 128 bit and 256 bit keys for AES, including the latest PDF 2.0 draft. The library can create, load and save encrypted PDF files.

Continue reading “Encrypt and decrypt PDF documents in .NET”

Display alternate images for view and print in a PDF document

A question on StackOverflow.com asked if it is possible to have 2 alternate versions of an image in a PDF file, one for display and other for print.
Several solutions were given: optional contentform fields or alternate images. In the article below we’ll show how these solutions can be implemented using XFINIUM.PDF library and how they compare to each other.
Continue reading “Display alternate images for view and print in a PDF document”

Create and extract PDF optional content in PDF documents in .NET

Today we released XFINUM.PDF 3.4 which brings support for pdf optional content extraction. With this new version we include full support for manipulating optional content in PDF files, whether it is optional content creation or extraction. Continue reading “Create and extract PDF optional content in PDF documents in .NET”

How to create a simple PDF document in .NET

When we first designed the XFINIUM.PDF library for .NET 2 years ago one of the design targets was an easy learning curve. Although it was released first in a controlled corporate environment we still had to make it easy to use.

We used simple and clear abstractions that relate to real world and also to PDF specification: PdfFixedDocument class represents a PDF document which has a fixed layout by its nature, PdfPage class represents a page in a PDF document, the page drawing surface is represented by a PdfGraphics object. The pen is used to stroke a path outline while the brush is used to fill the path interior. An annotation is represented by a specific instance of PdfAnnotation class, a form field by PdfField class and so on. We tried to match the objects in PDF specification with classes in our object model so if you are looking for more advanced PDF features you can easily find them in our API. For example optional content objects are represented by PdfOptionalContentGroup class in our API.

Creating a PDF document with XFINIUM.PDF is a simple task, an empty PDF document requires only 3 lines of code: create the document, create one page and save the document.

Adding text content to the document above requires 3 more lines of code: font creation for drawing the text, brush creation for setting the text color and drawing the actual text on page graphics.

Our object model follows the PDF specification quite closely. This lets you build complex abstractions, such as flow documents, on top of it without problems.