In this article, we will introduce more information about how to call DocConverter COM (html2pdf.exe + pdfout.dll) from ASP code on Windows Server 2008 R2 64bit system,
In order to use them on 64bit system, you need install PDFcamp Printer x64 version and DocConverter COM x64 version, the 64bit version of PDFcamp Printer and DocConverter COM products can be downloaded from following web page,
https://www.verypdf.com/app/pdfcamp-printer/try-and-buy.html
https://www.verypdf.com/pdfcamp/pdfcamp-printer-x64.exe
http://www.toppdf.com/pdfcamp/doc2pdf_com_trial.zip
In order to call html2pdf.exe from ASP code directly, we need VeryPDFComRunCmd COM too, VeryPDFComRunCmd COM download URL is:
https://www.verypdf.com/dl2.php/VeryPDFComRunCmd.zip
Relevant article:
Please download and install PDFcamp Printer x64 version, unzip doc2pdf_com_trial.zip and VeryPDFComRunCmd.zip to "C:\Installs\doc2pdf_com_full_v2.5\" folder, of course, you can put them to any other folders that you want.
After you installed PDFcamp Printer x64 version, please go to "Printer & Fax" folder, rename "PDFcamp Printer" printer name to "PDFcamp Printer Driver", if you don't rename the printer driver, DocConverter COM will fail to locate the PDF Printer, please notice this matter.
OK, you will get a "PDFcamp Printer Driver" in "Printer & Fax" folder,
Please by following steps to register necessary COM/DCOM components into your Windows 2008 R2 64bit system. You need launch a CMD window with Administrator Privilege first, see following screenshot,
1. Register pdfout.dll COM Library,
regsvr32 C:\Installs\doc2pdf_com_full_v2.5\pdfout.dll
pdfout.dll is a 32bit COM, it can be called from 32bit application only, if you wish call it from ASP code which host by 64bit IIS Server, you need run your ASP application in 32bit mode, your ASP code will able to access 32bit pdfout.dll library. If your ASP code is running in pure x64 mode, it can’t access to 32bit pdfout.dll library directly unless you set "Enable 32-bit Applications" to True in IIS 6.0.
If you don't know how to set "Enable 32-bit Applications" to True in IIS 6.0, please refer to following steps,
1.1. Create a new application pool for the helpdesk application.
1.2. In the new pool's advanced settings, set "Enable 32-bit Applications" to True.
1.3. Right-click the helpdesk application's virtual directory in IIS manager, make sure it has been converted to application. This makes it be a separate web application which is independent to the parent site.
1. 4. In the virtual directory's Basic settings, change it to use the new application pool.
You can also change the settings to an existing Application Pool, please go to the Application Pool tied to the web application, Advanced Properties... and set "Enable 32-bit Applications" to True, your ASP code will able to call 32bit pdfout.dll correctly.
Please refer to more information from following web pages,
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx?mfr=true
http://www.eggheadcafe.com/software/aspnet/33931176/iis-7-running-32-bit-app-in-64bit-server.aspx
After you set "Enable 32-bit Applications" to True in IIS 6.0, you can call following ASP examples from 64bit ASP code properly,
https://www.verypdf.com/pdfcamp/doc2pdf_readme.html
If you don't want to set "Enable 32-bit Applications" to True, please read continue and try to use VeryPDFComRunCmd COM to call html2pdf.exe from ASP code directly.
2. Run a test to convert HTML file to PDF file by html2pdf.exe and pdfout.dll, by following command line,
C:\Installs\doc2pdf_com_full_v2.5\html2pdf.exe "http://www.google.com" "C:\Installs\doc2pdf_com_full_v2.5\out.pdf"
If you can convert this HTML file to PDF file, it is indicate everything is fine in your system until now.
3. Register VeryPDFComRunCmd.exe COM Interface, we will call this COM from ASP code at later. VeryPDFComRunCmd COM can be called from both 32bit and 64bit applications, you can call VeryPDFComRunCmd COM from 64bit ASP code even if "Enable 32-bit Applications" is False in IIS 6.0.
Run following command line to register VeryPDFComRunCmd COM into your system, you need use Administrator privilege to run this command line,
C:\Installs\doc2pdf_com_full_v2.5\VeryPDFComRunCmd\VeryPDFComRunCmd\VeryPDFComRunCmd.exe /regserver
4. Set enough Access Permissions to VeryPDFComRunCmd COM Library,
Run "dcomcnfg" on 32bit system to launch "Component Services",
OR
Run "MMC comexp.msc /32" on 64bit system to launch "Component Services",
In the Component Services Window, expand the tree item:
Console Root / Component Services / Computers / My computer / DCOM Config
Right click the "VeryPDFCom.RunCmd" entry and select "Properties":
Switch to "Security" tab, select "Customize" option for three items, Click "Edit" button to set permissions to each item,
Add "Everyone" user account and given full permissions to "Launch and Activation Permission",
Add "Everyone" user account and given full permissions to "Access Permission",
Add "Everyone" user account and given full permissions to "Change Configuration Permission",
Click "Identify" tab, choose "The interactive user." or "This user." item, click "OK" button to return,
OK, Congratulations! All permission settings are done till this step.
Now, we run following ASP code to test HTML to PDF conversion function,
---------------------------------------------------------------
<%
set VeryPDFCom = Server.CreateObject("VeryPDFCom.RunCmd")
strExeFile = "C:\Installs\doc2pdf_com_full_v2.5\html2pdf.exe"
strPDFFile = server.mappath(".") & "\_verypdf_out.pdf"
strCmd = strExeFile & " " & """http://www.google.com"" """ & strPDFFile & """ ""paperType=9,pageWidth=792,pageHeight=612,Overwrite=yes"""
Response.write strCmd & "<br>"
bRet = VeryPDFCom.RunCmd(strCmd, 5, 0)
Response.write "Return Code = " & bRet & "<br>"
%>
---------------------------------------------------------------
When we run this ASP code from internet, we get following message, it is indicate everything is fine,
C:\Installs\doc2pdf_com_full_v2.5\html2pdf.exe "http://www.google.com" "C:\inetpub\wwwroot\_verypdf_out.pdf" "paperType=9,pageWidth=792,pageHeight=612,Overwrite=yes"
Return Code = True
If you encounter any problem with above functions, please feel free contact us via VeryPDF Support Center, we are glad to assist you asap,
http://support.verypdf.com/open.php
Tips:
============================================
To enable IIS 6.0 to run 32-bit applications on 64-bit Windows
1. Open a command prompt and navigate to the %systemdrive%\Inetpub\AdminScripts directory.
2. Type the following command:
cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 "true"
3. Press ENTER.
============================================
Relevant Links:
https://www.verypdf.com/pdfcamp/doc2pdf_readme.html
https://www.verypdf.com/app/pdfcamp-printer/index.html
https://www.verypdf.com/app/pdfcamp-printer/doc-converter-com.html
https://www.verypdf.com/pdfcamp/doc-converter-sdk.html
https://www.verypdf.com/pdfcamp/batch-convert-html-to-pdf.html
https://www.verypdf.com/pdfcamp/convert-html-to-pdf.html
https://www.verypdf.com/document/convert-office-to-pdf.htm
https://www.verypdf.com/pdfcamp/support/index.html
https://www.verypdf.com/pdfcamp/doc2pdf_functions.htm
http://www.verydoc.com/exeshell.html
You keep it up now, untdesrand? Really good to know.