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
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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.