BookmarkSubscribeRSS Feed
rab24
Calcite | Level 5
I was putting a logo image at the top of each page of a PDF output prior to an upgrade to EG4.3. I used the a title statement and preimage to get the image in, but it has recently stopped appearing with ods pdf output. The html output continues to show the image and I can use ods pdf text to make the image appear in PDF, but for some reason placing the following title statement will not produce the image (no errors or warnings) in the PDF:

title "^S={just=center preimage='/data/header.png'} ";

I would be open to just switching to a ods pdf text= statement, but the output is a simple tabular report that extends more than one page and the image needs to be on the top of each page.

I'm not sure how long it took for me to notice that the image was no longer appearing, but we recently upgraded to EG4.3. Looking at an older project that successfully used this code, I can not determine any changes to the title line that would effect the image. Any assistance would be appreciated.
7 REPLIES 7
Cynthia_sas
SAS Super FREQ
Hi:
ODS PDF has to know the location of the image when the file is created. ODS HTML has to know the location of the image when the output is loaded into the browser.

The fact that the image works in HTML indicates to me that the -relative- location '/data/header.png" is accurate for the location of the image in the browser, but incorrect for the location of the image for ODS PDF wheh the PDF file is created.

For example, in a browser (HTML), the relative path might still work even if the higher level path changed between versions. But in PDF, there is a huge difference between these 2 locations:

//usr/images/data/header.png
//usr/sas/images/data/header.png

So while, "/data/header.png" might work for HTML, it may not work for PDF if the folder structure changed on the server. If the relative path worked for you in earlier versions of SAS with both ODS PDF and ODS HTML, is it possible that something changed with the higher folder names for PDF??

Generally, both RTF and PDF are happier with fully qualified path names for image locations. If you find the fully qualified path name on the server and use it with ODS PDF, does your title statement logo work again???

Otherwise, you might want to work with Tech Support on this issue.

cynthia
rab24
Calcite | Level 5
The path actually works in pdf when I used an "ods pdf text=" statement instead of a title statement. That solution just wouldn't work for me.

Failing to find this issue through various searches, I decided to rebuild my pdf from scratch until I found the offending code in a footnote statement.

I placed "^{Thispage} of ^{LastPage}" for the page 1 of 3 information. I had the ^{Thispage} code for some time and recently decided to add ^{Lastpage} as well. Apparently, there is some conflict between ^{Lastpage} in a footnote and an image in a Title statements. As soon as I removed ^{Lastpage} the image returned as expected.
Cynthia_sas
SAS Super FREQ
Ah, yes. Glad you found it! Without seeing your code, it didn't occur to me to ask whether you were using {thispage} and {lastpage}.

cynthia
smeyerch
Calcite | Level 5
Hi Cynthia,

I'm running SAS Foundation 9.2 (TS2M3) on Windows and the problem seems to have come back: There is no way to display a .jpg in the title AND the {lastpage} in the footnote.
Funny: It worked on our last SAS Release 9.1.3


I've read your answers in other threads and the SAS-Notes you referred to such as

- PAGEOF information can cause errors in ODS PRINTER:
http://support.sas.com/kb/15/541.html

- Use of LASTPAGE inline function causes images to disappear
http://support.sas.com/kb/34/573.html


I had my .jpg converted to 150 DPI, same Heigth and Width. The output looks pretty similar in both versions - except I have to choose either the logo in 'title' or the {lastpage} in 'footnote'.

Are there new findings concerning thus? I hope I don't have to use ods layout?
Cynthia_sas
SAS Super FREQ
Hi:
When a Tech Support note has been resolved (such as the ones above), there will be a version number in the "Fixed" column at the bottom of the note. That's how you know whether the note is still active or not.

There was an older technique for putting Page X of Y page numbers on a PDF document. It involved creating a PostScript file, with a page number "placeholder", then you needed to run a SAS program to find the total number of pages and then go back and replace the "placeholder" with Page X of Y. After the program ran, you had a modifed PostScript file - -which you had to manually convert to PDF using Adobe Distiller or some other 3rd party tool. As I recall, the process did have a macro that someone contributed. What I don't remember is whether it ever worked with an image in the PostScript file. The macro program can be found here:
http://support.sas.com/rnd/base/ods/odsprinter/ -- scroll down to the section on the page that says "Archive: SAS 8.2 ODS PRINTER Family".

My recommendation, before you go down this road is to work with Tech Support to see whether ODS LAYOUT will even work with a logo on each page and Page X of Y page numbers. You may discover that it is not as challenging as you anticipate. While you're working with Tech Support, they may have someone who remembers the old "pageof" macro program and can verify whether or not that method will work with an image in the PS file. Alternately, you might create your file with the image on every page but without any page numbers and then open the file with an Adobe or 3rd party product to insert Page X of Y page numbers using Adobe technology.

cynthia
smeyerch
Calcite | Level 5
Hi Cinthia

Thank you for your answer and the link to the macro program. It is tempting to use it as the entry fee into the ods layout world seems to be pretty high anyway. I have difficulties finding information about it in the SAS9.2 ODS User's Guide. But I guess I'll just have to look a bit further.
Thanks again and have a good weekend.
Cynthia_sas
SAS Super FREQ
Hi:
You'll find papers written by developers here:
http://support.sas.com/rnd/base/early-access/index.html

and there's a bit on ODS LAYOUT in this paper:
http://www2.sas.com/proceedings/sugi31/092-31.pdf

If you search for user-group papers on the topic, you should find a few more.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 2391 views
  • 0 likes
  • 3 in conversation