Learn PDFjet for .NET by example.

51 ready-to-run examples, from a first page of text to tables thousands of pages long. Each one shows its complete source code and the PDF it creates. All of them come with the evaluation download, ready to build and run.


Example_01

Drawing English, Greek and Bulgarian text in TextBlock components with borders, rounded corners and highlighted keywords, in a PDF/UA document.

Example_02

Drawing Japanese, Korean, Simplified Chinese and Traditional Chinese text with embedded IBM Plex Sans fonts.

Example_03

Using the TextFrame and Paragraph components: paragraphs that mix fonts and colors, numbered paragraphs and highlighted keywords.

Example_04

Drawing a "Happy New Year" greeting in Chinese, Japanese and Korean with CJK fonts that are not embedded in the PDF, each labeled with its font.

Example_05

Text kerning, rotated text, and drawing circles, arcs and ellipses.

Example_06

Attaching an image and a source file to a page, and adding a note, a link and polygon, square and circle annotations, each next to a label.

Example_07

Adding a "DRAFT" watermark to every page of a two-page PDF/A-3B document.

Example_08

Using the Table component to draw a CSV file on several pages, with an image and a barcode in its cells and a "Page X of N" footer.

Example_09

Using the Chart component to draw a scatter chart with a trend line, and a table that lists the chart points.

Example_10

Using the TextColumn component to draw centered and justified paragraphs.

Example_11

Drawing labeled Code 128, Code 39, UPC-A and EAN-13 linear barcodes, and barcodes drawn from top to bottom and from bottom to top.

Example_12

Drawing a PDF417 barcode that holds a whole source file, with an explanation and a caption, in a PDF/UA document.

Example_13

Drawing a table with two header rows, merged header cells and cell background colors.

Example_14

Drawing Data Matrix barcodes: a web address, text in UTF-8, a rectangular symbol and a larger symbol.

Example_15

Using the CompositeTextLine together with the Table class to draw the H2O formula in the cells of a PDF/UA table.

Example_16

Using the TextBlock component with a fixed height, a background color, a border, highlighted keywords and transparency, in a PDF/UA document.

Example_17

Test case for PNG images: palette, grayscale and color images from PngSuite with different bit depths, filter types, compression levels and transparency.

Example_18

Writing a "Page X of N" footer on every page of a short document, after all of its pages are drawn.

Example_19

Using the TextBlock component to draw a description next to each of two maps, with each row starting below the taller of the image and the text.

Example_20

Drawing a letterhead with a logo read from a PDF file, a maple leaf drawn as a path with curves, and a QR code.

Example_21

Drawing the same address as a QR code with each of the four error correction levels, labeled with how much can be restored and how much data fits.

Example_22

Linking a contents page to chapters and back with "Destinations" and "Go To" actions on text, a box and an image, in a PDF/UA document.

Example_23

Example showing the location, ascent, descent and end point of text drawn with the TextBlock component.

Example_24

Embedding JPEG, PNG and BMP images.

Example_25

Drawing a donut chart from the values of its slices.

Example_26

Using the CheckBox and RadioButton components to draw a survey.

Example_27

Drawing Thai, Hebrew, Arabic and Persian text, including right to left text blocks, in a PDF/UA document.

Example_28

Reading fonts from .otf and .ttf files and from the .stream files of the same fonts: any OpenType or TrueType file on the computer is a font for PDFjet.

Example_29

Drawing a table whose cells hold text columns of English and Greek paragraphs.

Example_30

Encrypting a PDF with user and owner passwords and permissions. The passwords are "hello" and "world".

Example_31

Drawing with transparency: opaque and half transparent rectangles, a fill at four levels of alpha, and strokes and fills that are transparent on their own.

Example_32

Drawing source code with highlighted keywords using the TextLine component.

Example_33

Using the SVGImage component to draw a map of Europe scaled to fit the page, and a set of icons, each labeled with its name.

Example_34

Adding points with URI Action to Table cells, in a PDF/A-1B document.

Example_35

Using the Stamp and Container components to draw rotated, scaled and nested content.

Example_36

Drawing two map pages first and their contents page last, and adding the pages to the PDF in reading order.

Example_37

Opening an existing PDF and writing semi-transparent text on every page.

Example_38

Example that showcases the flexibility of the Table class with cells of different sizes.

Example_39

Creating a chart with horizontal bars.

Example_40

Creating bar charts with grouped and with stacked vertical bars.

Example_41

Merging existing PDF documents into one, after a cover page drawn with PDFjet.

Example_42

Using the Form and Field classes to create forms.

Example_43

Using the BigTable class to draw a large CSV file on more than 2,500 pages.

Example_44

Using the AddCJKParagraph method of the TextColumn class to draw Chinese paragraphs.

Example_45

Using the Form and Field classes to draw a shipment request, with rows of fields and a value that continues on a second line.

Example_46

Using PDF layers (optional content groups) that can be shown or hidden: a relief map of Europe, lines of latitude and longitude that are not printed, and capital cities.

Example_47

Using the TextFrame class to flow text through three columns on every page, in a PDF/UA document.

Example_48

Adding nested and automatically numbered bookmarks to the outline of a guide to the PDF file structure, in a PDF/UA document.

Example_49

Drawing a menu with paragraphs that mix text styles and colors, raised dollar signs and a rotated label, in a PDF/UA document.

Example_50

Example showing how to open existing PDF form and fill it in.

Example_51

Splitting an existing PDF document into one PDF for each of its pages, and writing its pages in reverse order.

©2026 PDFjet Software.

What our clients are saying:

"I tried to use three other open source PDF libraries, but their source code is not well documented and so "object-oriented" it's proven nearly impossible to read and modify. In contrast I found the PDFjet source code very simple, clean, logical and easy to understand. The fact that it came with very liberal open source license is a huge bonus. The commercial version is very reasonably priced and there are NO ROYALTIES. I wish I had discovered this excellent product earlier."

Gary D. Amundson

Android Developer



On the Web:

"I took a look at what was on offer, open source, closed source and commercial. I went for a lib called PDFJet. This is a fairly mature Java pdf library that has been ported over to .Net. It's fairly cheap and whilst it lacks a lot of in depth examples, there are quite a few available on their website. The support is really good too - if you have a question, the guys are able to provide feedback very quickly. It is very well featured, but I am basically using it to generate tables from datatables. I have been using it in earnest for about a week now, so I will try and post some examples of how it can be used here. There are two ways of creating a table with PDFJet, you can use a delimited text file holding the data you need or you can build a table programatically. Doing it in the code is tricky ... however, I am very impressed with this library and the things it can do."

Raphael's Blog