...

View Full Version : Printing Background Image CSS



zro@rtv
02-28-2005, 10:51 AM
i have print media css page.

in it i have specified a bg image for a certain div.
I wish it to repeat all the way down the side of the div.
but i cannot seem to make background images print.
even when set thru the print media css sheet.

html
http://www.redtv.org/lpa/archives/calendar/2005mar

print media css
http://LansingPA.org/lpa/calprint.css


awesome thanks.
(havent seent his yet ehere the fix is actually css, and also havent seen where people are printing repeating graphics (i know this seems bad (grphic printing)... but it is for design purposes))

ronaldb66
02-28-2005, 11:29 AM
Printer settings are usually such to not print background colors and images to save ink/toner; since this is a printer setting, it can't be influenced by CSS.

If it is desperately necessary to have to images printed, include them as content; otherwise, you have to ask yourself whether a print design of a web page really is useless without background images. Anyway: it's up to the visitor to decide to spend their ink/toner on them.

zro@rtv
02-28-2005, 11:34 AM
well thats horrible.
I see this is a user pref.
I was hoping there was a way to overide.

welll,...on adding them as content.....
there's probably no way to achieve the same desired effect as
with bg repeat-y.
....that is to say. no way to loop content so that the image repeats all the way down the div.


(btw, on my reasons for doing this...
i am usiung my CMS to create print flyer designs,
and do not want to trouble users with setting user prefs, but want all the desired design elements to print.)


thanks for help.... great.

rmedek
02-28-2005, 12:01 PM
(btw, on my reasons for doing this...
i am usiung my CMS to create print flyer designs,
and do not want to trouble users with setting user prefs, but want all the desired design elements to print.)
Well, as Ronald says, if the images are necessary you should include them as content. As the pages in question are flyer designs, I'd have the CMS output <img> tags rather than bg images, and then the print settings would work just fine.

I'm sure there is some scripting solution for having the images tile... if there isn't you are using a CMS so you could have the serverside processing contol the tiling, maybe...

ronaldb66
02-28-2005, 12:59 PM
Or, maybe a web page isn't the best output format anyway; would it be feasible to generate a pdf?

zro@rtv
02-28-2005, 05:54 PM
ill have to look into automated dynamic creation of pdfs from the data base. thats a bit over my head at the current time.

in the mean time...
feel free to tell me how dirty my code is, and give suggestions for inprovement...

http://lansingpa.org

ronaldb66
03-01-2005, 09:22 AM
thats a bit over my head at the current time. Yeah, same here... :o I'll see if I can dig something up.

About your code: it doesn't look too bad, only a little undirected; there are lots of divs in there, and in places like the calendar I saw some inefficient use of classes. Again, I would need to go over it some more; I'll get back to you.

zro@rtv
03-01-2005, 10:30 AM
AWESOME!
any review/ help would be GREATLY appreciated.

...im sorta new, and am just sorta diving right in, so ....im sure yall know how it is.

ronaldb66
03-01-2005, 02:10 PM
I did a little Googling on "generating pdf" and "generate pdf with php" and I get the general impression that it is very feasible to generate pdfs; there seem to be a number of ways, tools, techniques, etc; you'll have to decide for yourself which way suits you best.

On the coding issue: there are a whole lot of divs in there that could just as well be replaced by more appropriate elements, and I saw a fair number of blockquotes of which I couldn't really tell what they were used for.
Try to keep a logical document structure in mind which would work even when serialised without any styling.
Also, every single cell in the calendar table gets:

<span class="calendar">...</span> What do you need the spans for? A td or th can be styled just fine.
Same goes for:

<caption class="calendarhead"> There's only one caption that is a descendant from this table; in both cases, giving the table an id (say, "calendar" ;) ) would make styling the caption as well as all the ths and tds a cinch through selectors like "#calendar caption", "#calendar th" and "#calendar td". If you do need some tds styled differently, rather add classes to the exceptions.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum