4.12 Creating PDFs with iTextSharp
Adobe’s PDF format is one of the most widely accepted document formats in use today. Most users and clients expect that the software you write will be able to generate and work with PDFs. Unfortunately, however, Adobe does not offer a free SDK that you can download and use; you have to pay to license the API, and a fair amount of work is usually required to get it up and running.
iTextSharp alleviates this problem. iTextSharp is a port of the iText Java PDF library that gives you the ability to add PDF functionality to your applications. Using iTextSharp, you can create and read PDF files without any costs or proprietary software, so you can deliver the functionality your users expect.
| |
|---|---|
Tool | iTextSharp |
Version covered | 3.1.0 |
Home page | |
Power Tools page | |
Summary | Full-featured PDF library for creating, reading, and working with Adobe’s PDF document format |
License type | LGPL |
Online resources | Mailing list |
Supported Frameworks | .NET 1.1 |
Getting Started
Download the iTextSharp assembly from the tool’s home page and reference it in your project (see the Appendix).
Using iTextSharp
To start, you’ll need to add a couple of using statements to your code:
using iTextSharp.text; using iTextSharp.text.pdf;
Then create a Document object:
Document pdfDocument = new Document( );
Next, create an ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access
