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”

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.

PdfFixedDocument document = new PdfFixedDocument();
PdfPage page = document.Pages.Add();
document.Save("empty.pdf");

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.

PdfFixedDocument document = new PdfFixedDocument();
PdfPage page = document.Pages.Add();
// Create a standard font with Helvetica face and 24 point size
PdfStandardFont helvetica = new PdfStandardFont(PdfStandardFontFace.Helvetica, 24);
// Create a solid RGB red brush.
PdfBrush brush = new PdfBrush(PdfRgbColor.Red);
// Draw the text on the page.
page.Graphics.DrawString("Hello World", helvetica, brush, 100, 100);
document.Save("helloworld.pdf");

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.

XFINIUM.PDF blog has been launched

We launched today the blog for our XFINIUM.PDF line of products. The blog will include in-depth technical information about our products, technical solutions for specific problems, samples and other content that we’ll consider to be useful.

XFINIUM.PDF library is a .NET/Mono library for PDF development. We support a wide set of features, ranging from simple PDF creation to form filling, content redaction or complex color conversions. The simple object model follows the PDF specification so you can have complete control over the generated PDF files. Code written for XFINIUM.PDF can be compiled on all supported platforms without changes.
XFINIUM.PDF has been developed entirely in C# and it is 100% managed code. It is licensed per developer with royalty free distribution so you can freely distribute your application without paying other fees.

Main features are:

  • Create PDF & PDF/A files and PDF portfolios
  • Create, fill, flatten and save PDF forms
  • Merge and split PDF files
  • Draw multiple pages on a new page
  • Stamp and watermark PDF files
  • Extract text and images from PDF files
  • PDF annotations and actions
  • Page content transformations
  • AES/RC4 40/128/256 bit encryption
  • Text and image redaction
  • Built-in vector 1D & 2D barcode engine
  • Complex vector graphics

You can read here the complete list of features.

We support all .NET, Mono and Xamarin platforms:  Windows Forms, ASP.NET, Mono, WPF, Silverlight, WinRT, Windows Phone, Xamarin iOS, Xamarin Android.