These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Image storage in PDF document?

lm.slater
Registered: Dec 8 2010
Posts: 9
Answered

Ok, I'm relatively new to Acrobat, and I heard this might be possible. I'm trying to create some sort of store or database of images that's saved to the PDF itself, so when someone opens it in reader they can choose from various images and place them within the doc.
 
Is this at all possible?
 
EDIT: I see you can have file attachments, is there a way to be able to insert an image file attachment directly into the PDF in reader? All it seems like you're able to do is strictly open it or save it.

My Product Information:
Acrobat Pro 9.4, Macintosh
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
Yes, it's possible.

The ideal way would to use document-level icons, but there's a silly bug that causes them to get wiped out when you perform a Save As operation, which completely defeats the purpose of having them at all.

The workaround is to set up a series of buttons, normally hidden, to contain the graphics/images/text that you want. I usually keep them on a hidden template page. The icons can be retrieved using the buttonGetIcon JavaScript field method and used to populate a visible button using the buttonSetIcon method. So, the images are stored in the document as button icons of hidden buttons. Set the button layout property to something other than "Label Only" and you should see where you choose an icon source from a file.

To populate the hidden button with the images, you can either create the buttons manually and select the images manually, or you can set up a batch sequence or code somewhere else (e.g., custom toolbar button, JavaScript console) that creates the buttons and sets the icons. It's probably best to do a few manually at first so you can test it out.
lm.slater
Registered: Dec 8 2010
Posts: 9
So I've been looking around at different topics, and I've gotten a few answers pointing to using LiveCycle Designer. I want to make the pdf as streamlined and user friendly as possible, and the image field option looked like my best bet. However, upon importing the pdf, all the JavaScript I programmed into the doc is now lost. Is there a way to retain this?

In order to make this form able to be saved, I know I need to click "extend features in Adobe Reader". Of course, this would need to be done after editing the pdf in LiveCycle. So I'm left with my JavaScript being emptied when I port over to LiveCycle, and opening it back up with Acrobat I've got no form fields I had in there before. I had coded in multiple pre-populate fields that are now gone.

I need some help here :/
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
You have to work in Acrobat or LiveCycle Designer, but not both. LiveCycle Designer uses a completely different scripting model than acroforms, and it does not convert scripts contained in an acroform when it is imported to an XFA form.

Do you need the users to be able to import an image into the document, or just have the images pre-populated in the form for users to select from? If the latter, I would recommend staying with Acrobat.
lm.slater
Registered: Dec 8 2010
Posts: 9
Hmm. They can select images within the document, that's fine. But I would need for the buttons to have a drop-down menu in order to choose different icons. Can I do this? Or is it one icon per button?
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
There are a number of ways you could implement it. Drop-down menus cannot display images, but when a button is clicked you can present a list of image descriptions (e.g., Chevy, Ford, Dodge) and the user could select an item and the image would appear in the button. Or you could set up the buttons containing the images so that they appear when the button is clicked and the user could select one, and then the buttons are hidden again.

How many images are you talking about?
lm.slater
Registered: Dec 8 2010
Posts: 9
About 17.
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
Accepted Answer
OK, that's not too many. You can set up the image buttons so that they are relatively small to appear as thumbnails and the user can select one. The image then gets transferred to another button so it is displayed at a larger size. The thumbnails then get hidden until the next time they're needed.
lm.slater
Registered: Dec 8 2010
Posts: 9
Thanks for all your help and the quick replies. :)
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
BTW, if configured properly (behavior set to "Push"), a button can have up to three icons associated with it. One each for the Up (normal), Rollover, and Down button appearance. This means that you can have a different icon for the thumbnail appearance and retrieve the icon for the Rollover or Down appearance to populate the full size image button. This allows you to have alternate images for a particular item and optimize an image for the thumbnail view (cropped, perhaps) and have up to two alternate images for the full size view.
lm.slater
Registered: Dec 8 2010
Posts: 9
Alright, thanks for the tip.