Wednesday, May 11, 2016

PDF: going our own way

Over the years, we've relied on a variety of methods to create charts in the popular PDF (Portable Document Format). Our first choice was PDF-XChange, by Tracker. We had various problems with it. The final straw came when we discovered that Tracker was including a secret payload in their software: a self-contained PDF output driver, to be sold directly and surreptitiously to our customers.

The scam went like this. Companies that make PDF software often have two versions. One is a stand-alone PDF utility that looks like a printer. It is designed so end-users can convert the output of any program into a PDF file, such as MS Word, Excel, etc.

The second version is an SDK (Software Development Kit), aimed at developers, to add PDF capability to their own program. SDK customers are not allowed to create a general-purpose PDF utility, which could be accessed by third-party programs. Fair enough, Tracker make their own PDF output driver for this purpose. It wouldn't be fair to compete with them.

However, Tracker bundled both PDF products into their SDK. We were forbidden from using the stand-alone version, but we still had to incur the overhead and bloat in our installer. Why would they do this? Because as soon as our customer attempted to use the "SDK" version of the PDF driver as a printer, a helpful message would pop up offering to sell the customer a license for the general-purpose PDF utility. Directly, without giving us a cut. Even though we had incurred the expense of finding the customer.

Tracker never mentioned this "Trojan Horse" trick. We found out by accident. In addition, this behaviour violates anti-virus guidelines.

We switched to Amyuni PDF Creator, a much more powerful and reliable product.

PDF SDKs are usually implemented as printer drivers. Drivers occupy an intimate and privileged position in the operating system. A bug in a driver can cause more havoc than in an ordinary program. A malicious driver can cause considerable damage.

Microsoft has become more stringent about drivers over the years, changing the interface specifications, and forcing driver companies, including PDF, to overhaul their code. Microsoft now requires certification, by their labs, of all drivers. This is expensive, and naturally the cost is passed on to us in the form of renewed license fees, which can run into the thousands. Recent changes in Amyuni's licensing model have become exorbitant.

Changes in the Windows driver model break our old code, forcing our customers to upgrade. They are not all happy about this.

PDF driver installation problems, requiring arcane fixes, is one of our top support headaches.

In response to this situation, we have decided to develop code to create our own PDF files directly. This is not a trivial undertaking (the PDF spec. is 1,300 pages). But it will give us more autonomy, lower our development costs, save money for our customers, and enable us to take advantage of exciting PDF features not available through the driver interface: Table of Contents, Hyperlinks, Alphabetic Index, etc.

Our expertise with many other file formats (JPG, PNG, RTF, DXF, SVG, HTML, STL) means that our code is structured to adapt itself easily to new output formats.

We hope to have the PDF conversion completed within a couple of months.

Update: It's Nov'16, and I'm about half done.
Update 2: It's Jul'17, and I'm about three-quarter done.
Update 3: Dec'17 - Hot Dog! it's working. The new PDF does all the charts, with only a few glitches to fix. It is a thing of beauty. Bye-bye cursed driver-based solutions. A day doesn't go by that I don't get a support request from a customer whose PDF driver was zapped by a Windows update, and requires re-installation. As a bonus, Charting Companion now runs under Mac OS/X with Wine.




1 comment: