The SAS Output Delivery System and reporting techniques

image justification in PDF output.

Reply
N/A
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 ;
style(table)={preimage="c:\image.jpg^justify=r^scale^x=2in"};
run;

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.
SAS Super FREQ
Posts: 8,862

Re: image justification in PDF output.

Posted in reply to deleted_user
Hi!
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:
[pre]
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;
run;
ods _all_ close;
title;
[/pre]

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,
cynthia
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;
parent=styles.printer;
style table from table /
preimage=''
pretext='This is pretext for the table. ';
end;
run;

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

Scott
N/A
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.

Thanks,
best regards.
Sarunas
Ask a Question
Discussion stats
  • 3 replies
  • 170 views
  • 0 likes
  • 3 in conversation