BookmarkSubscribeRSS Feed
BenConner
Pyrite | Level 9

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

 

 

4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
ODS LAYOUT is fairly new and questions like this are probably better handled by Tech Support. If they don't know the answer, they can involve the ODS LAYOUT developer.

From my understanding the challenge with PDF output is that you have an image (like a logo) or a graph (created with ODS) and BOTH of those images will get converted to an internal PDF image format. So beyond your sizing for the PNG file, there is some additional translation involved in getting all the images embedded in the PDF document.

How that works is a mystery to me, but since you have a fairly specific ODS LAYOUT question, this seems to me the type of question best suited to Tech Support where they can look at all your code and all your images and help you come to a resolution.

cynthia
BenConner
Pyrite | Level 9

Will do.  Also posted the generic question to a graphics forum w/o the SAS component.

 

Thanks!

 

--Ben

PGStats
Opal | Level 21

Please report back what you find. That would certainly help many others.

PG
BenConner
Pyrite | Level 9

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

 

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