Asp classic 在经典asp中将HTML表单转换为PDF
我有一个经典asp格式的表单,我想在不使用任何第三方的情况下将该表单转换为pdf。请帮助我,你不能。经典ASP没有内置的支持。你能做的最好的事情就是制作一个打印css并让用户使用PDF格式Asp classic 在经典asp中将HTML表单转换为PDF,asp-classic,Asp Classic,我有一个经典asp格式的表单,我想在不使用任何第三方的情况下将该表单转换为pdf。请帮助我,你不能。经典ASP没有内置的支持。你能做的最好的事情就是制作一个打印css并让用户使用PDF格式 有第三方工具可以实现这一点。请看这个问题。您可以通过几个步骤实现这一点 使用下面的代码保存到Word文档 <!DOCTYPE html> <%@ Language=VBScript %> <% Response.ContentType = "application/m
有第三方工具可以实现这一点。请看这个问题。您可以通过几个步骤实现这一点
<!DOCTYPE html>
<%@ Language=VBScript %>
<%
Response.ContentType = "application/msword"
Response.AddHeader "Content-Disposition", "Attachment;Filename=PRINT_TEST.doc"
%>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>PRINT TEST</title>
</head>
<body>
Hello! This is a Word File.
</body>
</html>
inDocFile = SOURCE_DIR+DOC_FILE_NAME
outPDFFile = OUTPUT_DIR+DOC_FILE_NAME[:-4]+".PDF"
in_file = os.path.abspath(inDocFile)
out_file = os.path.abspath(outPDFFile)
word = comtypes.client.CreateObject('Word.Application')
doc = word.Documents.Open(os.path.abspath(inDocFile))
doc.SaveAs(os.path.abspath(outPDFFile), FileFormat=17)
doc.Close()
word.Quit()