Dan
These are the options that used earlier when creating the png files. I believe you are correct, and I was using listing previously. Code:
%let gpath='G:\Data\Papers\Plots\';
%let dpi=350;
ods listing style=htmlblue image_dpi=&dpi gpath=&gpath;
I have alos attached the result of the PNG file and title doesn't wrap and it centered on the graph.
How do I get this with the pdf vector output?
This looks like some sort of font issue on your system. The title is not breaking due to the legend. If you notice, the title is breaking in the same place as the image I posted, but the FONT is compressed. In fact, ALL of the text in the plot looks compressed in the original PDF you posted. Let's try another experiment: on the ODS PDF statement, set STYLE=HTMLENCORE. This style uses a different font face.
By any chance do you have OPTIONS NOFONTEMBEDDING set anywhere?
I agree that the results are very different when using the OUTPUTFMT=PNG vs not using when creating the pdf.
I am not sure of how to check the OPTIONS NOFONTEMBEDDING. I know that it's not in my program. I ran a proc options, and a proc goptions and checked for that text string in the log and didn't find it so I don't think that it is set.
I have a copy of the file after using the style option in the ods pdf statement.
I agree that it appears that the text is compressed in the pdf vector file. This is the first time that I have explicitly requested used the vector format in a pdf file. From searches I believe that all of the pdf's that I have created in the past were vector files and I didn't know it.
Each ODS destination uses a default format for its output. You can use the OUTPUTFMT= option in the ODS GRAPHICS statement to change the output format.
If you want to generate vector graphics images, you can use the following OUTPUTFMT= values for each destination:
ODS Destination |
OUTPUTFMT=value |
---|---|
ODS EPUB |
OUTPUTFMT=SVG |
ODS destination for Excel |
OUTPUTFMT=EMF |
ODS HTML |
OUTPUTFMT=SVG |
ODS LISTING |
OUTPUTFMT=EMF OUTPUTFMT=PDF OUTPUTFMT=PS | EPS | EPSI OUTPUTFMT=SVG OUTPUTFMT=PCL |
ODS PDF |
Vector graphics images are generated by default |
I discussed this font behavior with some other colleagues. One suggested setting the SASPRTC graph driver might clear this up. Please add this line to the beginning of your program and see if it helps:
goptions device=SASPRTC;
Please let me know if that helps.
Dan
I teach until 5:30 CST but I run this and post after class.
John
Dan
I decided to shut down SAS and reboot the machine this morning and start over. Yesterday I had multiple ods statements to multiple output files. I only ran them once, noticed the problem and really tried to get a vector pdf. This morning I only ran the ods statements in the code that I posted after the reboot. It works. I am assuming that I needed to clear all of the ods statements that I had ran previously. I have listed the ods statements below:
%let dpi=350;
ods listing style=htmlblue image_dpi=&dpi gpath=&gpath;
ods html image_dpi=350;
ods rtf image_dpi=350 file="G:\Data\Papers\Plots\rates2.rtf";
ods graphics on/ reset=all border=off width=4;
ods listing sge=on;
It was my understanding that there shouldn't be a problem with sending output to multiple files at the same time so I didn't worry about the other ods statements.
In the ods graphics I selected reset=all. Is there a similar ods statement that will close all ods output, rtf, html, sge?
Thank you for your time on this topic.
I will typically have an ods pdf and ods rtf statement active with output. I had added the ods sge to this code to look at the interactive editor. First time that I had looked at that.
What file type would you recommend when creating vector graphics?
The journal specifically asked for pdf so I'm using pdf.
ods _all_ close;
...will close all of your open ODS destinations.
I am considering this to be solved by:
1. Closing SAS to clear everything.
2. Restarting and only running the necessary ods statements.
I don't think that I needed to reboot. I had to do that, University IT staff asked everyone to do that last night.
I think the extra ods statements caused the problem.
Multiple ODS statements should have been fine. Did you close them all at the end of your program? Use "ods _all_ close;" to do that without having to close each destination separately.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.