BookmarkSubscribeRSS Feed
jaxjordan
Fluorite | Level 6

I have a nice looking report that combines several procedures on one page.  The ODS destination is PDF, and includes a small logo (PNG file) in the corner.  I would like to include a map to the report.  The maps have been provided to me in PDF format (the maps show the area in a county for various schools).  I do not have an ability to get these map files in any other format than PDF.

I have not been able to include the PDF file into my reporting process.  Is it possible to use a PDF file as the source in a pre/postimage statement?

My offending code looks like this:

  ods region x=0.00cm y=0.0cm;

  ODS PDF text="^S={preimage='e:\sasdata\SchoolProfile\Maps\033_Lee_HS.pdf?height=5.00cm&width=9.00cm'}";

  ods pdf text =" ";

The error I'm getting is this:

ERROR: Unable to load image e:\sasdata\SchoolProfile\Maps\033_Lee_HS.pdf; default image will be used instead.

Am I barking up the wrong tree trying to include the PDF as an image file?

Thanks,

Brad

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yes.  To my understanding a PDF file contains a lot of extra information that wouldn't be in a Jpeg for instance.  Hence when it is attempted to be loaded as an image it fails.  I would suggest getting the pucture out of your PDF file, some simple ways like Snipping Tool in Windows should do the trick.  Just open the PDF, snip around the picture and save to file.  You can then use that as a picture.

Reeza
Super User

Do you have Adobe Professional? It might be worth it to go outside of SAS for this and append these PDF files into your report rather than take images and lose image quality.

Here's a paper on how to write a VB script called from SAS that will append the files if you need it as part of a process.

http://analytics.ncsu.edu/sesug/2011/BB15.Welch.pdf

jaxjordan
Fluorite | Level 6

I'm working with the customer to get the image files in a "real" image file in place of the current PDFs.

To go into each PDF isn't a good option as there are about 200 schools and the boundaries change from time to time, and I don't want to "own" the process of making images from PDFs, although that is an option.    The process to create the individual school reports as separate PDF pages is currently done in a macro, which just loops through a subset of schools, so getting the maps as images is really the best option....we'll see how that works out since the pdfs are apparently supplied by an outside vendor.

The adobe professional route might work as well, but I'll have to see what the appetite is to buy additional software.  Thank you for the reference article, I'll start running down that option while I wait to see what happens with the individual image files.

Thanks all,

Brad

Reeza
Super User

There are free versions of PDF manipulation programs out there that can also do it, we just get Adobe PDF Professional so I've never bothered to explore it. If you have install privileges you can try them out.

jaxjordan
Fluorite | Level 6

Apparently I can get adobe professional, so I'm going to run down that route.  Thank you again!

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
  • 5 replies
  • 1434 views
  • 3 likes
  • 3 in conversation