Hi,
I've been working recently with Absolute Layout positioning of boilerplate graphic images mixed with data from Procs, etc. and continue to struggle with sizing boilerplate graphics users want on reports.
What determines the pixels per inch for a given graphic (say .png file)?
I have a png file I tried to display going to a PDF file. The region was 4" tall and 10" wide in a landscape region. While it filled the page width from the original Word document, it was 2-3 inches too short in the PDF file SAS created. The info on the image was 2645x1056 and had a pixels per inch value of 330.
I increased the size of the image and got the 'won't fit in the region' error, so I knocked it down. And kept reducing it and the same thing occurred. I looked at the image info again on the resized image and found it was 1120x447 pixels at 200 pixels per inch. Even at that value it should have had plenty of room but it still gets suppressed.
I didn't set the pixels per inch value so something certainly is doing it for me. Would like it to match whatever the PDF file needs. ?
The code I used was:
ods PDF file="&path.absolute3.pdf" notoc dpi=300;
ods layout absolute y=.25in x=.25in width=10.5in height=8in style={background=yellow};
ods region height=4in width=10.5in style={background=lightblue}; * For cover picture;
ods text = "^{style[preimage='&impath.boilerplate3.png']} ";
ods layout end;
ods pdf close;
The error message I get is:
WARNING: The absolute region was too small to accommodate the output supplied for the PDF destination. Output will be suppressed.
Thanks!
--Ben
Will do. Also posted the generic question to a graphics forum w/o the SAS component.
Thanks!
--Ben
Please report back what you find. That would certainly help many others.
Got a reply from Bari Lawhorn in SAS T.S. She pointed me to the usage note:
http://support.sas.com/kb/46/333.html
SAS' implementation of PDF output requires setting the DPI resolution to 150 for best results. The graph I had been given was 330. After resizing it, as an added bonus the file was a lot smaller as well.
What irks me is that many weeks ago in the first stages of learning this stuff, I had run across this usage note, read it, and tucked it away. In a very safe place. Sigh...
Once the image was resized, it looked great!
--Ben
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.