Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


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

34

Likes

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

Adobe Community Professional , Jul 27, 2021 Jul 27, 2021
Hi, The firstButton has a buttonPosition which I think is what you are looking for:

Likes

Translate

Translate
Adobe Community Professional ,
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

 

Likes

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.

Likes

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