Hi All
I'm trying to create a PDF where all except 1st page and pages with T&C's have a heading. It's working for the first page, but not the terms page.
Can anyone see a problem with this?
On my T&C page (end of HTML) I have this
Below is a simplified version my HTML (after XSL transform) that is fed to Prince:
I'm trying to create a PDF where all except 1st page and pages with T&C's have a heading. It's working for the first page, but not the terms page.
Can anyone see a problem with this?
/* Common settings for all pages */
@page {
size: US-Letter;
margin-top: 2.0in;
margin-bottom: 0.7in;
margin-left: 0.5in;
margin-right: 0.5in;
/* insert header HTML at top for all pages unless otherwise specified on specific pages (e.g. first) */
@top {
content: flow(header);
padding-bottom: 5px;
}
/* page numbers on bottom right */
@bottom-right {
content: "Page " counter(page) " of " counter(pages);
}
/* Co name and logo on bottom right */
@bottom-left {
content: flow(footer);
}
}
@page:terms {
margin-top: 0.5in;
/* don't insert header HTML at top of terms page */
@top {
content: normal
}
}
@page:first {
margin-top: 0.5in;
/* don't insert header HTML at top of page 1 */
@top {
content: normal
}
}
/* this will use the named page "terms" where this div occurs */
div.terms {
page:terms;
page-break-before: always;
}
On my T&C page (end of HTML) I have this
<div class="terms">
these are the T and Cs
</div>
Below is a simplified version my HTML (after XSL transform) that is fed to Prince:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Technique Quotation</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta name="date" content="17/10/2011 17:14:58" />
<style type="text/css">
/* Common settings for all pages */
@page {
size: US-Letter;
margin-top: 2.0in;
margin-bottom: 0.7in;
margin-left: 0.5in;
margin-right: 0.5in;
/* insert header HTML at top for all pages unless otherwise specified on specific pages (e.g. first) */
@top {
content: flow(header);
padding-bottom: 5px;
}
/* page numbers on bottom right */
@bottom-right {
content: "Page " counter(page) " of " counter(pages);
border-top-width: 1px; border-top-style: solid; border-top-color: #b1aead; border-collapse: collapse; border-spacing: 0px; width: 100%; font-size: 9pt; padding-top: 1em; margin-top: 10px;
vertical-align: top;
font-family:Arial, Helvetica, sans-serif; font-size: 9pt;
}
/* Co name and logo on bottom right */
@bottom-left {
content: flow(footer);
border-top-width: 1px; border-top-style: solid; border-top-color: #b1aead; border-collapse: collapse; border-spacing: 0px; width: 100%; font-size: 9pt; padding-top: 1em; margin-top: 10px;
vertical-align: top;
font-family:Arial, Helvetica, sans-serif; font-size: 9pt;
}
}
@page:first {
margin-top: 0.5in;
/* don't insert header HTML at top of page 1 */
@top {
content: "FIRST PAGE";
}
}
@page:terms1 {
size: landscape;
@top {
content: "TERMS";
}
}
/* this will force the page where this occurs to be of type "terms" */
#terms1 {
page: terms1;
position: static;
}
/* This takes any div whose id is header out of the normal flow and places it in the header */
#header { flow: static(header); align: left; }
/* This takes any div whose id is footer out of the normal flow and places it in the footer */
#footer { flow: static(footer); align: left; font-size: 9pt;}
.body {font-size: 10pt; margin: 0px; vertical-align:top; font-family: Arial, Helvetica, sans-serif; }
</style>
</head>
<body>
<div id="footer">footer text</div>
<div id="header">
CONTINUATION
</div>
<p style="page-break-after: always;"> First Page Content</p>
<p> Continuation Page Content</p>
<br style="clear:both" />
<div id="terms1">
<table>
<tr>
<td class="terms_ref">1</td>
<td class="terms_text">TERMS PAGE CONTENT. Should be landscape, should not say continuation in header</td>
</tr>
</table>
</div>
</body>
</html>
Edited by mark_anderson_us