BookmarkSubscribeRSS Feed
Christobal
Calcite | Level 5

Hello all,

first of all I would like to say „Hello“ to the community.

I have the following problem: I want to create a PDF which contains our company logo in footnote. Unfortunately SAS doesn’t print the logo but the command.

This is my code:

ods listing close;

goptions target=WINPRTC device=GIF;

options orientation=landscape;

ods pdf notoc file = "D:\DISK_Usage.pdf";

ods escapechar='~';

footnote1 j=left "~S={preimage='D:\Logo_kl.JPG'}";

axis1 order=(0 to 100 by 10)

  color=black

   label=(f='Times New Roman' a=90 'Usage')

;

axis2 value=none label=none;

axis3 label=(f='Times New Roman' "Time")

color=black;

SYMBOL1 v = none I=j ci=red w=5;

SYMBOL2 v = none I=j ci=blue w=5;

Legend1 label=(color=maroon height=2 pct font='Times New Roman' 'Disks')

value=(color=maroon height=1 'C:\' 'D:\')
across=1 down=2
position = (top left inside)
mode=protect
cframe = lightgrey
offset = (3 pct);

proc gplot data=work.disk_output gout=work.gseg2;

plot DISK_Usage_c *time = 1 DISK_Usage_d *time = 2 / vaxis=axis1 vaxis=0 to 100 by 10 haxis=axis3
overlay legend=legend1;
by partition_name date;
title1 f='
Times New Roman' height=5 pct 'Disk-Usage';
title3 f='
Times New Roman' h=3 pct 'Usage of C:\ and D:\ in % for #BYVAL1 on #BYVAL2';
run;

ods pdf close;
ods listing;
quit;


Is it possible that there is a problem with the logo in the footnote in context with “proc gplot”? If I use “proc report” the logo exists in the PDF document.

Thanks in advance for your help.

Best regards

            Christobal

6 REPLIES 6
DanH_sas
SAS Super FREQ

The inline sequence in your FOOTNOTE statement must be processed by ODS instead of GPLOT. To make this happen, specify NOGFOOTNOTE on the ODS PDF statement, and the image should appear on the page.

Hope this helps!

Dan

Christobal
Calcite | Level 5

Hello Dan,

thanks for your reply. Unfortunately I am not able to use the nogfootnote-statement. I get the following error:

5510  ods pdf notoc file = "D:\DISK_Usage.pdf" nogfootnote;

                                               ------------

                                               22         200

FEHLER 22-322: Syntaxfehler, erwartet wird eines der folgenden: ;, ANCHOR, AUTHOR, BACKGROUND, BASE, BODY, BOOKMARK, BOOKMARKGEN,

               BOOKMARKLIST, CLOSE, COLOR, COLUMNS, CONTENTS, DISPLAY, FILE, FONTSCALE, HOST, IMAGE_DPI, KEYWORDS, NAMED_DEST, NEWFILE,

               NOBACKGROUND, NOBOOKMARKGEN, NOBOOKMARKLIST, NOCOLOR, NOCONTENTS, NOPDFNOTE, NOTOC, PCL, PDF, PDFMARK, PDFNOTE, PRINTER,

               PS, SAS, STARTPAGE, STYLE, SUBJECT, TEXT, TITLE, UNIFORM.

FEHLER 200-322: Das Symbol ist nicht bekannt und wird ignoriert.

Do I use the statement in a wrong order or something else? (We are using SAS 9.1)

Best regards

Christobal

DanH_sas
SAS Super FREQ

Unfortunately, since you have 9.1, this will not work for you. The NOGTITLE/NOGFOOTNOTE support was not added to ODS PDF until SAS 9.3. Because the inline formatting is not supported by the graph, you will need to go with another alternative. One solution might be a style solution; the other solution involves annotation. Note that neither of these solutions reserves space for the image; so, if there is a collision with the plot, you will need to move the axis origins.

For the style solution, try inserting the code below into your code and see if it works. This code should position an image in the bottom-left of your graph.

proc template;

define style mylogo;

parent=styles.printer;

style GraphBackground from GraphBackground /

image = "D:\Logo_kl.JPG"

just=left

vjust=bottom

;

end;

run;

ods pdf style=mylogo notoc file = "D:\DISK_Usage.pdf";

/* ... */

ods pdf close;

The annotate solution would require me to know the exact dimensions of your image so that it does not get distorted. Try the style idea first and see if it works.

Help this helps!

Dan

Christobal
Calcite | Level 5

Hello Dan,

thanks for your answer. I suspected that there might be a problem with our SAS version...

So I tried to apply your suggestion with the template. Unfortunately the logo isn't still printed.

Is there a way how I can find out the exact dimensions of my image?

Best regards

Christobal

DanH_sas
SAS Super FREQ

On Windows, you can right-click on the image and view the properties. Also, most image editing software can give you that information.

Christobal
Calcite | Level 5

Hello Dan, the dimensions are the following: 21,5 cm (width) * 15,5 cm (height)

But in the meantime I was able to show the logo with the following template statement:

proc template;

  define style styles.gdis_logo;

  parent=styles.printer;

  style body from document /

        backgroundimage = "D:\Logo_kl.JPG"

        ;

end;

run;

My only problem now is, that the logo appears in the top-left corner, instead of bottom-left... But I think (hope) this is not a big problem.

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!

How to Concatenate Values

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.

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
  • 6 replies
  • 1380 views
  • 0 likes
  • 2 in conversation