Page 1 of 1
print
Posted: Tue Apr 04, 2006 4:09 am
by jaylin
hi all,
is it possible to print some text, html coded tables, images by php? if yes, plz point me the ways
regards,
Posted: Tue Apr 04, 2006 4:51 am
by patrikG
echo()
printf()
sprintf()
etc.
I suggest you download the manual and read through it.
Posted: Tue Apr 04, 2006 4:53 am
by jaylin
not print of the page. is print out through printer. also, i dun want javascript window.print.

Posted: Tue Apr 04, 2006 4:54 am
by patrikG
jaylin wrote:not print of the page. is print out through printer. also, i dun want javascript window.print.

explain
Posted: Tue Apr 04, 2006 5:13 am
by phpScott
printer is attached to the clients machine, php is running on server, php cannot directly interact with the client's machine, so php cannot interact with the printer.
Sorry but that is the way of the world, you might just be stuck with the javascript option.
Posted: Tue Apr 04, 2006 5:21 am
by onion2k
It's possible to automatically print a page in two ways:
1. Generate a PDF of the content and embed some javascript to automatically print it. Complicated, hassle to update the layout, difficult to do dynamically, requires Acrobat on the client computer, but it will work if the user has JS switched off in their browser.
2. Use an instance of IE's ActiveX browser object and send it the "print without dialogue" command. Complicated again, only works in IE, and will probably stop working when Microsoft's ActiveX update is out in about a month.
All-in-all it's probably not worth doing. Just let the user click thier print button and see the print dialogue.