The SAS Output Delivery System and reporting techniques

PDF Watermark conflict

Accepted Solution Solved
Reply
Trusted Advisor
Posts: 1,213
Accepted Solution

PDF Watermark conflict

Hi,

I'm using ODS PDF to create report with a watermark, per: http://support.sas.com/kb/24/319.html

This has been working for a while, then it broke suddenly.  And after slamming my head against the keyboard for a couple hours last night, it looks like what broke it was the addition of a footnote statement that had in-line formatting!

So here is working code:

proc template;
  define style watermark;
  parent=styles.printer;
  style header from header /
        background=_undef_;
  style body from document /
        background=_undef_
        backgroundimage="D:\junk\clocks.jpg";
end;
run;

ods pdf file="test.pdf" style=watermark; 
footnote1 "I have a simple footnote";
proc report data = sashelp.class nowd;
run;
ods pdf close;

But if I replace the footnote to have one with in-line formatting to add page x of y, the watermark disappears!

ods escapechar='^';
footnote1 "Page ^{thispage} of ^{lastpage}";

Anyone care to replicate the result, and better yet maybe explain why this is happening?

I'm on SAS 9.3, Win XP.

Thanks,

--Q.


Accepted Solutions
Solution
‎12-21-2012 10:06 AM
SAS Super FREQ
Posts: 8,718

Re: PDF Watermark conflict

Hi:

  This is a known interaction:

34573 - Images and URL links might be missing from PDF output when using the LASTPAGE inline functio...

  There are some workarounds listed in the note. You might consider making an RTF file and then doing the creation to PDF from there.

cynthia

View solution in original post


All Replies
Solution
‎12-21-2012 10:06 AM
SAS Super FREQ
Posts: 8,718

Re: PDF Watermark conflict

Hi:

  This is a known interaction:

34573 - Images and URL links might be missing from PDF output when using the LASTPAGE inline functio...

  There are some workarounds listed in the note. You might consider making an RTF file and then doing the creation to PDF from there.

cynthia

Trusted Advisor
Posts: 1,213

Re: PDF Watermark conflict

Thanks so much Cynthia, that's definitely what I'm seeing.

Where were you last night, when I was banging my ahead against the keyboard.:smileygrin:

This morning, I started debugging from scratch with a simpler example, and started commenting out code, thinking "Well, it couldn't be the footnote statement", and there it was....   Which is a lesson it feels like I re-learn every 3 months.  When faced with odd results, debug calmly and methodically....  Last night I had 100 different theories for what could have been wrong (my ods PATH is being reset somewhere, there is a problem with my PROC TEMPLATE code, the .jpg file is corrupted, I should restart the SAS session, etc etc), but was too tired and frustrated to just debug.

--Q.

SAS Super FREQ
Posts: 8,718

Re: PDF Watermark conflict

Hi, Quentin:

  Sorry about the head banging. I've done my share of head banging and of calm debugging and in my opinion, the calm debugging (aided by a search of Tech Support notes on support.sas.com), is the winner in solving problems and also, no bruises on the forehead! ;-)

cynthia

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 653 views
  • 0 likes
  • 2 in conversation