Jump to content

Recommended Posts

Hi Guys, Not been PHPing too long, but am doing ok, so maybe a noob question, maybe not....

 

I have been playing with the printer_ functions and have managed to print the word "test" to my local printer... great means installed ok etc etc.

 

However am struggling to find some of it useful.... i.e. the commands "seem" to be a little weak, but am probably missing something.

 

So for instance, can I create a normal page that has just been delivered to the screen, to automatically print to a printer? I have been playing with a barcode.php package which prints barcodes to the screen (3 of 9 for interest) without problem. However it prints as a JPG, just fine, but how do I get this to the printer?

 

I.e. how can I do the same as I would in Iexplorer when I do <alt> print!

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/85832-using-the-printer_-functions/
Share on other sites

I haven't used the printer functions, but looking at the manual, I only see support for BMPs. If your barcode.php is using the GD functions, you should be able to change it to output a BMP instead of a JPEG (just use the BMP function instead of the JPEG function).

 

http://php.oregonstate.edu/manual/en/function.printer-draw-bmp.php

http://php.oregonstate.edu/manual/en/function.imagewbmp.php

Hi thanks for the response. I had already had a look at the Image commands from the php manual, but the only one I found is WBMP, which is the wireless standard. Not sure what the different is, but it doesnt seem to work.

 

The code I am using normally changes the header to

header ("Content-type: image/jpeg");

and therefore changed to various including :-

header ("Content-type: image/vnd.wap.wbmp");

which didnt seem to work.

 

It would be nice to answer this, but the question is generally larger, i.e. is there a way to take the current displayed html (php generated) screen and print it all to a printer, then I could get around a number of problems.

Once again, thanks for any other replies.....

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.