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

Why an image field shows a button properties page and not working like image in LiveCycle Designer

Community Beginner ,
Dec 15, 2021 Dec 15, 2021

Copy link to clipboard

Copied

When I use Acrobat Pro DC to add an image field, the property page shows it is a button and not working like the image field in LiveCycle Designer which can load the image files dynamically.

 

Image filed.JPG

TOPICS
Create PDFs , Edit and convert PDFs , PDF forms

Views

2.5K

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
Community Expert ,
Dec 15, 2021 Dec 15, 2021

Copy link to clipboard

Copied

Exit the form edit mode and click on the button.

 

Info: Acrobat and Designer creates different form types.

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
Community Expert ,
Dec 15, 2021 Dec 15, 2021

Copy link to clipboard

Copied

Exit the form edit mode and click on the button.

 

Info: Acrobat and Designer creates different form types.

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 ,
Dec 15, 2021 Dec 15, 2021

Copy link to clipboard

Copied

Thanks for the info. Is there a way to fill the image field dynamically via the .net codes?

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 ,
Dec 15, 2021 Dec 15, 2021

Copy link to clipboard

Copied

Acrobat uses Javascript. Look at the Action of the image field.

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 ,
Dec 15, 2021 Dec 15, 2021

Copy link to clipboard

Copied

Thanks. Any sample codes for example?

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 ,
Dec 15, 2021 Dec 15, 2021

Copy link to clipboard

Copied

We have a local image directory to keep different logo images with the user's ID as the image names. We want to load the logo based on the user who is using the form dynamically. Can AcroFom do that?

 

Thanks in advance.

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 ,
Dec 15, 2021 Dec 15, 2021

Copy link to clipboard

Copied

Yes, but you would have to install a script on the local computer of each user for it to work.

And of course you will have to know the full-path of the image files in advance.

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 ,
Dec 17, 2021 Dec 17, 2021

Copy link to clipboard

Copied

Great, any sample codes please.

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 ,
Apr 17, 2024 Apr 17, 2024

Copy link to clipboard

Copied

Hi, I wrote the script and get it working on Adobe Pro DC but it is not working on Reader DC. do you know why?

 

thanks,

Michael

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 ,
Apr 17, 2024 Apr 17, 2024

Copy link to clipboard

Copied

I don't know what script you use.

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 ,
Apr 17, 2024 Apr 17, 2024

Copy link to clipboard

Copied

it is a fold level javascript like below

 

mySaveAs1 = app.trustPropagatorFunction(function(doc,path) {

app.beginPriv();
var f = doc.getField("ONPLLogo");
if (f.buttonImportIcon(path) == 0){
f.buttonImportIcon(path);
}

app.endPriv();

})

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

@michaelw888 Did you check the Acrobat JavaScript Reference for this entry? It clearly states that the field.buttonImportIcon() function is not available in Acrobat Reader.  

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

Hi Thom,

Thanks for the info. So there is no way to show the icon in Reader DC, correct or there is other funtion to do it?

 

Thanks,

Michael

 

 

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

FYI, another expert try67 in this community has tested my codes and found it might be a bug in Reader DC. 

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

Adobe is not obligated to do anything that is not explicitly covered in the official documentation. Nor do they tell us their plans.  That said, the actual functionality of any particular function or property often strays from the spec. 

I've been at this for more than 20 years, in that time the compatibility of the field.buttonImportIcon() function has changed dramatically. Sometimes it works in Reader and sometimes it doesn't.  You are much better off relying on the official documentation than the odd functionality that works outside the spec.  

 

So no, there is no bug with this function in Reader because as I previously stated, it explicitly states in the reference that this function is not available in Reader. 

 

However, there is one thing you could try. Convert your image to a PDF and use that as the imported button icon.  PDFs do not require any image conversion. This has worked in the past in Reader. 

Also try not including the "cPath" parameter, so that Reader displays a file open dialog. This bypasses the security issues. 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

Thanks Thom! 

 

As for your comments "However, there is one thing you could try. Convert your image to a PDF and use that as the imported button icon.  PDFs do not require any image conversion. This has worked in the past in Reader.", do you mean use this way on the form level instead of folder -level script?

 

Thanks,

Michael

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

Or any example file for me to have a look?

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 Expert ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

It doesn't matter. Not including the path will allow the function to be used in a document context. Converting the image to PDF  has no affect on whether the function is used in a trusted function or not. The "no image conversion" bit is important because Reader doesn't do image conversion. 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

But how do I save a small icon image to be a pdf as it will be a full page. When choose it after the prompt, it shows a full pdf page with a tiny image.

 

Thanks,

Michael 

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

NVM, I can print to PDF for the image. But if there is no path, the prompt is always to show up for the file to be loaded. Is there any way to autoload the image pdf when a form with the image button is opened without this prompt? 

michaelw888_0-1713816722762.png

 

Thanks,

Michael

 

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

Try67 said the below about your comments in this matter.

 

"I believe that's no longer true, but will need to verify it. If so, it's very odd, since you can do it manually by clicking an image field."

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

Instead of printing to PDF, open the image file in Acrobat Pro, so that it does the conversion. If it's too large after conversion, use the crop tool in the PDF Edit toolset. 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Apr 23, 2024 Apr 23, 2024

Copy link to clipboard

Copied

Hi Thom, after conversion, the icon shows up automatically via the path from the fold level script now. That means field.buttonImportIcon() still working in Reader DC:)

 

thanks for all the help.

 

Michael

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 ,
Apr 23, 2024 Apr 23, 2024

Copy link to clipboard

Copied

Really? So it wasn't an issue in the first place?

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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 ,
Apr 23, 2024 Apr 23, 2024

Copy link to clipboard

Copied

The issue is the icon was a gif file and not show on Reader DC, after conversion, it shows.

 

Michael

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