• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Acrobat form field that allows Reader user to browse and insert a picture into a predefined area

Enthusiast ,
Sep 26, 2012 Sep 26, 2012

Copy link to clipboard

Copied

Is there a way to do insert a form field into an AcroForm that allow Reader users to browse and insert a picture into that form field?

I know that LiveCycle can do this, but I need to do this using an AcroForm. Or maybe there's a third-party plug-in that can be used in an AcroForm to do this?

TOPICS
PDF forms

Views

77.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
LEGEND ,
Oct 01, 2012 Oct 01, 2012

Copy link to clipboard

Copied

No, you don't need Acrobat 11 to create a form that uses this method, but your Reader users will need to upgrade. I don't see that they've announce the release date for Reader yet, but in the past it has usually been within about a month of the announcement.

View solution in original post

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 21, 2014 Jan 21, 2014

Copy link to clipboard

Copied

Not directly using just Acrobat. When I need to retrieve content of a button icon, I use the FDF Toolkit to save a button appearance as a PDF, and convert the PDF to an image. For images in buttons, you can do this manually in Acrobat by flattening the form and exporting the images, or a number of similar ways.

On second thought, there may be a way via JavaScript. I'll have to do a few tests...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 21, 2014 Jan 21, 2014

Copy link to clipboard

Copied

Oh...question.

Can I use this to allow a tablet user to take a picture and insert it into the form as a response?  If not, is there a way to do that? (assuming they upgrade their reader?)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 21, 2014 Jan 21, 2014

Copy link to clipboard

Copied

The buttonImportIcon method does work with Readdle's PDF Expert on iOS, which is currently the best PDF viewer on iOS for forms/JavaScript/multimedia PDFs. It doesn't not work with Adobe Reader on iOS/Android. I don't know if it works with any other PDF viewers on Android.

With PDF Expert, the user can choose to take a picture with the camera or select a previously stored image.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 27, 2014 Feb 27, 2014

Copy link to clipboard

Copied

George, I use EzyPDF for android and this works great, it allows you to take photo's and draw a square on your doc which inserts the photo, obviously this android reader supports this function, I assume therefore this function is available but not in acrobat reader, unless there is a javascript work around.

Mike

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2014 Feb 27, 2014

Copy link to clipboard

Copied

Mike,

The buttonImportIcon method that has been discussed here is not available with Adobe Reader for mobile devices.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2014 Feb 04, 2014

Copy link to clipboard

Copied

Hi George,

I have a pdf with a bunch of form fields and a button to allow users to add a photo to the pdf.  I'm using

event.target.buttonImportIcon(); in the icon button javascript.  I also have a submit button that when clicked submits certain form fields from the pdf form to an aspx page (html http post) where I then read those values back and fill a template pdf (based on the original) and fill those values back in.  In the original pdf I selected the icon value to be submitted on the submit click but it doesn't appear that the image value is being passed to the page.  Is there a way to make this work?  I assumed it would when the submit button allowed me to click the icon button value to pass.  I just need to pass this image value to my page and populate that image on the template pdf copy.

Any assistance would be appreciated. If it's not possible, you mentioned the FDF toolkit, what is that and would it work for what I'm trying to do?  Oh, and I'm trying to do this in acroforms not livecycle.

Thanks!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 04, 2014 Feb 04, 2014

Copy link to clipboard

Copied

The image data is not included if you choose to submit as HTML or XFDF. If you use FDF, the FDF Toolkit allows you so save any button appearances that are present as a PDF. Unfortunately, even though the FDF Toolkit is still available for free from Adobe, it has not been updated for some time. You might want to look into what the third-party FDFToolkit .NET has to offer.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 09, 2014 Feb 09, 2014

Copy link to clipboard

Copied

Hi George,

I've been going through this entire thread, but can't seem to get it to work. Just like the initial question stated, I'd like the user to click a button to insert an image (with Reader!). I created a Mouse Up event with the script:

event.target.buttonImportIcon();

It works just fine in Acrobat Pro 11, but when clicking on it in Reader, it just "flickers" quickly, but there is no option to insert anything...

I know that you mentioned to have the users upgrade, but I'm not sure that applies to this? Please tell me what I'm doing wrong..!

Thanks a bunch!

/ John

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 09, 2014 Feb 09, 2014

Copy link to clipboard

Copied

Not all JavaScript that is available to Acrobat is available to Reader. "buttonIImportIcon" is one such method. The 'X' in the last column idicates this is not avaiable to Reader.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 09, 2014 Feb 09, 2014

Copy link to clipboard

Copied

The documentation is wrong on that one. buttonImportIcon will work in Reader, but only Reader XI, and it will only allow you to select a PDF file to import as the button's icon.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 09, 2014 Feb 09, 2014

Copy link to clipboard

Copied

What version of Reader did you test with?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 10, 2014 Feb 10, 2014

Copy link to clipboard

Copied

Thanks for your help guys!

Reader XI does the trick (I first tried with X) and I assume all three of you are already pushing Adobe to re-install the feature to upload also other formats than .pdf, correct? 😉

