Can’t get Doc2PDFCommandLine to work on 64bit Coldfusion

Hi

We can't seem to get Doc2PDFCommandLine to work on our 64bit Coldfusion 10 Server (Update 11).

This is the sample Coldfusion code that we're using:
--------------------------------------------------------
<cfset paperType = "7">
<cfset pageWidth = "595">
<cfset pageHeight = "842">
<cfset sourceUrl = "http://localhost/pdf/input.html">
<cfset outputFile = "D:/Inetpub/wwwroot/pdf/output.pdf">

<cfset pdfObj = createObject("COM", "DocConverterCOM.PdfOut")>
<cfset result = pdfObj.Doc2PDFCommandLine("""#sourceUrl#"" ""#outputFile#"" ""paperType=#paperType#,PrintHTMLBackground=yes,overwrite=yes,margin_left=10,
margin_right=10,margin_top=5,margin_bottom=5,pageWidth=#pageWidth#,
pageHeight=#pageHeight#""")>
--------------------------------------------------------

The code executes without any warnings or errors, but no output file (output.pdf) is created. The following is the log entry in "html2pdf.log":

--------------------------------------------------------
CreateThread(ThreadId = 4652) successful.
>>>>>Exit Thread, ThreadId = 4652
--------------------------------------------------------

We've installed pdfcamp as a service by running the "install_as_service_x64.bat" file. Any other information you need please let me know.

Thanks for your help.

Cheers
Customer
----------------------------------------------------------------------
Here is the log message,
----------------------------------------------------------------------
CreateThread(ThreadId = 4652) successful.
<<<<<<<<<<<<<<<<<<Enter Thread, ThreadId = 4652
ThreadID(4652), Wait at here, Command Line = "http://localhost/pdf/input.html" "D:/Inetpub/wwwroot/pdf/output.pdf" "paperType=7,PrintHTMLBackground=yes,overwrite=yes,margin_left=10,margin_right=10,
margin_top=5,margin_bottom=5,pageWidth=595,pageHeight=842" Time:Tue Oct 29 13:05:00 2013

There still have 1 items in the waiting queue.(FileQueue_AppendCommandLine)
ThreadID(4652), "C:\pdfcamp\doc2pdf_com\html2pdf.exe" "http://localhost/pdf/input.html" "D:/Inetpub/wwwroot/pdf/output.pdf" "paperType=7,PrintHTMLBackground=yes,overwrite=yes,margin_left=10,margin_right=10,
margin_top=5,margin_bottom=5,pageWidth=595,pageHeight=842"
ThreadID(4652), Begin convert: http://localhost/pdf/input.html ==> D:/Inetpub/wwwroot/pdf/output.pdf
ThreadID(4652), End convert: http://localhost/pdf/input.html ==> D:/Inetpub/wwwroot/pdf/output.pdf
There still have 1 items in the waiting queue. (FileQueue_ChangeFinishedFlag)
Remove Queue Item, CommandLine = "http://localhost/pdf/input.html" "D:/Inetpub/wwwroot/pdf/output.pdf" "paperType=7,PrintHTMLBackground=yes,overwrite=yes,margin_left=10,margin_right=10,
margin_top=5,margin_bottom=5,pageWidth=595,pageHeight=842" Time:Tue Oct 29 13:05:00 2013

There still have 0 items in the waiting queue.(FileQueue_DeleteFinishedFiles)
ThreadID(4652), Finished Conversion, Reply = OK, TickCount = 343ms, Command Line = "http://localhost/pdf/input.html" "D:/Inetpub/wwwroot/pdf/output.pdf" "paperType=7,PrintHTMLBackground=yes,overwrite=yes,margin_left=10,margin_right=10,
margin_top=5,margin_bottom=5,pageWidth=595,pageHeight=842" Time:Tue Oct 29 13:05:00 2013

>>>>>>>>>>>>>>>>>>>>>Exit Thread, ThreadId = 4652
----------------------------------------------------------------------
Ok we finally got it to generate - we had to change the account for the "VeryPDF DocConverter COM Service" Windows Service from "local" to the ColdFusion account.

Now we have a new issue. Although the output pdf file generates, it's not done "synchronously". It seems that Doc2PDFCommandLine put's the conversion job in a queue and return, which causes the calling function to finish execution with no PDF file ready for use *immediately*.

I've tried Doc2PDFCommandLineEx as well, but gets "method not found" error.

Any idea?
Customer
----------------------------------------------------------------------
OK I solved it! Pass in the second argument (1) for Doc2PDFCommandLineEx, and it's all working as intended now.

<cfset paperType = "7">
<cfset pageWidth = "595">
<cfset pageHeight = "842">
<cfset sourceUrl = "http://localhost/pdf/input.html">
<cfset outputFile = "D:/Inetpub/wwwroot/pdf/output.pdf">

<cfset pdfObj = createObject("COM", "DocConverterCOM.PdfOut")>
<cfset result = pdfObj.Doc2PDFCommandLineEx("""#sourceUrl#"" ""#outputFile#"" ""paperType=#paperType#,PrintHTMLBackground=yes,overwrite=yes,margin_left=10,
margin_right=10,margin_top=5,margin_bottom=5,pageWidth=#pageWidth#,
pageHeight=#pageHeight#""", 1)>

Customer

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!