BookmarkSubscribeRSS Feed
DonMacnaughton
Obsidian | Level 7

I’m using SAS ODS graphics to generate EMF vector graphs for embedding in a Word document (a statistics textbook). I import the graphs into Word by copying the EMF graphs from a SAS-generated RTF document into my working document.

Ultimately, the Word document will be converted into a PDF document for publication. The easiest way to do that is to use the “save as PDF” function in Word. But if I use the Word “save as PDF” function to generate a PDF document from my Word document then, curiously, the fitted lines on graphs in the PDF document are always much too thin, much thinner than when they are rendered in raw SAS output or rendered in Word.

I can correct this problem by specifying a greater thickness for the fitted lines, perhaps ten times the default thickness. But doing that creates a secondary problem. That is, the SAS graph-generating routines sometimes make unnecessary adjustments to the graphs to correct for what they may think are very thick lines. And the adjustments decrease the quality of the graphs (by causing OFFSETMAX and OFFSETMIN to be too large on some graphs).

I’ve attached a sample program to illustrate the thickness and OFFSET problems.

Can you suggest how to get around these problems? That is, is there some way that I get vector-based graphs from SAS in a PDF file out of Word with fitted lines of proper thickness and without the OFFSET problems?

Thanks for your help,

Don Macnaughton

2 REPLIES 2
DanH_sas
SAS Super FREQ

Try using the ODS LISTING destination to generate the standalone EMF files and embed them into your Word document. The some information might be getting lost in the extra "hop" through the clipboard.

ods _all_ close;

ods listing;

ods graphics / imagefmt=emf;

/* Your code */

DonMacnaughton
Obsidian | Level 7

Dan,


Thank you.  That's a good idea.  Unfortunately, if I insert the ODS LISTING graphs from the EMF files in a Word document and then convert the document to PDF, the same problems recur.


That is, the thickness of the fitted line is quite different if you compare the Word document with the PDF document created by the Word PDF writer.  And the OFFSETMAX and OFFSETMIN are inappropriately adjusted on a graph if I make the fitted line thick enough to render properly in a PDF file created by the Word PDF writer. And in the version of the document created by the Adobe PDF writer add-in in Word all the text is missing.


The adjustments SAS makes to OFFSETMAX and OFFSETMIN make the graphs look somewhat amateurish because space on the graphs is being wasted.


I've attached the SAS program I used to perform the test.


Don Macnaughton

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