Skip to main content
November 3, 2010
Answered

Convert HTML to a PDF

  • November 3, 2010
  • 3 replies
  • 1278 views

Can ColdFusion take a snap shot of an HTML page and convert it to a PDF? I want to automate a process where a user goes to an HTML page, updates data from a word document,and then converts the word doc to a PDF and stores it. Can ColdFusion eliminate the user? Can I just set up a process in the administrator to run a script once a month that can do this?

*convert HTMl page to PDF

*Then put the file into the archive folder

I am trying to convince the owners to simply make this a form that inserts into a DB, but old habbits are hard to break. Until that time, can the above be done?

    This topic has been closed for replies.
    Correct answer -__cfSearching__-

    *convert HTMl page to PDF

    Yes, using CFDOCUMENT. Though this entry is about thumbnails, it does show how you can use cfdocument to capture the html of a url and convert it to pdf

    http://www.coldfusionjedi.com/index.cfm/2007/6/13/ColdFusion-8-URL-Thumbnails

    Just be aware CFDOCUMENT is not perfect. It does not always handle complex CSS styles. But for basic html it should do the job.

    *Then put the file into the archive folder

    Use the "filename" atribute to save the file anywhere you want. Check the documentation for more details.

    3 replies

    cfjedimaster
    Inspiring
    November 3, 2010

    Yes. cfdocument has a src attribute. Just point it to a URL.

    -__cfSearching__-Correct answer
    Inspiring
    November 3, 2010

    *convert HTMl page to PDF

    Yes, using CFDOCUMENT. Though this entry is about thumbnails, it does show how you can use cfdocument to capture the html of a url and convert it to pdf

    http://www.coldfusionjedi.com/index.cfm/2007/6/13/ColdFusion-8-URL-Thumbnails

    Just be aware CFDOCUMENT is not perfect. It does not always handle complex CSS styles. But for basic html it should do the job.

    *Then put the file into the archive folder

    Use the "filename" atribute to save the file anywhere you want. Check the documentation for more details.

    November 3, 2010

    I forgot to mention I am using CF 9