The SAS Output Delivery System and reporting techniques

image justification in PDF output.

Not applicable
Posts: 0

image justification in PDF output.

Dear SAS experts,

Is it possible to justify an appearance of an image in pdf document.

For example :

ods pdf file="c:\file.pdf" style=D3d;
ods escapechar="^";

proc print data=sashelp.class ;

ods _all_ close;

But the Picture still appears on a centre of the pdf page. Is it possible to justify it to the right position of the document.

Thank you in advance.
Posts: 9,371

Re: image justification in PDF output.

Posted in reply to deleted_user
I think that the problem is that your preimage is putting the image into the boundary of the table and the whole table is centered by default. The table is not the same as the document -- only something in a TITLE statement or an ODS PDF TEXT = statement would go into the top of bottom of the document.

You can use preimage in a title statement like this:
options nodate nonumber;
ods pdf file='c:\temp\imgtitle.pdf';

title1 'title1 -- image will be underneath title1';
title2 j=r '^S={preimage="c:\temp\kermit.jpg"} ';
ods escapechar='^';
proc print data=sashelp.class;
ods _all_ close;

BTW, when using images for the preimage tag, I use a Paint program to make sure my image is the size I want BEFORE I use it in the preimage attribute. This is because PDF and RTF destinations convert the image to an internal format and I have always had better results if the image is the right size beforehand.

I don't generally use D3D style with PDF because D3D colors the whole background gray and I don't like the way it looks. I prefer SASWEB or the default PDF style (PRINTER style) with PDF. Just my preference.

Good luck,
SAS Employee
Posts: 50

Re: image justification in PDF output.

Posted in reply to Cynthia_sas
I concur with Cynthia and found only using ods text statements or title statements was I able to justify an image.

I looked into modifying proc template like this:

proc template;
define style needpreimage;
style table from table /
pretext='This is pretext for the table. ';

but the preimage field only takes a file name or URL.

Not applicable
Posts: 0

Re: image justification in PDF output.

Posted in reply to deleted_user
Dear Scott and Cynthia,
thanks a lot for your help Smiley Happy
I did not know that there is a possibility to attache an image in the TITLE statement.

best regards.
Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation