The SAS Output Delivery System and reporting techniques

ODS PDF escapechar and 'extra' spaces

Reply
New Contributor
Posts: 2

ODS PDF escapechar and 'extra' spaces

[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!

SAS Super FREQ
Posts: 8,641

Re: ODS PDF escapechar and 'extra' spaces

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
Post a Question
Discussion Stats
  • 1 reply
  • 358 views
  • 0 likes
  • 2 in conversation