👉 Try the demo: https://github.com/LM-Kit/lm-kit-net-samples/tree/main/console_net/document-intelligence/pdf-toolkit/pdf_to_multipage_tiff
PDF to Multi-page TIFF Archive for C# .NET Applications
🎯 Purpose of the Demo
An interactive console app that renders every selected page of a PDF and packs them into a single multi-page TIFF. Two modes: single file (prompt-driven) or whole folder (one TIFF per source). Built on PdfRenderer.SavePagesAsMultipageTiffAsync.
All rendering runs on-device.
👥 Industry Target Audience
- Records management: produce one raster file per document for long-term archival.
- Government / legal hold: TIFF is the canonical format for many retention systems.
- Fax pipelines: multi-page TIFF is the fax-friendly raster format.
- Healthcare / claims: archive case packets with deterministic file boundaries.
- Compliance: keep PII out of cloud conversion services.
🚀 Problem Solved
Multi-page TIFF remains the dominant "one file = one document" raster archive format in regulated industries. Producing it from PDFs usually requires a heavy desktop tool or a cloud conversion service. The demo collapses it into a single SDK call wrapped in a menu, with grayscale and zoom knobs for archive size control.
💻 Application Overview
Interactive menu (no command-line arguments) with two modes:
| Mode | What it does |
|---|---|
| File | Prompts for input PDF, output .tif, zoom, grayscale, and page range. |
| Folder | Prompts for a folder and output directory. Converts every PDF found, producing one .tif per source. |
| Quit | Exit. |
Both modes share the same render pipeline (PdfRenderer.SavePagesAsMultipageTiffAsync) and surface per-page progress on a single status line. Ctrl-C cancels cleanly.
✨ Key Features
PdfRenderer.SavePagesAsMultipageTiffAsync(...): streams pages into one multi-page TIFF.PdfRenderOptions.PageRange: 1-based syntax ("1-3,5,8-10").ImagePixelFormat.GRAY8: dramatically smaller archival TIFFs for scans.Progress<PdfRenderProgressEventArgs>: per-page progress callback for status display.- Cancellation: Ctrl-C aborts the render cleanly.
🧠 Model
- None. This demo is pure document plumbing and does not load an LLM.
🛠️ Getting Started
📋 Prerequisites
- .NET 8.0 or later
▶️ Running the Application
git clone https://github.com/LM-Kit/lm-kit-net-samples
cd lm-kit-net-samples/console_net/document-intelligence/pdf-toolkit/pdf_to_multipage_tiff
dotnet run
Pick a mode from the menu and follow the prompts.