Hi everyone,
Here's the scenario. I have a scanned image of a letter size form and I'm writing a PHP script that fills in this form. My problem is this, I scanned the image in at 300 dpi and saved it as a PNG file. I've finished the programming to fill in the form and display the filled in form. My problem now is printing the form. The image is 2892 x 2358 (H x W) which should print out as 9.64" x 7.86" however I'm unable to get Windows or any of the browsers i've tried (IE 6, IE 7, Firefox, Opera) to print it out properly. I think they all assume the image is 72dpi and attempt to print it out as such, resulting in an oversized printout.
I'm stuck. Any ideas?
How to print an image at a certain resolution
Moderator: General Moderators
- novice4eva
- Forum Contributor
- Posts: 327
- Joined: Thu Mar 29, 2007 3:48 am
- Location: Nepal
Re: How to print an image at a certain resolution
you might want to check out image manipulation functions provided by PHP. Here is where you can start, i think there is example there giving the right solution too
http://www.php.net/imagecopyresampled
http://www.php.net/imagecopyresampled
Re: How to print an image at a certain resolution
novice4eva is wrong. You don't need to resize the image itself. You need to set the print resolution, which is different to the image resolution. As far as I know that can't be done in PHP or in HTML or Javascript. The only solution I know works is to embed the image in a PDF file using a library like FPDF.
- novice4eva
- Forum Contributor
- Posts: 327
- Joined: Thu Mar 29, 2007 3:48 am
- Location: Nepal
Re: How to print an image at a certain resolution
OUCH!! hurts to be wrong, sorry.... 