Re: [css-d] Footer on odd pages only

2010-12-23 Thread Tim White
On Wed, Dec 22, 2010 at 2:02 AM, david gn...@hawaii.rr.com wrote:
 David Hucklesby wrote:

 On 12/20/10 3:40 PM, Evan Panagiotopoulos wrote:

 I create a string of html documents using php. Each document prints
 one sheet of paper. I would like to have the documents that form the
 odd sheets to have a footer where the even documents to have none.


What you need are the @page rules; unfortunately they aren't support
by most browsers.
http://www.w3.org/TR/CSS21/page.html

They have provisions for :left and :right pages, which do work in
Opera. I haven't found any way to generate content using them yet
though. Anyone know a) if that's possible b) the state of @page
development?

Tim
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Footer on odd pages only

2010-12-22 Thread Mark Richards
On Mon, Dec 20, 2010 at 18:40, Evan Panagiotopoulos epana...@gmail.comwrote:

 I create a string of html documents using php. Each document prints one
 sheet of paper.

[snip]

 If I use: div id=print-footer Using id=... to call the css and I only
 get the footer properly placed on the first page only. The rest of the
 pages
 do not have a footer.

 If I use div class=print-footer Using class=... to call the css I get
 the footer text placed under the end of the content on each page. Somehow
 it does not appear as a footer.


How is your HTML organized? If it's one html file per physical page, the use
of ID vs CLASS for css shouldn't matter (make sure if you use class you're
adjusting your selector).  If you're using one html file for all the odd
pages you might try position:fixed for the footer. A fixed box will appear
on each printed page. If all the pages are in a single file, I'm not aware
of any syntax that can suppress the footer only for even pages but then I've
never practised printing HTML. As others have suggested you might want to
try generating a pdf instead.

Mark
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Footer on odd pages only

2010-12-22 Thread Tim Arnold
On Wed, Dec 22, 2010 at 9:31 AM, Mark Richards m...@date.net wrote:

 On Mon, Dec 20, 2010 at 18:40, Evan Panagiotopoulos epana...@gmail.com
 wrote:

  I create a string of html documents using php. Each document prints one
  sheet of paper.
 
 [snip]

  If I use: div id=print-footer Using id=... to call the css and I only
  get the footer properly placed on the first page only. The rest of the
  pages
  do not have a footer.
 
  If I use div class=print-footer Using class=... to call the css I get
  the footer text placed under the end of the content on each page.
 Somehow
  it does not appear as a footer.
 



I think your solution is in the PHP and not the CSS.  You need the PHP to
only add the footer div to odd pages.  PHP can count (what you define as)
pages, but CSS cannot.  You could add a class to odd pages in which case CSS
could be used to show or hide based on the presence of that class, but
honestly, once you've done the logic to add the class, you might as well
just be adding the entire div in question instead.  Regardless, what you
determine to be a single page will definitely not be a single page on every
printer.  You'll likely get reports of people getting that footer in very
odd places.

As soon as you start thinking printing, you should probably move to PDF.
Unless you have the requisite amount of self loathing to tackle
PHP+HTML+CSS+The Universe of Printers. I'd recommend that route.

-Tim

-- 
-
tim.arn...@gmail.com
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Footer on odd pages only

2010-12-22 Thread Evan Panagiotopoulos
Thank you for the suggestions. I tried many variations of the html
file. I tried creating one huge file and many, smaller in size, html
files contained in one physical file. I will look closer into PDF,
though. In terms of ID-ing each page, I tried that too since I create
the html using php. I have a variable that counts the pages and I
built the ID incorporating the counter variable. For now I am
enclosing the data that needs to be in the page with the footer with a

div class=print_report style=height:auto; min-height:240px;

That way as the data changes the fake footer will be in the same
position. I realize that this is not as nice as the css soution but it
works.

Evan

On Wed, Dec 22, 2010 at 9:31 AM, Mark Richards m...@date.net wrote:
 On Mon, Dec 20, 2010 at 18:40, Evan Panagiotopoulos epana...@gmail.com
 wrote:

 I create a string of html documents using php. Each document prints one
 sheet of paper.

 [snip]

 If I use: div id=print-footer Using id=... to call the css and I only
 get the footer properly placed on the first page only. The rest of the
 pages
 do not have a footer.

 If I use div class=print-footer Using class=... to call the css I get
 the footer text placed under the end of the content on each page.
 Somehow
 it does not appear as a footer.


 How is your HTML organized? If it's one html file per physical page, the use
 of ID vs CLASS for css shouldn't matter (make sure if you use class you're
 adjusting your selector).  If you're using one html file for all the odd
 pages you might try position:fixed for the footer. A fixed box will appear
 on each printed page. If all the pages are in a single file, I'm not aware
 of any syntax that can suppress the footer only for even pages but then I've
 never practised printing HTML. As others have suggested you might want to
 try generating a pdf instead.

 Mark





-- 
Evan Panagiotopoulos
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Footer on odd pages only

2010-12-21 Thread David Hucklesby

On 12/20/10 3:40 PM, Evan Panagiotopoulos wrote:

I create a string of html documents using php. Each document prints
one sheet of paper. I would like to have the documents that form the
odd sheets to have a footer where the even documents to have none.

[...]

How do you do that? Unless you are designing for an Intranet with all
paper sizes, printers, and browser print settings the same, I don't
think that can be done, can it?

A PDF might be the answer-- but not always.

(Speaking as one who is having a terrible time printing off my U.K.
passport application (A4) in California (US letter size.) :(
)

Cordially,
David
--
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Footer on odd pages only

2010-12-21 Thread david

David Hucklesby wrote:

On 12/20/10 3:40 PM, Evan Panagiotopoulos wrote:

I create a string of html documents using php. Each document prints
one sheet of paper. I would like to have the documents that form the
odd sheets to have a footer where the even documents to have none.

[...]

How do you do that? Unless you are designing for an Intranet with all
paper sizes, printers, and browser print settings the same, I don't
think that can be done, can it?

A PDF might be the answer-- but not always.


Hmm, if your content was XML, you could use XSL-FO to automatically 
transform it into a formatted PDF. That might still suffer from size 
discrepancies between your page size and the visitor's page size, though.


--
David
gn...@hawaii.rr.com
authenticity, honesty, community
__
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/