How to increase the Image Quality in docPrint doc2pdf.exe application? and How to run doc2pdf.exe from Windows Service?

image

Hi,

What are the best parameters for this job:

We have a Excel File -> DI.xlsx

We need a jpg File (Format W: 760 px H: 1080) for our Digital Signature, Screen from this Excel File.

Our Batch file:

"C:\Program Files (x86)\docPrint pro v6.0\doc2pdf.exe" -e -w 760 -h 1080 -G -b 24 -s killoffice=1 -i VeryPDF\ori\DI.xlsx -o VeryPDF\ori\DI.jpg

Is there an better quality available for this Screen Resolution?

Customer
--------------------------------------
If you wish increase the solution, you MUST increase the DPI or width/height, e.g.,

"C:\Program Files (x86)\docPrint pro v6.0\doc2pdf.exe" -e -r 600 -G -b 24 -s killoffice=1 -i VeryPDF\ori\DI.xlsx -o VeryPDF\ori\DI.jpg

"C:\Program Files (x86)\docPrint pro v6.0\doc2pdf.exe" -e -w 2280 -h 3240 -G -b 24 -s killoffice=1 -i VeryPDF\ori\DI.xlsx -o VeryPDF\ori\DI.jpg

There is not an easy way to improve the quality but without increase the resolution, please understand.

VeryPDF
--------------------------------------
Hey, looks like great now the jpg, Thanks

Other Question

"C:\Program Files (x86)\docPrint pro v6.0\doc2pdf.exe" -e -s DisableLogWindow=1 -s SilentPrintOffice=1 -d -D -w 2280 -h 3240 -G -b 24 -s killoffice=1 -i VeryPDF\%1.xlsx -o VeryPDF\%1.jpg

If i run this Batch command on my Server there are 2 Windows for 1 sec
a) Printing for 1 second
b) Option Settings for 1 second

Itβ€²s possible to hide this Windows. I see there is also a Service doc2pdf. How can i use this ? I donβ€²t like any Output Windows from this command, but i Need logs from this Job πŸ˜‰

Regard
Customer
--------------------------------------
Please refer to example 6 at following web page, you can use RunCmd() function to hide the DOS window,

http://www.verypdf.com/artprint/docprintsdk.htm

for example,

Example 6: Run conversion via "docPrint_Service.exe" application,

Please by following steps to run conversion via "docPrint_Service.exe" application,

1. Please login your server via Remote Desktop under Administrator user account (or other user accounts who own Administrator right),

2. Please run "docPrint_Service.exe" application,

"C:\Program Files\docPrint Pro v5.0\docPrint_Service.exe"

3. Call RunCmd() method to deliver a command line to "docPrint_Service.exe" application,

PHP example,

<?php
$com = new COM("DocPrintCom.docPrint");
$com->docPrintCOM_Register("XXXXXXXXXXXXXX","VeryPDF.com Inc.");
$com->RunCmd("-i http://www.verypdf.com -o C:\\test\\output.pdf -* XXXXXXXXXXXXXX -d -O 2 -s ShowHTMLStatusBar=1 -l 10000", 0);
?>

VB example,

Private Sub Command1_Click()
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)
MsgBox "Return value = " & Str(nRet)
End Sub

4. Close Remote Desktop and leave this user logged in.

*Please Notice: After you reboot the server, you need login your server via Remote Desktop with this user account ("docPrint_Service.exe" was installed inside this user account), and close Remote Desktop, leave this user logged in, when you call RunCmd() function, the conversion will be executed from this user account automatically.

VeryPDF
--------------------------------------
I have create a Batch script (Windows Server 2008 R2) convert_background.cmd.
If i run this script in a command Shell the script create the file SA.jpg and Directory test successfully.

If i run this script with the Task Scheduler the script create the the Directory successfully, but the Job runs and runs and runs. I find in the Task Manager the Program doc2pdf.exe*32 and i find in the Spooler of the Printer docPrint the file SA.xlsx, but nothing happens.

Please Help
Customer
--------------------------------------
Please use following solutions to try again,

Solution #1,

Please set your Windows Service run inside an interactive user account to try again, you can set "run from account" from Windows Service Manager.

Solution #2,

You can run conversion from current active user account, please refer to following steps,

1. Please run "C:\Program Files (x86)\docPrint Pro v6.0\docPrint_Service.exe" application first,

2. Please add "-s ConvertViaServer=1" parameter to the doc2pdf.exe command line options, e.g.,

