BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello,
I have the following problems, i need to import big png and also, i want to define the new dimension of the picture to include it in a RTF
How can i do ?
What's the simpliest way to do that ?
I would not have hard coding because it's in a macro program
Thank you for your help and let's go france for the world cup 🙂
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:

What do you mean by "import"?? Where do you envision the "import" happening?? SAS has a couple of different graphics editors, however, they are both interactive editors and, as far as I know, cannot be used from within a program. I suppose you could try to replay your image into a different size using GREPLAY, but that seems like an iffy proposition when so many other tools are more suited to resizing.

If SAS/GRAPH created the PNG, then I would suggest that you recreate the graph using the original program code and by changing the code to use the dimensions you want.

If SAS/GRAPH did not create the PNG file, then using a 3rd party graphics editor (such as PhotoShop, PaintShop Pro or even Windows Paint) are probably better tools for resizing images.

How is your RTF file being created? Let's say that you are using ODS to create an RTF file and you want an externally created PNG file to use as a logo -- I would then:
1) resize the image to the size needed using an external 3rd party graphics editor
2) use the PREIMAGE style attribute to insert the logo into the ODS RTF file --when the RTF file is being created --

If, on the other hand, you have an -existing- RTF file and you want to insert an image into an existing RTF file, then this is a different task that most likely will involve post-processing the RTF file with a program (because ODS cannot append or "insert" into an existing RTF file).

I understand that you do not want to have hard-coding (such as for the PNG name???), however, the process of editing the PNG image to be a different size is most likely going to be a manual process and about the only thing you're going to be able to do is macro-ize the image name for use in the PREIMAGE style attribute (either in a style template or in PROC REPORT, PRINT or TABULATE syntax).

cynthia
deleted_user
Not applicable
Thank you very much for your complete answer
samdickson
Fluorite | Level 6

I just saw this question after posting a similar one and wanted to post a link to my solution in case someone else has a similar question. The solution is here.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 1481 views
  • 0 likes
  • 3 in conversation