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 http://www.verydoc.com/doc-to-any-faq.html 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!

Customer
---------------------------------------------------------

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 http://www.verypdf.com/artprint/docprintsdk.htm 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 http://www.verydoc.com/doc-to-any-faq.html for the Excel application.

Just so you know, I am ware of all the instructions listed on http://www.verypdf.com/artprint/docprintsdk.htm and http://www.verydoc.com/doc-to-any-faq.html web pages.

Customer
---------------------------------------------------
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.

Thanks.
Customer
---------------------------------------------------

docPrintCom.dll is include the "RunCmd" function,

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

please refer to following screenshot,

image

You can call following code from your ASP code,

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

VeryPDF

---------------------------------------------------

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>")
Else
    Response.write("Cannot Connect to Word.Application.<br>")
End IF

objWord.ActivePrinter = "docPrint PDF Driver"
set objWordDoc = objWord.documents.open(docfilespec)
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("exeshell.shell")
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

%>

VeryPDF

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

This entry was posted in docPrint Pro and tagged , . Bookmark the permalink.

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!