Setting Up VS Code Native Tabs on Mac: A Productivity Boost
June 13, 2023Quick and Easy JSDoc
August 7, 2023Recently we’ve been tasked with updating a report to also export the data as a PDF for your road trip work day. Even in this digital world, where it seems like everything is read on a phone, you’ll still find yourself needing to print out a report or page that you can use on the job site. We are using ColdFusion and ColdBox for this site so this update will be using the ColdBox HMVC Documentation. The ColdBox framework handles the rendering for you.
Using the ColdBox Framework you can easily render the current blogReport.cfm
into a PDF download for the user. With our application being ColdFusion and ColdBox it’s as easy as:
event.renderData( data=renderView("../views/report/blogReport"), type="PDF" );
That’s it! Well, you’re on your way, the page will still need to be styled for the layout of a PDF width and height. Styling for a PDF document is pretty simple. Just make sure you add your styling at the top of the page like this:
<style type="text/css">@import url("/views/blogPDF.css");</style>
And now you have a Road Warrior version of the report!