Some test text!

menu

Platform

Filter by text

AddImage

Insert an Image into a PDF

This sample illustrates how to embed various raster image formats (e.g. TIFF, JPEG, JPEG2000, JBIG2, GIF, PNG, BMP, etc.) in a PDF document.

Annotation

Add or Edit PDF Annotations

Shows how to add or edit PDF annotations (e.g. hyperlink, intra-document link, stamp, rubber stamp, file attachment, sound, text, free-text, line, circle, square, polygon, polyline, highlight, squiggly, caret, and ink).

Bookmarks

Read, Add, Edit PDF Outlines and Bookmarks

The sample code illustrates how to read and edit existing outline items and create new bookmarks using the high-level API.

Color separation

Shows how to get each color's information. You can also show/hide specific colors.

ContentReplacer

Search & Replace PDF Text or Images

This sample shows how to use pdftron.PDF.ContentReplacer to search and replace text strings and images in existing PDF (e.g. business cards and other PDF templates). Unlike PDF forms, the ContentReplacer works on actual PDF content and is not limited to static rectangular annotation regions.

Convert

PDF Converter (SVG, XPS, TIFF, JPG, RTF, TXT, More)

This sample shows how to use PDFNet Convert Add-on (i.e. 'pdftron.PDF.Convert' namespace) for direct, high-quality conversion between PDF, XPS, EMF, SVG, TIFF, PNG, JPEG, and other image formats. The sample also shows how to convert any printable document (e.g. Word, HTML, RTF, MS Office, DXF, DWG, etc) to PDF or XPS using a universal document converter.

Custom annotations

Shows how to create and add custom annotations by extending the existing annotation classes.

Customizing form fields

Shows how to change color and opacity of form fields.

Customizing UI

Shows how to customize the UI using WebViewer APIs. Includes modifying header, enabling/disabling features and hiding/showing individual elements.

Diff Documents

Shows how to render three synchronized panels where the middle panel shows pixel differences between the two documents.

DigitalSignatures

Digitally Sign and Verify PDF Files

Demonstrates the basic usage of high-level digital signature API to digitally sign and/or certify PDF documents.

DigitalSignatures

Digitally Sign and Verify PDF Files

Demonstrates the basic usage of high-level digital signature API to digitally sign and/or certify PDF documents.

ElementBuilder

Build, Write, Embed Elements in PDF Pages

Illustrates how to use PDFNet page writing API, how to embed fonts and images and how to copy graphical elements from one page to another.

ElementEdit

PDF Editor (Programmatic)

The sample code shows how to edit the page display list and how to modify graphics state attributes on existing Elements. In particular the sample program strips all images from the page and changes text color to blue.

ElementReader

Read Elements Across All PDF Pages

Illustrates how to traverse page display list using ElementReader.

ElementReaderAdv

PDF Data Extraction (Images, Text, Paths)

The sample shows how to use some of more advanced PDFNet features. The sample code illustrates how to extract text, paths, and images. The sample also shows how to do color conversion, image normalization, and how to process changes in the graphics state.

Encryption

Encrypt and Decrypt PDF Files

Illustrates encryption support in PDFNet. The sample code reads an encrypted document and sets a new SecurityHandler.

FDF

PDF Form Fill and Form Data Extraction

PDFNet includes full support for FDF (Forms Data Format) and capability to merge/extract forms data (FDF) with/from PDF. The sample illustrates basic FDF merge/extract functionality available in PDFNet.

Flipbook

Demonstrates how to extract canvas of each page. The sample uses turn.js to render them.

HTML2PDF

HTML to PDF Converter

Sample code to use PDFTron SDK for directly converting HTML pages to PDF by using 'pdftron.PDF.HTML2PDF'. The HTML2PDF converter supports HTML conversion from a string or URL and offers many options to control page size and formatting.

ImageExtract

PDF Image Extraction

This sample illustrates couple of approaches to PDF image extraction.

Imposition

PDF Imposition

The sample illustrates how multiple pages can be combined/imposed using PDFNet. Page imposition can be used to arrange/order pages prior to printing or to assemble a 'master' page from several 'source' pages. Using PDFNet API it is possible to write applications that can re-order the pages such that they will display in the correct order when the hard copy pages are compiled and folded correctly.

InteractiveForms

PDF Interactive Forms (AcroForms)

The sample illustrates some basic PDFNet capabilities related to interactive forms (also known as AcroForms).

Internationalization

Shows how to switch language.

JBIGTest

PDF Image JBIG2 Compression

The sample project illustrates how to recompress bitonal (black and white) images in existing PDF documents using JBIG2 compression. The sample is intended to show how to specify hint information for image encoder and is not meant to be a generic PDF optimization tool. PDFNet supports both lossless and lossy JBIG2 compression. To give you a feeling of compression rates possible with PDFNet we re-compressed a document containing 17 scanned pages. The original input document is ~1.4MB and is using standard CCITT Fax compression. Loss-less JBIG2 compression shrunk down the file to 641KB. Lossy JBIG2 compression shrunk down the file to 176KB.

Layer separation

Shows how to get each layer's information. You can also show/hide specific layers.

LogicalStructure

PDF Logical Structure Reader

This sample explores the structure and content of a tagged PDF document and dumps the structure information to the console window.

Measurement Annotations

Shows how to create annotations that measure distance, perimeter and area.

Multithreaded

Multithreaded PDF Reading

Illustrates how to use PDFDoc locking mechanisms to access the document concurrently. PDFDoc uses a recursive shared lock model. Multiple threads can read the document at the same time, but only one thread can write to the document. A given thread can acquire as many locks of the same type as it wants, in a recursive fashion.

OfficeToPDF

Convert MS Office files To PDF

This sample illustrates how to convert MS Office files (Word, Excel, PowerPoint) to PDF.

Optimizer

Compress & Optimize PDF Files

The sample shows how to use 'pdftron.PDF.Optimizer' to reduce PDF file size by removing redundant information and compressing data streams using the latest in image compression technology. 'pdftron.PDF.Optimizer' is an optional Add-On to PDFNet Core SDK.

Page operations

Shows how to rotate/crop/add/delete page, change page order, insert blank pages and merge multiple documents.

PageLabels

PDF Page Labels

This example illustrates how to work with PDF page labels. PDF page labels can be used to describe a page. This is used to allow for non-sequential page numbering or the addition of arbitrary labels for a page (such as the inclusion of Roman numerals at the beginning of a book).

Pattern

PDF Patterns and Shadings

This example illustrates how to create various PDF patterns and shadings.

PDF/A

Convert PDF to PDF/A

This sample illustrates how to validate existing PDF documents for PDF/A compliance as well as to convert generic PDF documents to PDF/A format.

PDFDC

PDF Device Context

This sample shows how to create and use PDFDC (i.e. a PDF Device Context). Windows developers can use standard GDI or GDI+ API-s to write on PDFDC and to generate PDF documents based on their existing drawing functions. PDFDC can also be used to implement file conversion from any printable file format to PDF.

PDFDocMemory

Read & Write a PDF File From/To Memory Buffer

The sample illustrates how to read/write a PDF document from/to memory buffer. This is useful for applications that work with dynamic PDFdocuments that don't need to be saved/read from a disk.

PDFDraw

Convert PDF to Image (JPG, PNG, BMP, TIFF)

This sample illustrates how to use the built-in rasterizer in order to render PDF images on the fly and how to save resulting images in PNG and JPEG format.

PDFLayers

PDF Layers (OCG)

This sample demonstrates how to create PDF layers (also known as Optional Content Groups - OCGs). The sample also shows how to extract and render PDF layers.

PDFPackage

PDF Packages (Portfolios)

This sample illustrates how to create, extract, and manipulate PDF Packages (also known as PDF Portfolios).

PDFPage

Merge, Copy, Delete, and Rearrange PDF Pages

The sample illustrates how to copy pages from one document to another, how to delete, and rearrange pages and how to use ImportPages() method for very efficient copy and merge operations.

PDFPrint

Print PDF a File

This sample illustrates how to print a PDF document using the currently selected default printer. It is possible to use PDFNet printing functionality in both client and server applications without dependence on any third party components.

PDFRedact

PDF Redaction

The sample shows how to use 'pdftron.PDF.Redactor' to remove potentially sensitive content within PDF documents. PDFTron Redactor makes sure that if a portion of an image, text, or vector graphics is contained in a redaction region, that portion is destroyed and is not simply hidden with clipping or image masks.

PDFView

PDF Viewer Control (Advanced)

This sample shows how to customize the viewer control by implementing a number of custom tools (such as freehand tool, link creation tool, rectangular zoom etc) and custom GUI elements (such as custom navigation and printing). For a more introductory example of how to use PDFViewCtrl, please see PDFViewSimple sample project.

PDFViewSimple

PDF Viewer Control (Simple)

