The following is the sample ASP code to call htmltools.exe to convert a web page to PDF file,
<%
Set objShell = CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.Exec("C:\inetpub\wwwroot\BL\htmltools\htmltools.exe -webkit http://www.google.com C:\inetpub\wwwroot\bl\pdftest\VeryPDF.pdf")
Set objStdOut = objWshScriptExec.StdOut
strOutput = objStdOut.ReadAll
strOutput = Replace(strOutput, vbCrLf, "<br>")
strOutput = Replace(strOutput, vbCrLf & vbCrLf, "<p>")
response.write(strOutput)
%>
If your IIS 7.5 hasn't permission to run an EXE application, please change the permission by following steps,
Setting Script, Execute Folder Permissions in IIS 7.5
Was working on an issue with Silverlight the other day and wanted to verify the folder settings in IIS 7.5 and it occurred to me I'd forgotten. I checked around and it took a few minutes to find - but too long so here's the short of it:
- Open Internet Information Services Manager (IIS)
- Expand the web site in the left hand panel
- Locate the folder and click on it to select it
- Double click 'Handler Mappings' in the middle panel
- On the right hand panel, click 'Edit Feature Permissions...'
- Set permissions as desired
Was simple, but they've made it a four step process in 7/7.5...
If your IIS 7.5 can't show the detailed error message, please refer to following steps to open the detailed error message,
IIS 7.5 , 2008rc2, classic asp, 500 error message:
The page cannot be displayed because an internal server error has occurred.
I need to know how to configure IIS to get a more detailed error.
I've tried setting to true all of debugging options in the ASP configuration.
But that didn't work. Can anyone help me?
The first, please check "Show friendly HTTP error messages" in IE,
So if "Send Errors To Browser" is not working set also this:
Error Pages -> 500 -> Edit Feature Settings -> "Detailed Errors"
Also note that if the content of the error page sent back is quite short and you're using IE, IE will happily ignore the useful content sent back by the server and show you its own generic error page instead. You can turn this off in IE's options, or use a different browser.
OK, after above settings, when you run this ASP page from web browser, you will see following log message, it is indicate this HTML file has been converted to PDF file on your server, everything is work fine now.