从输出中可以看出,以下代码不会产生任何错误。目的是使用 htmldoc 将 html 文件转换为 pdf 文件。html文件生成正常,pdf应该保存到与pdf相同的文件夹中,但没有生成pdf文件。
该代码在 Windows 2012 IIS 8 上运行。该代码在 Windows 2003 服务器上运行良好,没有任何问题。
输出是:
从这里开始
2014 年 2 月 2 日下午 3:48:08
通过传递
运行成功
2014 年 2 月 2 日下午 3:48:08
任何人都可以帮忙吗?非常感谢!
CmdeHTMLDOC=chr(34)& exe_path & chr(34) & " --header ... --footer ../ -t pdf --textfont Arial --fontsize 9 --quiet --left 1.5cm --right 1.5cm " & " --webpage -f "
set wshell=Server.CreateObject("wscript.shell")
wpath4pdf= CmdeHTMLDOC & chr(34)& pdf_path &chr(34)&" "& chr(34)& html_path &chr(34)
'wshell.Run wpath4pdf, SW_SHOWNORMAL,true
Response.Write("Starts here<br/>")
on error resume next
%>
<pre><%=now()%></pre>
<%
wshell.Run wpath4pdf, SW_SHOWNORMAL,true
Response.write "Passed through<br/>"
if err.number <> 0 then
response.write "Error detected: " & err.number & ": " & err.Description & "<br/>"
on error goto 0
response.end
end if
on error goto 0
Response.write "Run sucessfully<br/>"
%>
<pre><%=now()%></pre>
<%Set wshell=nothing