How to convert DOC to PDF, PNG, TIFF formats using docPrint SDK from classic ASP code?

I have tried the changes on the web page but it did not work either unless I passed the same Windows interactive user name and password to the method "docPrintCOM_DocumentConverterEx" in my web service code AND added the NETWORK SERVICE account to the local Administrators group on the web service server. The thing is that making the NETWORK SERVICE account a local administrator on the web service server or having our web services run under an administrator account by turning on ASP.NET Impersonation is not acceptable to our customers.

Sorry if I did not make this clear.

Is there anything else I can try? Thanks!


Thanks for looking into our test machine.

As I already said, "I have not tried the example 6 and example 7 listed on the web page yet. But the approach of the example 6 would not be an option for our customers. And I think I would get the same error above with the example 7". So even if I could get the ASP file work it would not be acceptable by our customers. Also, our web services are in ASP.NET, not ASP. And also, we have docPrint Pro 5.0, not 6.0.

Once you are on our test machine, you have administrative privileges on it. You can put your test ASP file anywhere you want in IIS on the test machine. And you can access the ASP file locally from the Internet Explorer on the test machine. You do not need to test the ASP file from internet.

I guess the most important thing for now is that you need to check if we have anything set up wrong on our test machine. I already did all the instructions listed on for the Excel application.

Just so you know, I am ware of all the instructions listed on and web pages.

Just some additional information. Below is the C# code we are using to convert a Office document to an image. The code is part of our web services that are hosted in IIS and it runs under the NETWORK SERVICE account.

DOCPRINTCOMLib.docPrintClass docPrint = new DOCPRINTCOMLib.docPrintClass();
docPrint.docPrintCOM_Register(ReportSettings.DocPrinterKey, TcmContext.Current.TcmInfo.Company);
string options = string.Format(" -b {0} -r {1}", ReportSettings.ColorType, ReportSettings.DPI);
docPrint.docPrintCOM_DocumentConverterEx("", "", fileInfo.FullName, tmpPath + ".png", options);

A strange thing is that I cannot seem to find the method "RunCmd" in the class DOCPRINTCOMLib.docPrintClass. You mentioned that method in the ASP file above.


docPrintCom.dll is include the "RunCmd" function,

"C:\Program Files (x86)\docPrint Pro v6.0\docPrintCom.dll"

please refer to following screenshot,


You can call following code from your ASP code,

Set docPrint = CreateObject("DocPrintCom.docPrint")
nRet = docPrint.docPrintCOM_Register("XXXXXXXXXXXXXX", " Company")
nRet = docPrint.RunCmd("-i -o C:\output.pdf -* XXXXXXXXXXXXXX -d -O 2 -s ShowHTMLStatusBar=1 -l 10000", 0)



We have finished the conversion solution in your VM, you can use following ASP code to convert from DOC to PNG and PDF formats without any problem, this ASP code will not  cause any security issues,


docfilespec = "C:\Program Files\docPrint Pro v6.0\examples\test.doc"
prnfilespec = "C:\Program Files\docPrint Pro v6.0\examples\test.doc.prn"
outfilespec = "C:\Program Files\docPrint Pro v6.0\examples\test.doc.png"
outfilespec2 = "C:\Program Files\docPrint Pro v6.0\examples\test.doc.pdf"

set objWord = CreateObject("Word.Application")
If IsObject(WrdApp) Then
    Response.write("Word.Application Status Connected.<br>")
    Response.write("Cannot Connect to Word.Application.<br>")
End IF

objWord.ActivePrinter = "docPrint PDF Driver"
set objWordDoc =
objWord.options.printbackground = false
objWordDoc.printout False , , , prnfilespec , , , , , , , True
objWordDoc.close WdDoNotSaveChanges
objWord.quit WdDoNotSaveChanges
set objWordDoc = nothing
set objWord = nothing

Set comEXEShell = Server.CreateObject("")
strCmd = """C:\Program Files\docPrint Pro v6.0\doc2pdf.exe"" -s convertprn=1 -b 24 -r 200 -* XXXXXXXXXXXXXX -i """ & prnfilespec & """ -o """ & outfilespec & """"
Response.write("<br><br>" & strCmd & "<br><br>")
comEXEShell.RunCommandLine "", "", strCmd

strCmd = """C:\Program Files\docPrint Pro v6.0\doc2pdf.exe"" -s convertprn=1 -b 24 -r 200 -* XXXXXXXXXXXXXX -i """ & prnfilespec & """ -o """ & outfilespec2 & """"
Response.write("<br><br>" & strCmd & "<br><br>")
comEXEShell.RunCommandLine "", "", strCmd

Set comEXEShell = Nothing



VN:F [1.9.20_1166]
Rating: 5.5/10 (2 votes cast)
VN:F [1.9.20_1166]
Rating: +1 (from 1 vote)
How to convert DOC to PDF, PNG, TIFF formats using docPrint SDK from classic ASP code?, 5.5 out of 10 based on 2 ratings

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!