javascripthtmlpdfautomatic-storage

print html page to PDF on a schedule


I have a HTML page that uses javascript to generate dynamic images using a graph handler on a different server. The images will contain the same data for 1 week but will change when the 1 week window expires.

I am trying to come up with a way to automatically save the contents of the page to either a local file on the server or write to a PDF file.

I tried to use a 'web downloader' like HTTTrack, but it does not get the dynamic images...

I am running the html page off IIS.

I have no experience with IIS or ASP.

Thanks!


Solution

  • I was able to accomplish what I wanted to do using wkhtmltopdf to convert my HTML page with Javascript to PDF. I ran the job via a task scheduler to supply my website url and output file name as parameters.

    I then used a windows batch file to check if the file was created and then rename/email it to interested parties.

    This of course requires that you have the ability to install wkhtmltopdf on your server.