Code samples


84 code samples found

Read and write meta data from PDF

This article shows a sample for reading and writing meta data from PDF using C#.

Create a text annotation in PDF with rich text

This sample shows how to create annotations in PDF that use a rich text for their appearance. This can be done with PDFKit or PDFControls. With 'rich text' we mean the rich text as is described in the PDF reference at page 680 under 'Rich Text Strings'.

Add a rubber stamp annotation with a custom icon

For some applications it is necessary to add a customized annotation to a PDF document. With PDFKit and PDFControls this is possible. The PDF standard includes a "rubber stamp annotation". It displays text or graphics intended to look as if they were stamped on the page with a rubber stamp. For this rubber stamp there are a few standard appearances, but it is also possible to change the appearance by applying an icon. This article shows how to create a customized rubber stamp annotation.

Replace field with image

This code sample opens a PDF with a textfield and replaces this textfield with an image. The image has the same width and its aspect ratio is preserved. The top-left corner of the image is placed at the top-left corner of the field.

EMF to PDF as vector image

EMF is the Windows Meta file file format for images. More information on this file format can be found here. One of the advantages of the Windows Meta File is, that it is vector based and therefor the images are scalable. With the PDFkit tool it is possible to convert these EMF images to PDF or to include them in a PDF while preserving the scalability.


This article shows you how to convert a multipage TIFF to PDF using PDFKit.NET

Merge PDF files in C# .NET

In the following code sample you can see how you can easily merge PDF files into one. It creates a new document and then adds a clone of the pages from each input document. Please take note that the input files will not be read until they are needed, so you can only close the input files until a copy has been made by writing the new document to the disk. This is done for efficiency: if you import a 1000-page document and only need the first page containing a certain keyword, then the rest of the pages will not be processed.

Split PDF pages in C# and VB.NET

The following code sample shows how to split PDF pages in C# and VB.NET

Digitally sign a PDF form in C# or VB.NET

Import a digital signature and sign a PDF.

Add bookmarks to PDF

This code sample shows how to create bookmarks in an existing PDF document.