BookmarkSubscribeRSS Feed
phallrik
Calcite | Level 5

[Apologies for the cross-posting, I posted this to the wrong community yesterday]

I'm using ODS PDF Text to create some standard reports. When I put a change in style in the middle of a text line (e.g. to italicize a word), extra spaces are inserted in front of the italicized word. After some experimentation, I found that this only happens when the text line is reasonably long (I didn't do enough experimentation to determine the exact length of text that would invoke the problem. For example:

The following works correctly:

pdf text="^S={font_face=calibri font_size=11pt }regular^S={font_face=calibri font_size=11pt font_style=italic} italic^S={font_face=calibri font_size=11pt} regular.";

It produces:      regular italic regular

But when the text line is long:

pdf text="^S={font_face=calibri font_size=11pt }Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua ipsum dolor sit amet, consectetur adipiscing elit^S={font_face=calibri font_size=11pt font_style=italic} italic^S={font_face=calibri font_size=11pt} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua ipsum dolor sit amet, consectetur adipiscing elit.";

It produces:      Lorem ipsum etc.   italic Lorem ipsum etc.       [note there are two extra spaces in front of the word "italic"]

I have tried breaking the long text line up into multiple lines in the editor, and I've tried assigning all of the various pieces to macro variables so that the "pdf text" line looks like: pdf text="&reg&pt1&itl&pt2&reg&pt3"but the result is the same (extra blank spaces).

I would like to think that I've looked everywhere for a solution... but I'm sure I've missed something. Anybody have any clues?

thanks!

1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi: The syntax you are using is the older syntax. Are you still running SAS 8 or SAS 9.1?? If so then you will have to use the older syntax. But if you are at SAS 9.2 or higher, you could use the newer STYLE override syntax. But for specific usage questions like this, you are probably better served by opening a track with Tech Support.

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!

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
  • 1 reply
  • 1326 views
  • 0 likes
  • 2 in conversation