Jump to content

PHP writes HTML file for printing - HELP!


Snooble

Recommended Posts

Hi everyone,

 

This is bugging me a lot, and the more I read about it the less I seem to grasp the premise.

 

I have a PHP script that loops and outputs a huge html file full of individual tables with backgrounds. My problem lies in the background; it's only 72dpi quality. When I increase the dpi (to 600) using photoshop the image expands to over 2000pixels wide and I only get the top left hand corner of the image in each table.

 

So, question:

 

How can I increase 72DPI to 600DPI in a table background image, in a html file, without increasing width/length (745px*348px).

 

Hope it makes sense guys! I'm lost!

 

Thanks in advance

 

Snooble

Link to comment
https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/
Share on other sites

I thought DPI was Dots per Inch and it's what Printers use to define quality of image? PPI is pixels per inch?

 

How can I make this 745px*348px image print at 600dpi on my printer? Using Photoshop/Dreamweaver/Any software.

 

The physical ratio size of the print is 19.2cm:745px if that helps in any way?

 

Sorry, and thanks for answering!

 

Snooble

Yes thanks. After playing around with the printer I learnt that 745px stretches across an A4 page when printing with firefox. it's fixing the blurryness of

the 72DPI image that I can't do.

 

I'll read the link again now. (read it before asking here)

 

Any other advice?

 

Thanks

 

Snooble

Ok, After re-reading that artical. I now know that my image has too few pixels to print at 19.2cm (W):

 

· divide pixels by inches, is the outcome < 600, you have to add pixels (resamplen)

 

745 / ~8 = 93dpi.

 

Now my problem lies in increasing the amount of pixels in the image (resizing and resampling on photoshop) without it affecting the ACTUAL html size of the image.

 

How can I go about increasing the PPI whilst retaining it as the background to my table.

 

Thank you in advance.

 

Snooble

 

I know it can be VERY confusing. I use corel photopaint (have versions 7 & 9) when I use ver 9 it does the same thing - increase dpi = increase size. YET with version 7 - increase dpi = no change in size.

 

I have a sample of the two diff dpi's (done in ver 7) as well as their print previews here...

 

http://nstoia.com/demo/demo_two/dpi.html

 

Try save image1 and image two and test them in your script - see what happens

 

N...

 

 

  • 4 weeks later...

Thanks for your response! Sorry it's taken so long for mine!

 

litebearer! You're completely right! BUT : Your image shows up in photoshop as:

 

3.15cm x 1.47cm at 600dpi.

 

The end physical size should be 9.2cm x 19.7cm (H x W) at 600dpi. But when I do that, pixel size increases to: 4654px x 2174px.

 

Which then crops to the top left corner in my html table.

 

I had success shrinking the 4654px x 2174px image by itself to 745px x 348px using dreamweaver width and height functions, and it prints PERFECT at 600dpi! BUT I CANT FIND A WAY TO DOWNSCALE A TABLE BACKGROUND IMAGE? Ahhhhhh.. driving me insane.

 

Please help!

 

Snooble

 

TLDR : Downscale an image so it fits as a table bg and doesn't get cropped? 4654px x 2174px to 745px x 348px.

 

you can't scale a background image with current html/css

the image is always displayed at 72dpi

 

however, you could go about it another way

 

wrap your table in a containing table and fill this table with your image

(or similar with divs)

if your dealing with fixed size tables/divs just make your image oversize (x8 to print at approx 576dpi)

and specify the appropriate width/height in the image tag, or css

You know exactly what I want.. thank goodness.

 

I've been playing with div's but cant get the right combination. My code already consists of a containing table. Where do i put the div tag, and where do i put the size attributes? You'd be a lifesaver here! Honestly!

 

Thanks

 

Snooble

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.