How to convert word to PDF from ASP program?

  In this article, I will show you how to covert Word document to PDF from ASP program. The software I use is named as VeryDOC Doc Converter COM, by which you can convert any printable documents to PDF files, convert dynamic HTML pages and URLs to PDF files conversion (include Java Applet, SVG, Flash, Javascript, iFrame, etc.) and others. And this software can be used to be integrated COM object (or DLL Library, or Command Line), which makes developers develop software via any programming or scripting languages, such as Visual Basic, C/C++, Delphi, ASP, PHP, C#, .NET, etc.  Please check more information on homepage, in the following part, let us check how to use this software.

Step 1. Download Doc Converter COM

  • All the VeryDOC software is free trial and free downloading, so you can evaluate it without any payment charged. When you use this software, please make sure your computer satisfy those requirements: PDFcamp V1.8 or newer, or PDFcamp Pro V1.8 or newer installed, Microsoft Windows 2000, XP, 2003, Vista, and 7 later version installed.
  • When downloading finishes, there will be a zip file. Please extract this file to some folder then you can run this software according to the usage and examples.

Step 2. Convert word to PDF from ASP program.

  • The following code is from the extracted folder examples, which can help you call this software from ASP quickly and accurately.
  • Here are some examples, please run the conversion following the following steps.

A: Please by following steps to try,
1. Please run "install_as_exe.bat" to install the DocConverter COM first, and make sure the "doc2pdf_service.exe" application is running,
2. Please make sure that you have already installed "PDFcamp Printer" before,
3. Please run following ASP examples to try,
Example 1:
                        set PdfCreator = server.createobject("PdfOut.PdfCreator")
                        PdfCreator.html2PDF= ""
                        PdfCreator.fileName = "C:/google.pdf"
                        result = PdfCreator.Doc2PDFViaSocket()
                        set PdfCreator = nothing
Example 2:
                        set PdfCreator = Server.CreateObject("PdfOut.PdfCreator")
                        ConvertHTMLToPDF1 PdfCreator,"","google001.pdf"
                        set PdfCreator = nothing
                        function ConvertHTMLToPDF1(byval PdfCreator, strHTMLFile, strPDFFile)
                                'The first method to create a PDF file from HTML file
                                strPDFFile = server.mappath(".") & "\" & strPDFFile
                                dim strCommandLine
                                strCommandLine = """" + strHTMLFile + """"
                                strCommandLine = strCommandLine + " "
                                strCommandLine = strCommandLine + """" + strPDFFile + """"
                                strCommandLine = strCommandLine + " "
                                strCommandLine = strCommandLine + """" + "paperType=6" + """"
                                Response.write "HTML To PDF Command Line1 is: " & strCommandLine & "<br>"
                        end function
4. Then you can convert .html, URL, .doc, .docx, .rtf, .ppt, .pptx, .xls, .xlsx, txt etc. files to PDF files from your ASP code.

There are more examples in extracted folder and user manual, please check details there. During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!