Snooble Posted May 5, 2010 Share Posted May 5, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/ Share on other sites More sharing options...
MadTechie Posted May 5, 2010 Share Posted May 5, 2010 if you don't want to change the size then yo don't want to change the DPI but the PPI instead. Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1053495 Share on other sites More sharing options...
Snooble Posted May 5, 2010 Author Share Posted May 5, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1053497 Share on other sites More sharing options...
litebearer Posted May 5, 2010 Share Posted May 5, 2010 I presume from you rtitle you are ultimately seeking to actually print these images. If so this artile may help you on your path to a solution... http://www.dpiphoto.eu/dpi.htm Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1053499 Share on other sites More sharing options...
Snooble Posted May 5, 2010 Author Share Posted May 5, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1053505 Share on other sites More sharing options...
Snooble Posted May 5, 2010 Author Share Posted May 5, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1053553 Share on other sites More sharing options...
litebearer Posted May 5, 2010 Share Posted May 5, 2010 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... Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1053665 Share on other sites More sharing options...
Snooble Posted May 29, 2010 Author Share Posted May 29, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1065030 Share on other sites More sharing options...
Snooble Posted May 30, 2010 Author Share Posted May 30, 2010 Bump bump bump.. pleeeeeease help! Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1065336 Share on other sites More sharing options...
bspace Posted May 30, 2010 Share Posted May 30, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1065490 Share on other sites More sharing options...
Snooble Posted May 31, 2010 Author Share Posted May 31, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1065633 Share on other sites More sharing options...
Snooble Posted June 3, 2010 Author Share Posted June 3, 2010 Bump bump bump.. pleeeeeease help! Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1067392 Share on other sites More sharing options...
Snooble Posted June 6, 2010 Author Share Posted June 6, 2010 help help help? Quote Link to comment https://forums.phpfreaks.com/topic/200772-php-writes-html-file-for-printing-help/#findComment-1068747 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.