How to call pdfprint.exe from Server 2008 R2 IIS PHP to print the PDF files?

I’m testing out the product and I create my batch file and it runs fine manually triggering. I run this through my web (PHP) application and it seems to just stall. I’m wondering if there is a registration prompt or something that is holding it up, but since it is on the web services side I cannot see it nor does it get tot he point to log or capture anything. I’m on Server 2008 R2 IIS PHP. I have another application that runs through a command line and it runs fine, so curios on the registration might be holding it up?

Update:

If I run the batch file logged into the server then it runs fine and [prints to my local printer.
If I run the batch file through IIS then the message shows that it cannot find my printer DOIT, yet if I have it lists the printers then it shows DOIT. Any ideas?

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

image
If you call pdfprint.exe from IIS, it hasn't enough permission to print the PDF file to physical printer, so it will fail.

However, you can use "VeryPDFComRunCmd COM Component" to run pdfprint.exe from administrator user account, this will avoid the permission restrictions.

Please look at more information about "VeryPDFComRunCmd COM Component" from following web page,

http://www.verydoc.com/exeshell.html#VeryPDFComRunCmd_COM_Component

http://www.verydoc.com/blog/verydoc-release-notes-verydoc-releases-an-exe-com-of-verypdfcomruncmd-exe-today-verypdf-exe-com-does-allow-you-to-call-ms-office-and-any-exe-application-from-asp-php-c-net-etc-program-languag.html

The following is the PHP example to call pdfprint.exe application,

<?php

$strInFile = "D:\\VeryPDF\\test.pdf";
$strLicenseKey = "-$ XXXX-XXXX-XXXX-XXXX";
$strCmd = "D:\\VeryPDF\\pdfprint.exe $strLicenseKey \"$strInFile\"";

echo $strCmd . "\n";

$comobj = new COM("VeryPDFCom.RunCmd") or die("Couldn't create the COM Component");
$strCmd = $comobj->RunCmd2($strCmd, 5);
echo("Output is:\r\n" . $strCmd);

?>

You can set "VeryPDFCom.RunCmd" to run inside administrator user account, please look at more information from following web page,

http://www.verydoc.com/blog/verydoc-release-notes-verydoc-releases-an-exe-com-of-verypdfcomruncmd-exe-today-verypdf-exe-com-does-allow-you-to-call-ms-office-and-any-exe-application-from-asp-php-c-net-etc-program-languag.html

Please look at more articles in VeryPDF Knowledge Base,

https://www.verypdf.com/wordpress/201109/how-do-i-call-pdfprint-from-windows-service-or-local-system-to-print-the-pdf-file-to-network-printer-2310.html

https://www.verypdf.com/wordpress/201602/privileges-required-to-print-pdf-files-from-local-system-or-local-service-accounts-42230.html

https://www.verypdf.com/wordpress/201501/how-to-call-pdfprint-exe-to-print-pdf-files-to-windows-printer-from-php-source-code-how-to-print-pdf-files-from-a-web-based-app-41366.html

https://www.verypdf.com/wordpress/201311/how-to-print-a-pdf-file-to-network-printer-from-windows-service-39509.html

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: +1 (from 1 vote)

Related Posts

One Reply to “How to call pdfprint.exe from Server 2008 R2 IIS PHP to print the PDF files?”

  1. We are using the PDF command line tool from an IIS website. We call the process using System.Diagnostic.Process but it fails silently? Can you help provide some info on KB on this, has this been raised before – do we need to change some security?

    This has become urgent for us.
    Customer
    ——————————————
    Thanks for your message, in general, this problem is caused by permission restrictions of IIS Service, please look at a solution from following web page,

    http://www.verypdf.com/wordpress/201603/how-to-call-pdfprint-exe-from-server-2008-r2-iis-php-to-print-the-pdf-files-42489.html

    Because IIS Service is run from Local System user account, this user account has some restrictions, you can use “VeryPDFComRunCmd COM Component” to switch from Local System user account to administrator or an interactive user account, then you can print PDF files properly.

    VeryPDF

    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!