In your experience, what would you inform users that are supposed to fill in my excellent form..?

1 Upgrade to latest version of Reader, including a link where they can upgrade

+2 Convert your pics to .pdf (which WILL be an issue for most users!) before uploading

The option, as I see it, is to have the users send me their pics and I can upload them myself with Pro. Or do you have any smoother solutions to suggest?

Oh yes, one more thing: when uploading the Icon, my text "INSERT IMAGE" is still visible on top of the pic. I think George, you described in this thread how to blank out/remove that text once the pic is uploaded..? Is there an easy way of achieving this?

Many thanks again for this prompt help!

Message was edited by: lambertcollection

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 24, 2014 Feb 24, 2014

Copy link to clipboard

Copied

Hi George,

I have been playing around with the Icon and was wondering if it is possible to apply a condition to the statement. example IF , Else IF.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 24, 2014 Feb 24, 2014

Copy link to clipboard

Copied

James,

You can use an if statement in JavaScript, but it's not clear to me what you want to do. If you provide more information, I'll try to help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 24, 2014 Feb 24, 2014

Copy link to clipboard

Copied

George,

I want an image to appear if a field equals something.

I think this is how it might look. 

var oBlankIcon = getField("BLANK_ICON").buttonGetIcon({nFace: 0});

var A1 = getField(“Average”).value;

if (A1 = “N/A”) event.value = getField("IMAGE").buttonSetIcon({oIcon: oBlankIcon, nFace: 0});

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 24, 2014 Feb 24, 2014

Copy link to clipboard

Copied

You'd normally just use the display property ot show/hide a button to show/hide the image, something like:

// Show/Hide a button based on a field value

var f = getField("IMAGE");

if (getField("Average").valueAsString === "N/A") {

    f.display = display.hidden;

} else {

    f.display = display.visible;

}

But this code may have to be adjusted depending on when you want it to be triggered.

It could also be simplified to the equivalent:

getField("IMAGE").display = getField("Average").valueAsString === "N/A" ? display.hidden : display.visible;

Post again if this isn't what you want.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 24, 2014 Feb 24, 2014

Copy link to clipboard

Copied

George,

This is what I was looking for.

Thank you.

I have been playing around with the code and it seems to be hanging up.

I can make the image appear but once it is hidden it will not reappear.

Ideas?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 24, 2014 Feb 24, 2014

Copy link to clipboard

Copied

If you post the exact code you're using and include where you placed it so I know how it's getting triggered, I'll try to help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 25, 2014 Feb 25, 2014

Copy link to clipboard

Copied

Hi George,

The following is the code I am using in the active button.

// Show/Hide a button based on a field value

var f = getField("IMAGE");

var T= getField("Mold Type").value;

if (T === "100 X 200 Plastic") {

f.display = display.visible;

} else {

f.display = display. hidden;

}

The buttion Properties are

General: visable

Options: Behavior = Push, Icon and lable = Up

Actions: Select Trigger = Mouse Up, Selection = Run A JavaScript

My hope is to have the appear or hide based on a selection. I seam to be

going in circles trying to solve the problem on my own.

If you could point me in the right direction I would apreciate the

assistance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 07, 2015 Oct 07, 2015

Copy link to clipboard

Copied

I picked up the code to create a button to import a graphic - it works beautifully! However, I have another button that I use to "lock" the content on a form after it has been filled in:

var f = this.getField("Part1");

var a = f.getArray();

for (var i=0; i<a.length; i++) {

    a.readonly = true;

}

This, however, does not lock the logo button. Is there a way to do that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 07, 2015 Oct 07, 2015

Copy link to clipboard

Copied

It should work if the name of the button begins with "Part1.", such as "Part1.logo". But the script could be simplified to just:

// Set all Part1 fields to read-only

getField("Part1").readonly = true;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 07, 2015 Oct 07, 2015

Copy link to clipboard

Copied

Thank you!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 08, 2014 Jun 08, 2014

Copy link to clipboard

Copied

A very interesting discussion. But I got lost half way.

I also want users to be able to upload a pofile picture (in my case a company logo). It can be in PDF (but preferably other fomats as well).

What javascript code or settings do I need to set then behind the button? That's not clear for me now.

Can someone please help? I would also like to tell the user (by for example a label text or something) that they can only upload PDF and the maximum dimensions.

I am not a programmer, I just want to insert the script and settings in the button label.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 10, 2017 May 10, 2017

Copy link to clipboard

Copied

Hello,

I am creating a template for users and they need to add a photo. My question is this:

Is there a way, maybe with javascript, to force the imported picture (or button icon) to "fit to bounds" but to fit specifically to the horizontal scale? In other words, currently if a user adds a photo, with "fit to bounds" checked, it will fit the photo into the button space in order to show the entire picture. This can leave some white space on the sides of the photo. I want it to fit the picture only to the horizontal size, even if that means some of the image gets cropped out on the top or bottom.

Hope that makes sense. I have not been able to find a way to do this yet.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 10, 2017 May 10, 2017

Copy link to clipboard

Copied

Not possible.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines