Cool UDF: cfcToPrinter

I don't normally highlight CFLib resources, but I just thought this one was so cool it deserved special mention. Today I released cfcToPrinter, a UDF by Jared Rypka-Hauer. What does it do? Well, as you know, CFCs have their own "pretty" view when you open them directly in the browser. The problem with this is that it is protected by RDS security. This makes sense, of course, but makes it difficult to share CFC documentation with others. This UDF removes that problem. It uses the same code as the "built-in" viewer to generate the documentation. It then returns either the HTML, or the binary data for the PDF or FlashPaper version. Here is an example from blog.cfc.

Something interesting you should note in the UDF. It makes use of the fact that cfdocument can return it's data into a variable. That data could be written to a file, or cfoutput using a cfcontent tag first. The cfchart tag can also do this. I used this feature in my CFCHART in Flash Forms postings.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments