Third-Party PDF Solutions
We contacted the vendor who was willing to augment their existing web service to offer us a web method to retrieve their source information. Now we had to decide how we should generate the PDF document. Knowing that it wasn't practical or reasonable to roll our own PDF generation tool, I began to look at third-party PDF solutions. I considered some open-source tools and other component vendors, but decided on PDF.Weba component included with Syncfusion's Essential PDF suite (www.syncfusion.com)for several reasons:
- We have had excellent prior experience with some of Syncfusion's other tools.
- Its Direct-Tac support system is excellent.
- Syncfusion offers multiple methods for generating PDFs, including doing so from a source other than a file (requirement).
- Its components have always emphasized performance (requirement).
- If new versions are released, it is very easy to maintain with Syncfusion's Assembly Manager Tool (requirement) and, if the Syncfusion assemblies aren't deployed to the GAC, they just have to reside in the bin folder. No other configuration is necessary.
- We already own its Essential Studio product so we wouldn't need to spend any additional budget dollars (requirement).
Most of the other solutions we considered involved writing content first to a file, then printing the file with a PDF print driver. Some were just too heavy to be viable in a high-traffic web environment, and others poorly documented. Some candidate solutions looked like they might fit the bill, but deployment ended up being an issue due to using COM.
Using PDF.Web
Having selected PDF.Web, I began investigating how it works. I'd had lots of experience using PDF writers that depended on a standard coordinate system to layout content and was expecting the same with PDF.Web. Although the coordinate system gives great granular control when laying out complex content, it's cumbersome and increases developer time to build documents since small layout errors can be hard to find. I was happy to see that Syncfusion offers both a Coordinate (Standard and Cartesian) system as well as something called "Document Logical Structure" (DLS)a "flow layout" manager. Knowing that my content was mainly text with a single masthead image, I elected to use the DLS layout and let it handle margins, page length, and other layout matters that usually make you want to pull your hair out.