473,241 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

Printer function

Hello,

I tried to find out how can I print a document through php. What I want,
is to add a "print button" within a web page (something like the "Print"
button of the explorer, but within the page).
I tried a little bit with the printer_open() function of php but with no
luck. I red the docs, but I couldn't understand which functions are
required to print.

printer_open();
.... what else ???
printer_close();

Thanks a lot!

Fotis.
Jul 17 '05 #1
8 2989

"Fotis Andritsopoulos" <fa*****@telecom.ntua.gr> wrote in message
news:42************@telecom.ntua.gr...
: Hello,
:
: I tried to find out how can I print a document through php. What I want,
: is to add a "print button" within a web page (something like the "Print"
: button of the explorer, but within the page).
: I tried a little bit with the printer_open() function of php but with no
: luck. I red the docs, but I couldn't understand which functions are
: required to print.

P.S. It's nicer to cross-post (a bit like "CC:" in email) to multiple
groups, so that all the replies stay in the same place and nobody flames you
for asking the same question multiple times...

Matt
Jul 17 '05 #2
I noticed that Message-ID: <42************@telecom.ntua.gr> from Fotis
Andritsopoulos contained the following:

I tried to find out how can I print a document through php. What I want,
is to add a "print button" within a web page (something like the "Print"
button of the explorer, but within the page).


What good would it do to print a document from the server? Maybe you
could get the ISP to post it to you... ;-)
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3
Look, I have a client-server application that displays some results
(formed by php) and

1) I want to print these data.
2) I don't want to use the "Print" button of the browser.
3) I don't want to use javascript.

The client and the server own to me (not to the ISP) :)
What good would it do to print a document from the server? Maybe you
could get the ISP to post it to you... ;-)

^^^^^^^^^
Funny ?

Fotis.

Jul 17 '05 #4

"Fotis Andritsopoulos" <fa*****@telecom.ntua.gr> wrote in message
news:cv**********@ulysses.noc.ntua.gr...
: > What good would it do to print a document from the server? Maybe you
: > could get the ISP to post it to you... ;-)
: ^^^^^^^^^
: Funny ?
:
: Fotis.

Well, I for one nearly died laughing!

Matt


Jul 17 '05 #5
Fotis Andritsopoulos wrote:
Look, I have a client-server application that displays some results
(formed by php) and

1) I want to print these data.
2) I don't want to use the "Print" button of the browser.
3) I don't want to use javascript.

The client and the server own to me (not to the ISP) :)


If you're on Linux you could just use system() to send it to lpr or whatever
your preferred print tool is. But what do you intend to use to format the
result into nice pages?
What good would it do to print a document from the server? Maybe you
could get the ISP to post it to you... ;-)

^^^^^^^^^
Funny ?


It was supposed to be, and I laughed. Most people on this newsgroup are
probably thinking that what you're trying to do is broken by design.

--
The email address used to post is a spam pit. Contact me at
http://www.derekfountain.org : <a
href="http://www.derekfountain.org/">Derek Fountain</a>
Jul 17 '05 #6
Fotis Andritsopoulos <fa*****@telecom.ntua.gr> wrote in
news:42************@telecom.ntua.gr:
Hello,

I tried to find out how can I print a document through php. What I want,
is to add a "print button" within a web page (something like the "Print"
button of the explorer, but within the page).
I tried a little bit with the printer_open() function of php but with no
luck. I red the docs, but I couldn't understand which functions are
required to print.

printer_open();
... what else ???
printer_close();

Thanks a lot!

Fotis.


The "printer" family of functions is normally used to write to the local
printer attached to the server running PHP or to a network print device.
If that works for you (ie, the server is physically located at your
facility), then you can use these functions. Keep in mind this will only
work if the server running PHP is a windows machine.

A better solution might be to use a PDF library (http://www.ros.co.nz/pdf).
When you click the "print button" on your page, you'll launch a script that
creates the PDF and displays it in, maybe, a new browser window using
Adobe Acrobat on the client's machine. There are many examples available.
I believe this project has been moved to sourceforge where there are Q&A
forums available.

Jul 17 '05 #7
Fotis Andritsopoulos wrote:
Look, I have a client-server application that displays some results
(formed by php) and

1) I want to print these data.
2) I don't want to use the "Print" button of the browser.
3) I don't want to use javascript.


So you have a problem.

Printing is client side, unless you want to print from your server box (as
already stated by others). PHP is server side. You need a client side
solution. The print button is client side, Javascript is client side. If you
don't want to use them you need to re-invent the wheel.
What good would it do to print a document from the server? Maybe you
could get the ISP to post it to you... ;-)

^^^^^^^^^
Funny ?


In most cases if people give you funny answers they actually try to point
you to something that should be obvious. Try to see the helping aspect in
it, instead of getting angry.

--
Markus
Jul 17 '05 #8
Markus Ernst wrote:
Fotis Andritsopoulos wrote:

Printing is client side, unless you want to print from your server box (as
already stated by others). PHP is server side. You need a client side What I'm thinking is to prepare a php script that connects to the
server's shared printer (php is running on server) and to send the data
to print through printer_open() etc. A possible way I found so far is to
build a .pdf document (through the "pdf capcabilities" of php) in order
to print. Is it possible to send plain text and not a .pdf document ?

Thanks,

Fotis.

What good would it do to print a document from the server? Maybe you
could get the ISP to post it to you... ;-)


^^^^^^^^^
Funny ?

In most cases if people give you funny answers they actually try to point
you to something that should be obvious. Try to see the helping aspect in
it, instead of getting angry.

Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Hank | last post by:
My Access 2000 code has been running for several years in our main plant. Now we need to install it, as a stand-along application, at remote sites, some of which are out of state. My problem is...
6
by: Ioannis Demetriades | last post by:
Hi, I need to change the printer's font to "control" -a printer font, and then send a sequence of characters to the printer. My problem is that I cannot change the printer's font. Can this be...
11
by: pamelafluente | last post by:
I am doing my own PrintDialog, and have placed there a combo with the printer names, as in the PrintDialog provided by VB.NET. Here is the question: how do I open the native windows printer...
4
by: Paul H | last post by:
OK, I tried getting and old Newbury Data ND2500 working using the "Generic /Text only" driver in Win XP. It prints, but I could not find a way to set a custom page size that matches the paper I am...
13
by: Susan Beebe | last post by:
I have downloaded the code described in Microsoft article Q154078. I am trying to send raw ZPL (zebra barcode printer) code from Microsoft access. It works just fine if I hard code the actual...
1
by: sathyp | last post by:
Public Function SetPrinterDefaultsW(ByVal sPrinterName As String, _ ByVal nPaperSize As Long, ByVal nOrientation As Long) As Boolean Dim Prn As Printer Dim hPrinter As Long Dim pd As...
5
by: Raman | last post by:
Hello friends, I want to print an ID card. I have one Windows Form that contains front and back side. The printer is printing both front and back side at a time. I am trying to send both sides...
2
sashi
by: sashi | last post by:
Set default printer You will often find yourself in a position where you have designed a report format for one printer and when that report is sent to another printer the layout is messed up. ...
9
by: id10t error | last post by:
Hello, I am going to be using a Symbol WT4090 to scan items. I need to printer a tag from the Zebra ql320 plus. I am trying to do this is Visual basic 2005. Does anyone know and good site to...
2
by: Flying Kite | last post by:
Hi All, I want to know how to print chinese characters on Zebra Printer, following code working fine with English string, but it's not working for Chinese string. It shows ASCII characters instead...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.