so ColdFusion MX 7 has a new tag,
<cfdocument>. This tag’s purpose to take content and spit out a nicely-formatted PDF (or FlashPaper, but really, PDF) of that content.
So I have pretty basic expectations for this tag, in order to consider it “ready for use”. I can’t believe that Macromedia’s criteria of “ready for use” was so much lower. I expect this tag to be able to, at the bare minimum, function exactly the same as printing to PDF. I’m ok if it ignores
media="print" attributes, and takes in the screen styles. However, I do expect to read and understand my styles.
The documentation claims support for HTML 4.0, CSS 1.0 & CSS 2.0. Very basic tests of these prove that while, indeed, it understands HTML 4.0 ok, the CSS support is terrible. For instance, I can’t include a background image without it screwing up (for that matter, it tends to destroy inline images too). It doesn’t handle floated or absolutely positioned elements terribly well either. It’s, and this is perhaps worst of all, so resource-intensive, that I can very easily crash any server that actually runs
<cfdocument> on-demand, rather than as an automated task. Locally, generating 3-4 PDFs simultaneously regularly crashes CF. On the production server, this jumps up to around 10 or so, but that’s still not an awful lot.
So Macromedia, today, today you earn the Suck Prize for Sucking. Fix
<cfdocument> now, or pull it. But don’t lie to me and tell me I can ” transform existing HTML content dynamically into Adobe PDF or Macromedia FlashPaper 2 formats to produce print-quality output”. Because I can’t. And you know what the test should be? I should be able to enter a URL into a text field, use
<cfhttpcontent> to pull in that site, and make a PDF of it. No Matter what site it is (ok, flash content excluded). And the resulting PDF should look pretty damned similar to the site in question. Ideally, exactly.