css-paged-media

How to setup counters for target-counters

可紊 提交于 2019-12-07 03:35:54
问题 In paged media, the CSS property target-counters can be used to include multiple counters. The spec gives the following example (simplified): a::after { content: "see section " target-counters(attr(href, url), section, ".") } that should output something like (see section 1.3.5) . How would I set up the section counter? 回答1: From the Generated Content Module (for non-paged content, too): Counters are "self-nesting", in the sense that re-using a counter in a child element automatically creates

CSS paged media :last page selector

落爺英雄遲暮 提交于 2019-12-06 07:32:33
I need to know if I can modify content on the last page with the :last selector. I'm not sure if it exists, I see it being used in other stackoverflow answers like this: Footer on last printed page . But I can't find it in the documentation and it does not work when I try to use it. I'm trying to clear the content on the footer of my last page like this: @page { @bottom-right { content: "Please turn over"; } } @page :last { @bottom-right { content: none; } } It works when I use it with the :first selector. How can I get the effect for the last page? I'm using Weasyprint to print PDF files.

How to setup counters for target-counters

血红的双手。 提交于 2019-12-05 08:35:57
In paged media, the CSS property target-counters can be used to include multiple counters. The spec gives the following example (simplified): a::after { content: "see section " target-counters(attr(href, url), section, ".") } that should output something like (see section 1.3.5) . How would I set up the section counter? From the Generated Content Module (for non-paged content, too): Counters are "self-nesting", in the sense that re-using a counter in a child element automatically creates a new instance of the counter. Therefore, you can just write <style type="text/css"> section {counter

header and footer in each page in print mode with css

空扰寡人 提交于 2019-12-02 20:38:59
I have a web application and it has a report that might exceed one page and I would like to print a header and footer in every page. i find and try this: Repeating a report header in each page but it didn't work for me.I try opera,IE9,Firefox,Google Chrome but ... nothing.page-margin works fine but content is what I want and it doesn't work. Mr. Alien You can set a position: fixed; header and footers so that it will repeat on each page For Example <header class="onlyprint"><!--Content Goes Here--></header> <footer class="onlyprint"><!--Content Goes Here--></footer> @media screen { header

When printing tables in Google Chrome, content overlaps header

旧城冷巷雨未停 提交于 2019-12-01 03:41:59
问题 I'm having problems with Google Chrome when printing a table with HTML code within it. I need to create a document with headers and, to accomplish that, I'm using a table with a thead element, so the browser will replicate it for every page on the printed document. The problem is that the content is overlapping the header when I have page breaks inside the <tr> element. Follows a print with the problem and a gist with the code. iframe { height: 400mm; width: 300mm; page-break-after: always; }

How to do page numbering in header/footer htmls with wkhtmltopdf?

随声附和 提交于 2019-11-28 16:20:09
I'm developing an electronic invoicing system, and one of our features is generating PDFs of the invoices, and mailing them. We have multiple templates for invoices, and will create more later, so we decided to use HTML templates, generate HTML document, and then convert it to PDF. But we're facing a problem with wkhtmltopdf, that as far as I know (I've been Googleing for days to find the solution) we cannot simply both use HTML as header/footer, and show page numbers in them. In a bug report (or such) ( http://code.google.com/p/wkhtmltopdf/issues/detail?id=140 ) I read that with JavaScript it

Creating page headers and footers using CSS for print

天涯浪子 提交于 2019-11-27 17:20:19
I'm creating a PDF using Flying Saucer (which dumps out CSS/HTML to iText to a PDF) and I'm trying to use CSS3 to apply an image header and footer to each page. I'd essentially like to put this div in the top left of each page: <div id="pageHeader"> <img src="..." width="250" height="25"/> </div> My CSS looks somewhat like this: @page { size: 8.5in 11in; margin: 0.5in; @top-left { content: "Hello"; } } Is there a way for me to put this div in the content ? Putting an element to the top of each page: @page { @top-center { content: element(pageHeader); } } #pageHeader{ position: running

How to do page numbering in header/footer htmls with wkhtmltopdf?

两盒软妹~` 提交于 2019-11-27 09:40:43
问题 I'm developing an electronic invoicing system, and one of our features is generating PDFs of the invoices, and mailing them. We have multiple templates for invoices, and will create more later, so we decided to use HTML templates, generate HTML document, and then convert it to PDF. But we're facing a problem with wkhtmltopdf, that as far as I know (I've been Googleing for days to find the solution) we cannot simply both use HTML as header/footer, and show page numbers in them. In a bug report

Creating page headers and footers using CSS for print

你离开我真会死。 提交于 2019-11-26 17:58:14
问题 I'm creating a PDF using Flying Saucer (which dumps out CSS/HTML to iText to a PDF) and I'm trying to use CSS3 to apply an image header and footer to each page. I'd essentially like to put this div in the top left of each page: <div id="pageHeader"> <img src="..." width="250" height="25"/> </div> My CSS looks somewhat like this: @page { size: 8.5in 11in; margin: 0.5in; @top-left { content: "Hello"; } } Is there a way for me to put this div in the content ? 回答1: Putting an element to the top

Browser Support for CSS Page Numbers

十年热恋 提交于 2019-11-26 16:09:48
So I am aware of this option: Page numbers with CSS/HTML . It seems by far to be the best way to add page numbers to a print version of a page, but I can't get any variation of this to work anywhere. I have tried on my Windows 7 machine in Chrome, Firefox, and IE9. Based on some of the links it looks like this may be supported in more proprietary software like Prince XML. Is this supported by web browsers for print versions? I have tried making just a blank html file and in the head adding this between two style tags: @page { @bottom-right { content: counter(page) " of " counter(pages); } } I