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

Create a button with an icon in script

Community Beginner ,
Jul 27, 2021 Jul 27, 2021

Copy link to clipboard

Copied

Hello,

I want to create a button and that button should show a page from another pdf document. I have written a folder level script (so no security issues) and the code that I use is this:

var firstButton = newDoc.addField("Button 1", "button", pageNumber, [50, 67, 180, 247]);
firstButton.buttonImportIcon(this.path, pageNumberOfOrigDoc);

The button is created but the icon does not show. Do I need to set another property or something? In the Acrobat interface I need to set the layout to Icon Only but I can't find a similar property to set in the script for this.

 

Thank you for taking your time reading this (and maybe helping out).

TOPICS
JavaScript

Views

794

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

correct answers 1 Correct answer

Community Expert , Jul 27, 2021 Jul 27, 2021

Hi,

 

The firstButton has a buttonPosition which I think is what you are looking for:

 

BarlaeDC_0-1627373616796.png

 

Votes

Translate

Translate
Community Expert ,
Jul 27, 2021 Jul 27, 2021

Copy link to clipboard

Copied

Hi,

 

The firstButton has a buttonPosition which I think is what you are looking for:

 

BarlaeDC_0-1627373616796.png

 

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 ,
Jul 27, 2021 Jul 27, 2021

Copy link to clipboard

Copied

LATEST

Yes, thank you! That's not really a logical name for me, that's probably why I didn't find it. It would have been nice if the Acrobat API Reference mentioned this property needed to be set when using buttonImportIcon.

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