Solved

Print PDF file from php script to remote computer printer

Posted on 2004-04-29
2
1,296 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
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pdf frustration 2 190
PDF to HTML conversion that looks good on Android Phones 3 139
3d PDF Reader 5 71
Add Background to a PDF Programmatically 1 82
I. Introduction In a previous article (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_6537-PaperPort-Upgrade-How-to-download-and-install-updated-versions-of-PaperPort-11-and-12.html) (now deprecated), I discussed how to upgrad…
In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
Microsoft Office Picture Manager has a Picture Shortcuts pane that shows a list with the Recently Browsed folders. While creating my video Micro Tutorial here at Experts Exchange showing How to Install Microsoft Office Picture Manager in Office 2013…

680 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