Formatting of Footers for PDF Output
Posted: Tue Oct 15, 2019 4:21 am
Hi,
I'm trying to create CSS to generate our corporate-standard footers for PDF output. I've been able to get the individual elements that we need, but some of the formatting is not yet correct. The CSS code that I'm using currently is at the end of this message. The problems in the output are as follows:
• The center text wraps, although there is a lot of unused space to either side that should make it possible to fit on one line.
• The border line appears about a quarter inch above the footer text, instead of being right above the text.
Regarding the center text, I see at https://www.oxygenxml.com/doc/versions/ ... hl=headers there is a suggestion to move the center text into the left or right box. The effect is not good when I try it. There are three problems: (1) I can't figure out how to make the text appear centered, (2) we need the center text to have a different color and font weight than the left and right elements, and (3) if I move the center text into the right box, then the text in the left box starts to wrap.
I attach screenshots of the current output (Bad Footer.png) and the desired output, as produced using Microsoft Word (Good Footer.png). I'm not sure if I'm hitting some absolute limits to what is possible in CSS and/or Oxygen. Any suggestions would be appreciated. Thanks!
@page {
@bottom-center {
content: "Confidential - Proprietary Information - For Use By Authorized Company Clients Only. Do Not Distribute.";
font-family: "Arial Narrow", arial, helvetica, sans-serif;
font-size: 8pt;
color: grey;
height: 10pt;
overflow-x: visible;
border-top: 1px solid black;
}
}
@page :left {
@bottom-left {
content: "Page " counter(page) " of " counter(pages);
font-family: "Arial Narrow", arial, helvetica, sans-serif;
font-size: 8pt;
font-weight: bold;
border-top: 1px solid black;
}
@bottom-right {
content:oxy_xpath("format-date(current-date(), '[M01]/[D01]/[Y0001]')");
font-family: "Arial Narrow", arial, helvetica, sans-serif;
font-size: 8pt;
font-weight: bold;
border-top: 1px solid black;
}
}
@page :right {
@bottom-left {
content:oxy_xpath("format-date(current-date(), '[M01]/[D01]/[Y0001]')");
font-family: "Arial Narrow", arial, helvetica, sans-serif;
font-size: 8pt;
font-weight: bold;
border-top: 1px solid black;
}
@bottom-right {
content: "Page " counter(page) " of " counter(pages);
font-family: "Arial Narrow", arial, helvetica, sans-serif;
font-size: 8pt;
font-weight: bold;
border-top: 1px solid black;
}
}
I'm trying to create CSS to generate our corporate-standard footers for PDF output. I've been able to get the individual elements that we need, but some of the formatting is not yet correct. The CSS code that I'm using currently is at the end of this message. The problems in the output are as follows:
• The center text wraps, although there is a lot of unused space to either side that should make it possible to fit on one line.
• The border line appears about a quarter inch above the footer text, instead of being right above the text.
Regarding the center text, I see at https://www.oxygenxml.com/doc/versions/ ... hl=headers there is a suggestion to move the center text into the left or right box. The effect is not good when I try it. There are three problems: (1) I can't figure out how to make the text appear centered, (2) we need the center text to have a different color and font weight than the left and right elements, and (3) if I move the center text into the right box, then the text in the left box starts to wrap.
I attach screenshots of the current output (Bad Footer.png) and the desired output, as produced using Microsoft Word (Good Footer.png). I'm not sure if I'm hitting some absolute limits to what is possible in CSS and/or Oxygen. Any suggestions would be appreciated. Thanks!
@page {
@bottom-center {
content: "Confidential - Proprietary Information - For Use By Authorized Company Clients Only. Do Not Distribute.";
font-family: "Arial Narrow", arial, helvetica, sans-serif;
font-size: 8pt;
color: grey;
height: 10pt;
overflow-x: visible;
border-top: 1px solid black;
}
}
@page :left {
@bottom-left {
content: "Page " counter(page) " of " counter(pages);
font-family: "Arial Narrow", arial, helvetica, sans-serif;
font-size: 8pt;
font-weight: bold;
border-top: 1px solid black;
}
@bottom-right {
content:oxy_xpath("format-date(current-date(), '[M01]/[D01]/[Y0001]')");
font-family: "Arial Narrow", arial, helvetica, sans-serif;
font-size: 8pt;
font-weight: bold;
border-top: 1px solid black;
}
}
@page :right {
@bottom-left {
content:oxy_xpath("format-date(current-date(), '[M01]/[D01]/[Y0001]')");
font-family: "Arial Narrow", arial, helvetica, sans-serif;
font-size: 8pt;
font-weight: bold;
border-top: 1px solid black;
}
@bottom-right {
content: "Page " counter(page) " of " counter(pages);
font-family: "Arial Narrow", arial, helvetica, sans-serif;
font-size: 8pt;
font-weight: bold;
border-top: 1px solid black;
}
}