Solved

Print PDF file from php script to remote computer printer

Posted on 2004-04-29
2
1,300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Barcode detail gets lost in PDF 3 171
Adobe PDF link to folder 5 81
pdf file 7 100
Cannot Set Default PDF Reader Windows Server 2012 RDS 13 607
In a previously published article (http://www.experts-exchange.com/articles/10331/Automatic-Duplex-Scanning-in-PaperPort-Versions-11-12-14.html) here at Experts Exchange, I explained how to achieve duplex (double-sided) scanning in Nuance's PaperPor…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

738 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