"C:\Program Files (x86)\docPrint pro v6.0\doc2pdf.exe" -e -s DisableLogWindow=1 -s SilentPrintOffice=1 -d -D -w 2280 -h 3240 -G -b 24 -s killoffice=1 -i E:\VeryPDF\SA.xlsx -o E:\VeryPDF\SA.jpg

3. OK, you can run conversion from your Windows Service now.

Solution #3,

Set MS Office DCOM run inside an interactive user account, please look at following web pages for more information,

http://www.verydoc.com/blog/running-doc2any-as-a-scheduled-task.html
http://www.verydoc.com/others/configure-word-and-excel.htm
http://www.verydoc.com/blog/run-office-to-pdf-converter-or-doc2any-in-unattended-user-account.html
http://www.verydoc.com/blog/running-doc2any-from-java-program-by-run-as-service-option.html

Solution #4,

You can use CmdAsUser.exe to run doc2pdf.exe application, please look at "Example 7: Run conversion inside an interactive user account from service or web applications" at following web page,

http://www.verypdf.com/artprint/docprintsdk.htm

VeryPDF

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

Solution #2 is the best for me. I found a log file doc2pdf.log.
Now i have control over my Batch Jobs.

docPrint Print Server is running with User Account MServer with Admin Rights

I add the commando -s "convertviaserver=1" to my Batch file.

REM COMMAND LINE
erase E:\VeryPDF\VeryPDF\VeryPDF\VeryPDF\SA.jpg
"C:\Program Files (x86)\docPrint pro v6.0\doc2pdf.exe" -e -s "convertviaserver=1" -s "DisableLogWindow=1" -s "SilentPrintOffice=1" -d -D -w 2280 -h 3240 -G -b 24 -s "killoffice=1" -i E:\VeryPDF\VeryPDF\VeryPDF\VeryPDF\SA.xlsx -o E:\VeryPDF\VeryPDF\VeryPDF\VeryPDF\SA.jpg

I start the commando. All Looks good. No interactive Windows are there !

But no SA.jpg are there.

Problem i found in the log file:
Reply = ERROR, Reason = 'Command Line can't be found', TickCount = 32ms,

Look at the attachment.

if i run this commando (without -s "convertviaserver=1" in the command Shell all is ok !!!

REM COMMAND LINE
erase E:\VeryPDF\VeryPDF\VeryPDF\VeryPDF\SA.jpg
"C:\Program Files (x86)\docPrint pro v6.0\doc2pdf.exe" -e -s "DisableLogWindow=1" -s "SilentPrintOffice=1" -d -D -w 2280 -h 3240 -G -b 24 -s "killoffice=1" -i E:\VeryPDF\VeryPDF\VeryPDF\VeryPDF\SA.xlsx -o E:\VeryPDF\VeryPDF\VeryPDF\VeryPDF\SA.jpg

Regards
Customer
----------------------------------

Sorry, please use

-s ConvertViaServer=1

but not,

-s convertviaserver=1

This parameter is case sensitive,

e.g.,

"C:\Program Files (x86)\docPrint pro v6.0\doc2pdf.exe" -e -s ConvertViaServer=1 -s "DisableLogWindow=1" -s "SilentPrintOffice=1" -d -D -w 2280 -h 3240 -G -b 24 -s "killoffice=1" -i E:\VeryPDF\VeryPDF\VeryPDF\VeryPDF\SA.xlsx -o E:\VeryPDF\VeryPDF\VeryPDF\VeryPDF\SA.jpg

VeryPDF

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

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

One Response to How to increase the Image Quality in docPrint doc2pdf.exe application? and How to run doc2pdf.exe from Windows Service?

  1. VeryPDF says:

    Sorry, after reboot my Server, the Batch file with the function ConvertViaServer=1 does not create a jpg file.

    My Batch File:

    "C:\Program Files (x86)\docPrint pro v6.0\doc2pdf.exe" "-e" "-s" "ConvertViaServer=1" "-s" "DisableLogWindow=1" "-s" "SilentPrintOffice=1" "-d" "-D" "-w" "2280" "-h" "3000" "-G" "-b" "24" "-s" "killoffice=1" "-i" "E:\test\FR.xlsx" "-o" "E:\test\FR.jpg"

    Service Log, last Entry

    >>>Exit Thread, ThreadId = 2964
    ———————————————–
    I think i have found the Problem. It was a DCOM Excel Security Problem. Now i have reboot the Server, and now the JPG was created with the option "-s" "ConvertViaServer=1"

    Thank you.
    Customer

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

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!