BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
AndersS
Lapis Lazuli | Level 10

Hi! I have used PROC SGPLOT to produce some nice graphs.

In the title statement I used  "Albany AMT"  - a tips from SAS written in the Log. Looks REALLY nice!

 

Then I download this as a flat file   "mygraph.svg" and include it in standard MsWord  (Office 365).

BUT now  it does not look equally nice.

It turns out that Word does NOT support Albany AMT. Instead it uses Arial (Arial MSFontService).
The file mygraph.svg is a textfile, which can be viewed.

 

MY QUESTION: What Font shall I use in PROC SGPLOT in SAS Studio, so a file mygraph.svg is produced,

which then looks nice and good in MsWord on the PC?

The importance is the look in MsWord (not that it lokks nice in SAS Studio).


(A little like a problem of "merging two files with allowed fonts". Only those obs that are in both files are accepted.)

MANY THANKS in for any response!

/Br Anders

p.s.  %SGANNO macros are great!

Anders Sköllermo (Skollermo in English)
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
Could you use PNG file ?
If you worried about display of picture, You could try dpi= and image_dpi= options:

ods listing gpath='c:\temp\' image_dpi=300;
ods graphics /imagename='want' outputfmt=png;
ods rtf file='c:\temp\want.rtf' dpi=300 ;
proc sgplot ;
...............
run;
ods rtf close;

View solution in original post

12 REPLIES 12
JosvanderVelden
SAS Super FREQ
What happens if you use "options nofontembedding;" when creating the svg. Does that solve the font issue?
AndersS
Lapis Lazuli | Level 10

Hi!

"options nofontembedding;"    does NOT solve the problem with the font.

The svg-file comnatins the name of the font - and that font is not available on MsWord.

BUT - "Nice try"   - a VERY GODD Idea. Many thanks.   /Br Anders

Anders Sköllermo (Skollermo in English)
Ksharp
Super User
Could you use PNG file ?
If you worried about display of picture, You could try dpi= and image_dpi= options:

ods listing gpath='c:\temp\' image_dpi=300;
ods graphics /imagename='want' outputfmt=png;
ods rtf file='c:\temp\want.rtf' dpi=300 ;
proc sgplot ;
...............
run;
ods rtf close;

AndersS
Lapis Lazuli | Level 10

Hi! I tested BOTH RTF  and PNG.  The code below produces both.  
In Word I think that RTF is better.
data work.test;
xval=1; yval=2; output;
xval=3; yval=6; output;  run;

Title1 "RTF_PNG "  height=2 font="Albany AMT";
ods rtf file='/home/anders.skollermo/RTF_PNG.rtf' dpi=300 ;

ODS LISTING GPATH= "/home/anders.skollermo" image_dpi=300;

ODS GRAPHICS / ANTIALIASMAX= 20000 LINEPATTERNOBSMAX= 20000 height= 480px
width= 640px outputfmt= PNG imagename= "RTF_PNG";

proc sgplot data= work.test NOautolegend;
    series x= Xval y= Yval;
run;

ODS RTF CLOSE;

Anders Sköllermo (Skollermo in English)
AndersS
Lapis Lazuli | Level 10

MANY THANKS!     Fast and VERY GOOD answer. /Br Anders

Anders Sköllermo (Skollermo in English)
DanH_sas
SAS Super FREQ

Just so you know, there is an ODS WORD destination as well. It might be worth a try as well.

DanH_sas
SAS Super FREQ

ODS WORD supports both PNG and SVG output. The ODS style used also favors fonts typically used in Word.

AndersS
Lapis Lazuli | Level 10

Hi!
ODS WORD is preproduction now in SAS Studio. I just tested it.

But, I will remember this.

NO I did not know about ODS WORD.  "Mea culpa".

/Br Anders

Anders Sköllermo (Skollermo in English)
DanH_sas
SAS Super FREQ

What version of SAS are you running?

AndersS
Lapis Lazuli | Level 10
SAS on demand for academics - I do not know.
Anders Sköllermo (Skollermo in English)
DanH_sas
SAS Super FREQ

Please run this command from the editor and post the value from the log:

%put &sysvlong;

Thanks!

AndersS
Lapis Lazuli | Level 10

Hi! The log in SAS Studio:

69 %put &sysvlong;
9.04.01M7P080620
Sorry for the late answer!  I have been away for some days.
 
I have used ODS RTF;   and outputfmt= PNG 
I get a file  named.rtf that I download to my PC.  Opened i Word. Cut and paste into document.
Works fine.
If you have any idea about how to get nice graphics from SAS Studio into PC Word,
please tell me. I will try it and report here.
MANY THANKS! / Br Anders
Anders Sköllermo (Skollermo in English)

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
  • 12 replies
  • 2054 views
  • 3 likes
  • 4 in conversation