This sample shows how to use PDF viewer control in a basic project. The sample uses a number of built-in features from PDFViewCtrl to implement document navigation, text highlighting, markup, and editing. If you are looking for a sample showing how to further customize the viewer (e.g. by implementing custom tools or custom GUI elements), please take a look at PDFView sample project.

PDFViewWPF

PDFViewWPF Class

This sample shows how to use PDFViewWPF class.

PDFViewWPFSimple

PDFViewWPF Class MainWindow.xaml

This sample shows how to use PDFViewWPF class.

Preloading

Shows how to preload WebViewer and documents to improve user experience.

Realtime collaboration

An example setup with Firebase backend. For more details, refer to realtime collaboration guide.

Rect

Change a PDF Page's MediaBox

Shows how to change Page's MediaBox using Rect class.

Redaction

Shows how to redact and permanently remove text, images or graphics from a document.

SDF

Cos/SDF Low-level API to Edit PDF Files

The sample illustrates how to use basic Cos/SDF API to edit an existing document.

Stamper

Stamp a PDF File

The sample shows how to use 'pdftron.PDF.Stamper' utility class to stamp PDF pages with text, images, or with other PDF pages. ElementBuilder and ElementWriter should be used for more complex PDF stamping operations.

Text position

Shows how to extract text positions from a document. The sample higlights the positions with different colors.

TextExtract

Read a PDF File (Parse & Extract Text)

The sample illustrates the basic text extraction capabilities of PDFNet.

TextSearch

Search PDF Files for Text

This sample shows how to use TextSearch to search text on PDF pages using regular expressions. TextSearch utility class builds on functionality available in TextExtractor to simplify most common search operations.

U3D

Embed 3D Models (U3D) in PDF Files

This example illustrates how to embed U3D content (3 dimensional models) in PDF.

UnicodeWrite

Create Unicode Text or Embed Composite Fonts in PDF Files

An example illustrating how to create Unicode text and how to embed composite fonts.

Users and permissions

Describes types of permissions and switching between users. You can also show/hide annotations of specific users.

ViewerCustomSave

This sample demonstrates how to customize document save/download. In the example annotations are flattened before saving.

ViewerDisplayPoints

This sample demonstrates how to use PDFNetJS to select elements in a PDF document. Click on an element in the PDF and it will show the element's bounding box and an outline if it is a PDF path.

ViewerEdit

This sample illustrates how PDFNetJS can be used to perform complex editing on PDF documents as they are displayed in the WebViewer. Open a PDF of your choice and press the refresh button at the top right to change all text to blue and all images to red.

ViewerFormBuilder

This sample demonstrates how to add form fields to a PDF. Fields are first added as annotations and then converted to interactive form fields.

ViewerPDFDiffTest

This sample illustrates how PDFNetJS can be used to compare two PDF documents and show their difference in WebViewer.

ViewerPreprocess

This sample illustrates how PDFNetJS can be used to preprocess a document before displaying it with WebViewer.

ViewerRedact

This sample illustrates how PDFNetJS can be used to redact elements on PDF documents as they are displayed in the WebViewer. Open a PDF of your choice and drag-select regions on the PDF document to redact.

ViewerSnapToNearestTest

This sample illustrates how to use the snap API for calculating the nearest snap point.

Viewing a Document

Shows how to call WebViewer constructor to instantiate and load document. You can load local/remote files of your choice.

Viewing a Document with Custom Server (XOD)

Shows how to load XOD files, which are generated from a custom server.

Viewing a Document with Legacy UI

Shows how to call WebViewer constructor to fall back to legacy ui. You can load local/remote files of your choice.

Viewing a Document with WebViewer Server

Shows how to call WebViewer constructor to instantiate and load document using WebViewer with WebViewer Server. You can upload local files or load files that are publicly accessible.

WebViewer

Integrate WebViewer into any HTML5 or Web Application

These samples shows how to integrate PDFNet WebViewer into any HTML5, Silverlight, or Flash web application. The sample is using 'pdftron.PDF.Convert.ToXod()' to convert/stream PDF, XPS, MS Office, RTF, HTML and other document formats to WebViewer 'pdftron.PDF.Convert.ToXod()' is an optional Add-On to the Core SDK and is part of PDFNet WebViewer Publishing Platform.

Xaml2Pdf

XAML to PDF Converter

This example shows how to use PDFNet Convert Add-on (i.e. 'pdftron.PDF.Convert' namespace) to dynamically generate PDF or XPS directly from a FlowDocument, XAML, or WPF. Converting XAML/FlowDocument to PDF is not only easy, but is also very flexible in terms of how content is paginated and flowed into a fixed document such as PDF or XPS.

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.