Calendar

««Jan 2012»»
SMTWTFS
1234567
891011121314
15161718192021
22232425262728
293031

Alert Email

Get a short email alert whenever a new entry is published.

Confidential, secure it's piece of cake to keep uptodate.

CFDOCUMENT support

Published: 10:03 AM GMT, Wednesday, 18 March 2009

This week saw CFDOCUMENT added to Open BlueDragon. It is in an initial implementation in that it doesn't fully support all the attributes (currently fontEmbed, bookmark, scale, backgroundVisible, localUrl are not supported) and CFDOCUMENTITEM/CFDOCUMENTSECTION support are still to be implemented.

There is bags of functionality in there though that make CFDOCUMENT a very useful addition.

The implementation is based upon the latest version of xhtmlrenderer library (AKA The Flying Saucer project). As such, it benefits from the beautiful rendering it provides and the additional functionality it brings.

For example, you can use the custom css attribute '-fs-table-paginate' if you'd like tables that span multiple pages to repeat the table headers and footers on every page.

<cfdocument format="pdf">
<style>
  table {
    -fs-table-paginate: paginate;
  }
</style>
<table>
<thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead>
<tbody>
<cfloop from=1 to=150 index=i>
  <cfoutput><tr><td>#i#a</td><td>#i#b</td><td>#i#c</td></tr></cfoutput>
</cfloop>
</tbody>
</table>
</cfdocument>

You can also work around the lack of CFDOCUMENTITEM support for now by specifying the header/footer in CSS.

<cfdocument format="pdf">
<style>
@page{
  @top-center {
    content: "This is the header";
  }
  @bottom-center {
    content: "Page " counter(page) " of " counter(pages);
  }
}
</style>
<h1>Header test</h1>
</cfdocument>

This is just a hint of some of the functionality that is provided in this new tag. As always, please try it out from our nightly builds and feedback is welcomed.

Comments (7)

Not sure Roman--that would be a question for the Adobe folks.

left by Matt Woodward . Tuesday, 24 August 2010 6:28 PM

Do you know if there is a way to do table-paginate in ColdFusion 9?

left by Roman Smolkin . Tuesday, 24 August 2010 6:25 PM

There was an issue (see bug #111) which has now been fixed. Please try the latest build Aleksandar.

left by Andy Wu . Thursday, 21 May 2009 2:20 PM

Great job. How to get utf-8 characters, for east-european languages? example: č ć ž đ š

left by Aleksandar . Wednesday, 15 April 2009 9:30 AM

Great! This'll bring a 10 month cfml dev project one more step to completion! Hooray!

left by Damien . Thursday, 9 April 2009 4:37 AM

It certainly does :)

left by Andy Wu . Wednesday, 18 March 2009 2:56 PM

Excellent! :-) Tell me, does it properly support text-align:justify please? CF8 doesn't. Thanks.

left by Gary Fenton . Wednesday, 18 March 2009 2:45 PM
Add Comment