TVScoundrel/ColdBox-iText-Plugin — comment on commit b12e5de8092c8bdb43cedc536a4e275232632a69
File:  line 0
By TVScoundrel:

I am very chuffed about this last commit as I finally found a way to make header and footer management really easy.

In the normal iText flow of things you need to extend the PdfPageEventHelper class and then override the onDocumentOpen, onPageStart and onPageEnd methods to get anywhere... but that means you kind of need to create a new extension for each different document you need to create.

I wanted to dynamically change my headers and footers... including dynamic adjustment of margins to accommodate for the size of the headers and footers. I wanted to define and create my headers on the fly.

Specifically because from coldfusion there is no way to extend a java class although I did find a few methods to simulate that... the problem is that sending a coldfusion object to java is not or hardly possible so extending a java class was not an option.

Have a look at the headerFooter.cfm example if you want to know more, but you now actually have the full iText functionality to dynamically change your headers and footers from coldfusion at runtime.

Hope some people can use this.

Cheers,
Tom