Code samples

Categories

86 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 raster image

EMF is the Windows Meta 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. See our blogpost on EMF to PDF as a vector image. In rare and unforseeable occasions, these images may not be converted correctly. In that case it is possible to include the images in PDF as raster images. This article explains how to do that.

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.

TIFF to PDF C#

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

[Visual Studio 2010 Sample Project.zip]: /support/articles/143/Visual Studio 2010 Sample Project.zip "Visual Studio 2010 Sample Project.zip" 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