How do I add a box next to a title and have it copy that title to another page in a PDF document?

Community Beginner ,
Dec 04, 2018 Dec 04, 2018

Copy link to clipboard

Copied

I am compiling an ebook and want to make it so that the title of each page

can be copied to another page by clicking a box,  each page will be copied

to the same page if box clicked and that page is (Journey Planner)...in adobe acrobat so

correct Javascript required please.....

TOPICS
Acrobat SDK and JavaScript, Windows

Views

278

Likes

translate

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
Most Valuable Participant ,
Dec 04, 2018 Dec 04, 2018

Copy link to clipboard

Copied

So you want to create a button that puts a certain text into a text field when clicked? It's simple. Add this code as the button's MouseUp event:

this.getField("Text1").value = "Journey Planner";

Likes

translate

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 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

Hi try67

don't think I was clear about what i want to do....

I want to be able to do this.......300 page book, imported as PDF document into acrobat,

if a click box is checked then the page title will be added to a list. "Journey Planner Page"

the script you have given doesn't work..all I am getting is a dotted square with no text.?

is that because I dont have a text box on the recipient page"JourneyPlanner"?

or is it because the text that I want to transfer is not in a text box?

again thank you for your help

Likes

translate

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
Most Valuable Participant ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

So you want to use a check-box and when that box is ticked some text should appear in a text field on another page?

Likes

translate

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 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

yes...text field on that page(page where text is to appear) is "text33"

Likes

translate

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
Most Valuable Participant ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

And the name of the checkbox?

Likes

translate

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 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

check box name "Add"

just so I am clear, I need to be able to do this on any page out of the 300 and so make a list

in "Text33" of all check boxes clicked.......say anything from 3 to 15 in the list...

Likes

translate

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
Most Valuable Participant ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

You can't use the same field name for all the check-boxes. Each one will have to have a unique name.

Let's say that if "Add1" is ticked then "Text33" should show "Journey Planner".

You can use this code as the custom calculation script of Text33:

var items = [];

if (this.getField("Add1").valueAsString!="Off") items.push("Journey Planner");

if (this.getField("Add2").valueAsString!="Off") items.push("Something else");

if (this.getField("Add3").valueAsString!="Off") items.push("Yet another thing"); // etc.

event.value = items.join(", ");

Likes

translate

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 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

OMG.... that is complicated.....

Just so i have this correct then...

I would have to have a different named check box on each page then

in text33 make a list of them as shown in your last message?

so basically a list of 300 different check boxes?

Likes

translate

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
Most Valuable Participant ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

Well, if you place the text as the export value of each check-box then the script can be much simpler.

If you have fields named Add1 to Add300 you would only need to use this code:

var items = [];

for (var i=1; i<=300; i++) {

    var v = this.getField("Add"+i).valueAsString;

    if (v!="Off") items.push(v);

}

event.value = items.join(", ");

Regarding adding the check-boxes: That too can be done with a script, if they all need to appear on the same spot.

Likes

translate

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 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

ok thank you, I will give that a go tomoz..

will let you know if its worked.

many thanks again for your help

Likes

translate

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 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

sorry...so what would be the script for each check box (Add1) on each page?

Likes

translate

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
Most Valuable Participant ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

The check-boxes themselves do not require having any script attached to them.

Likes

translate

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