When writing to a PDF with a modified style, a gap occurs in the horizontal line over the footer.
There is no gap if the footer is only on the left, or the center, or the right, or the left and the right.
If the footer has a left, center, and right component or a left and center component there is a gap in the horizontal line 1/3 of the way across the page.
If the footer has a center and right component there are two gaps in the line, at about 1/3 and 2/3.
These gaps do not occur if one writes to an RTF instead
The code which modifies the journal2 template to include a horizontal line and all the combinations of footer components is included below.
Does anyone know if one can modify the template further to avoid the horizontal line gaps?
Thank you.
proc template;
define style styles.gap;
parent=styles.journal2;
STYLE SystemFooter/
outputwidth=100%
bordertopcolor=black
bordertopwidth=1pt
font_face="Arial";
end;
run;
title1
justify=left "topLeft"
justify =center "topCenter"
justify=right "topRight"
;
data one;
a=1;output;
run;
footnote
justify=left "bottomLeft"
;
ods pdf file="left.pdf" style=gap;
proc print data=one;
run;
ods pdf close;
footnote
justify=center "bottomCenter"
;
ods pdf file="center.pdf" style=gap;
proc print data=one;
run;
ods pdf close;
footnote
justify=right "bottomRight"
;
ods pdf file="right.pdf" style=gap;
proc print data=one;
run;
ods pdf close;
footnote
justify=left "bottomLeft"
justify=right "bottomRight"
;
ods pdf file="leftright.pdf" style=gap;
proc print data=one;
run;
ods pdf close;
footnote
justify=left "bottomLeft"
justify=center "bottomCenter"
;
ods pdf file="leftcenter.pdf" style=gap;
proc print data=one;
run;
ods pdf close;
footnote
justify=center "bottomCenter"
justify=right "bottomRight"
;
ods pdf file="centerright.pdf" style=gap;
proc print data=one;
run;
ods pdf close;
footnote
justify=left "bottomLeft"
justify=center "bottomCenter"
justify=right "bottomRight"
;
ods pdf file="leftcenterright.pdf" style=gap;
proc print data=one;
run;
ods pdf close;
Something try, based on other ODS bits that do similar, is to add a BORDERLEFTWIDTH=0 and BORDERRIGHTWIDTH=0.
Sometimes that gap appears because the code creating the ODS output is creating multiple "cells" in a table even though you don't see them and the order seems to draw the vertical (invisible) borders over the horizontal. Setting explicit widths of 0 for the borders sometimes addresses that.
ballaw is right . Here is a workaround way :
proc template;
define style styles.gap;
parent=styles.journal2;
STYLE SystemFooter/
outputwidth=100%
borderbottomcolor=black
borderbottomwidth=1pt
font_face="Arial";
STYLE SystemFooter2/
outputwidth=100%
bordertopwidth=0pt
font_face="Arial";
end;
run;
title1
justify=left "topLeft"
justify =center "topCenter"
justify=right "topRight"
;
data one;
a=1;output;
run;
footnote ' ';
footnote2
justify=center "bottomCenter"
justify=right "bottomRight"
;
ods pdf file="c:\temp\centerright.pdf" style=gap;
proc print data=one;
run;
ods pdf close;
Here is what I heard back from SAS
This is in regards to your PDF issue in 7613539516.
This is a known issue with the PDF destination. It happens with the Title too. I would suggest writing a blank Footnote that is just a horizontal border line and use the Journal2 style on the ODS PDF statement. I have included sample code and the resulting output.
Example:
footnote1 '^S={outputwidth=100% borderbottomcolor=black borderbottomwidth=1pt} ';
footnote2
justify=left "bottomLeft"
justify=center "bottomCenter"
justify=right "bottomRight"
;
Both solutions work. Thanks for the input.
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.