Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Print PDF file from php script to remote computer printer

Posted on 2004-04-29
2
Medium Priority
?
1,317 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 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
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) …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

715 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