Product Reviews

Product Review: Generating Documents with DynamicPDF for .NET

A useful set of tools for creating PDF documents dynamically from code.

ceTe Software DynamicPDF Core Suite for .NET consists of two libraries for you to use at runtime: Generator for dynamically creating PDF documents, and Merger for merging, splitting and filling PDF documents. The ReportWriter and Designer generate PDF reports.

The classes that make up the DynamicPDF Generator for .NET allow you to generate documents up to 2GB in size from code (C# and Visual Basic) in both desktop and Web-based applications. The following code is all that's necessary to create a one-page PDF document with a single TextBox, and then write it to a file:

Dim doc As Document = New Document()
Dim pag As New Page
Dim txta As New TextArea(
  "Hello World!", 10, 20, 50, 15, Font.TimesRoman, 12)
pag.Elements.Add(txta)
doc.Pages.Add(pag)

Dim fs As New FileStream("C:\NewFile.pdf", FileMode.Create)
fs.Write(doc.Draw(), 0, doc.Draw().Count)
fs.Close()

[Click on image for larger view.]
ceTe Software DynamicPDF Designer, which is included in the Core Suite, enables you to create report formats to use with the DynamicPDF ReportWriter.

Printing API
In an ASP.NET application, the Document object's DrawToWeb method lets you output the document to the current WebForm. The DrawToBitmap method lets you generate output that could be displayed in an Image control. ceTe PrintManager gives you a server-side API for sending documents directly to printers. Unfortunately, it's not included in the suite.

Generator supports templates, which allow you to specify repeatable content for headers and footers in documents with multiple pages. However, using Generator to create highly formatted documents from scratch -- which could be very code-intensive -- doesn't reflect the typical business case of creating new editions of standard documents.

DynamicPDF Merger for .NET is the real jewel in the crown because it allows you, from code, to take an existing PDF document and either append or modify it. With Merger, you can create PDF documents in a page-formatting tool, and then use them as templates for creating new editions of those documents.

PDF Reports
While there's nothing wrong with the included ReportWriter, it doesn't yet have all the features of the dominant reporting tools in this area. The main benefit of the DynamicPDF ReportWriter is that output is directly translated into a PDF file.

The Enterprise edition of the DynamicPDF Core Suite for .NET offers additional chart types plus support for bar codes, prepress, archiving and encryption, among other features. Pricing is on both a per-user and per-server basis. You can buy the individual suite components separately but, if you're going to purchase any two of the packages, you might as well buy the Core Suite. The Professional and Enterprise versions of the suite provide a Help library that integrates with Visual Studio and several sample applications (though "Getting Started" tutorials appear to be included only for Generator).

ceTe Software DynamicPDF Core Suite for .NET provides many of the tools that a shop generating PDF documents would need, with only one significant hole: the suite doesn't address printing documents. And while there's nothing wrong with the suite, many shops might find DynamicPDF Merger for .NET, by itself, more useful.

DynamicPDF Core Suite for .NET

ceTe Software
Web: dynamicpdf.com
Phone: 800-631-5006
Price: $899 for DynamicPDF Core Suite Professional server license; $1,599 developer license
Quick Facts: A suite of tools for working with PDF documents, including a report writer
Pros: Excellent set of APIs for creating PDF documents, giving you three tools for the price of two
Cons: For many shops, one of the components -- Merger -- will stand above the rest



About the Author

Peter Vogel is a principal in PH&V Information Services, specializing in Web development with expertise in SOA, client-side development, and user interface design. Peter tweets about his VSM columns with the hashtag #vogelarticles. His most recent book ("rtfm*") is on writing effective user manuals, and his blog posts on communicating effectively can be found at http://blog.learningtree.com/category/communication-2/.

comments powered by Disqus
Upcoming Events

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.