BookmarkSubscribeRSS Feed
brulard
Pyrite | Level 9

hi,

i'm having difficulty aligning the text and the image in a banner for a pdf report. Issue: the text is printing at the bottom of the banner.

 

i've attached example image of the current look of the banner. Perhaps I am going at this wrong, and it is not possible for text and image to be printed on same row? Pls let me know your thoughts/suggestions, thank you.

 

sample code:

 

ods pdf file="C:\Users\sxxxxxx\temp\FstName1Char.pdf" dpi=300 notoc ;
ods escapechar='~';

ods noproctitle;

TITLE1 /*j=l '~{style[preimage="C:\Users\sxxxxxx\Desktop\IMAGES_ENCOUR\download2.png" background=red] }' */
j=l "~{style[font_size=16pt background=red color=white verticalalign=TOP ] &title}"
j=r '~{style[background=red preimage="C:\Users\sxxxxxx\Desktop\IMAGES_ENCOUR\1\output-onlinepngtools.png"] }'
;
TITLE2 "~{style[font_size=10pt] Monthly report for: &dbmonth" };
TITLE3 "&quad2" ;

4 REPLIES 4
ballardw
Super User

How big is your image file? If the size is such that it occupies an entire line where would you expect the remaining text to go?

 

Can't download ZIP files from unknown sources to see your example.

brulard
Pyrite | Level 9

hi, the image is about an inch wide / high.

ballardw
Super User

@brulard wrote:

hi, the image is about an inch wide / high.


The image I see in the DOCX file is much closer to 6 inches wide. Perhaps you need to go back to that image file and verify how many pixels wide it is and compare to your document 300 dpi setting or include a width setting with the style options for the image

brulard
Pyrite | Level 9

Thanks... Using ODS layout, I've updated my code and can now print a clear image. Note some of the options below may be superfluous as I'm still studying/practicing these functions. here is the code in case it can help anyone:

 

ods pdf file="C:\Users\sxxxxxx\temp\FstName1Char2.pdf" dpi=300 style=styles.noborder notoc ;

ods escapechar='~';

 

ODS Layout  start width=100% height=11 in;

ODS REGION x=76.80534pct y=0cm width=5cm height=3.7cm ;

ODS PDF text='~{style[background=red vjust=m preimage="C:\Users\sxxxxxx\Desktop\IMAGES_ENCOUR\1\001-1b.png"  ] }';

ODS REGION x=0cm y=0cm width=76.80534pct height=3.325cm style=[backgroundcolor=red ] ;

ODS PDF text="~{style[font_size=16pt background=red color=white just=l  ] &title}";

ods layout end;

ods pdf close;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1153 views
  • 1 like
  • 2 in conversation