Solved

Print PDF file from php script to remote computer printer

Posted on 2004-04-29
2
1,288 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 125 total points
Comment Utility
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
Comment Utility
thank you very much, your answer was very helpfull!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

The Adobe PDF proprietary file format is recognized as secure and formulated. But these PDF files are also prone to corruption and any external threat like virus attacks, improper storage can hit PDF file integrity.This type of damages can make cruc…
This article shows how to convert a multi-page PDF file into multiple image files, with one image file created for each page of the PDF. It does this by utilizing an excellent, free software package called GraphicsMagick. The solution is amazingly s…
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 video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now