Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Print PDF file from php script to remote computer printer

Posted on 2004-04-29
2
Medium Priority
?
1,328 Views
Last Modified: 2013-12-02
I'm going crazy...desperate for help

Have small network with 10-15 computers on windows 2000. The server is running Apache 2.0.
The clients execute php scripts. Some scripts dynamically create pdf files stored in a root folder and I must print these files to different printers connected to clients depending on the script called. I've tried executing a shell  command like

"AcroRd32.exe /t path printername drivername portname"
exec(" \"C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe\" /p /h C:\\temp\\test.pdf  \\MERCURY\HPLaserJ \"HP LaserJet IIIP\" LPT1: ");

but it doesn't work. the reader opens on the server but it can't print. I get errors like : "before printing you need to configure a printer". But printers are all correctly configured.

0
Comment
Question by:Niappi
2 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 10954537
It looks like you are running Reader on the server. If you check the EULA that you agreed to when you first started Reader, you'll notice that Adobe does not license Reader for this purpose.

From the EULA (http://www.adobe.com/products/acrobat/acrreula.html), section 2.2.1:

"Unless otherwise expressly permitted hereunder, no other server or network use of the Software is permitted, including but not limited to use of the Software (i) either directly or through commands, data or instructions from or to another computer or (ii) for internal network, internet or web hosting services."

Besides this EULA issue, Reader (or even the full version of Acrobat) is not technically suitable for server use.

There are other methods to accomplish your goal (printing a document on the client's printer). You can for example serve your PDF file to the client with a special mime type that would run a local program to print the file (http://www.planetpdf.com/asp/default.asp?action=9&read=40057&fid=3#107543)
Another solution is to print from the server, but without using Adobe products. One of these products is http://www.pdfstore.com/details.asp?ProdID=724 - as you may notice, server based products are more expensive than what you would use on a client.
Another approach is to use e.g. Ghostscript (http://www.ghostscript.com) to convert the PDF file to your printer format (PostScript, PCL, ESC/P, ...) and then spool this file to the destination printer. Depending on how you want to use Ghostscript, it may be free (as long as you don't want to use it in a product that you want to distribute), so check the license agreement.
0
 

Author Comment

by:Niappi
ID: 10968598
thank you very much, your answer was very helpfull!
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
In a previous article here at Experts Exchange (http://www.experts-exchange.com/articles/18414/Create-a-PDF-file-with-Contact-Sheets-montage-of-thumbnails-for-all-JPG-files-in-a-folder-and-each-of-its-subfolders-using-an-automated-batch-method.html)…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question