Skip to content

Recipes

View as Markdown

One task per page: a short answer and a complete program you can paste and run. Every sample is compiled and run against the library on each build of this site. The guides cover each area in depth.

RecipeIn one line
Merge PDF filesCombine several PDFs into one with PdfDocument.Merge
Split a PDF into one file per pageOne document per page with Split
Extract pages from a PDFCopy chosen pages into a new file, in any order
Rotate PDF pagesTurn pages by a multiple of 90 degrees
Add page numbersDraw “Page 1 of 3” at the foot of every page
Add a watermarkA rotated, semi transparent word across every page
RecipeIn one line
Reduce PDF size for emailDownsample oversized images and store photographs as JPEG
Downsample images in a PDFBring every image down to the resolution it is shown at
Linearize a PDF for fast web viewShow the first page before the whole file has downloaded
Batch compress PDFs from the command lineA whole folder with pdfnetstack batch and a CSV report
Check two PDFs for equivalenceProve another tool’s output holds the same document
RecipeIn one line
Password protect a PDFAES-256 with user and owner passwords and permissions
Remove a password from a PDFOpen with the owner password and save unprotected
Fill and flatten a PDF formSet field values, then stamp them into the page
Flatten annotationsMake comments, highlights and stamps part of the page
Add a signature fieldAn empty box for a signer to sign in their viewer
Create a Factur-X invoiceA PDF/A-3 e-invoice with its XML and Factur-X metadata
RecipeIn one line
Convert an HTML invoice to PDFHTML and CSS to PDF with page numbers, no browser
Convert a TIFF to PDFEvery page of a multi-page TIFF on its own PDF page
Write Arabic text in a PDFRight to left text with joined letters, searchable
Extract all images from a PDFJPEGs as stored, other images as PNG
Make a scanned PDF searchableOCR with the PdfNetStack.Ocr add-on

Recipes marked 1.1 need the 1.1 packages or later.