automated stamp/text

New Here ,
Jul 23, 2018

Copy link to clipboard

Copied

Hi i need help on how to run a java script that puts a stamp/text on the first page of every bookmark. does anyone know how to do this?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

119

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

automated stamp/text

New Here ,
Jul 23, 2018

Copy link to clipboard

Copied

Hi i need help on how to run a java script that puts a stamp/text on the first page of every bookmark. does anyone know how to do this?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

120

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
Jul 23, 2018 0
Most Valuable Participant ,
Jul 23, 2018

Copy link to clipboard

Copied

If the bookmarks tree only has one level you can easily traverse it from the root, executing each bookmark (using the exec method of the Bookmark object) and then adding the stamp to the current page.

If the tree has branches, though, you would need to write a recursive function to traverse the entire tree.

You add a stamp using the addAnnot method of the Document object.

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
Reply
Loading...
Jul 23, 2018 0
New Here ,
Jul 23, 2018

Copy link to clipboard

Copied

can you please show me how that code would look? I don't really know how to do that. Thanks

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
Reply
Loading...
Jul 23, 2018 0
New Here ,
Jul 23, 2018

Copy link to clipboard

Copied

(The bookmark tree only has one level)

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
Reply
Loading...
Jul 23, 2018 0
Most Valuable Participant ,
Jul 23, 2018

Copy link to clipboard

Copied

This is not a simple task, even with a single level of bookmarks. I've provided the basic approach to doing it, but if you're interested in having someone write the entire code for you contact me privately (try6767 at gmail.com) and we could discuss it in detail, including the price.

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
Reply
Loading...
Jul 23, 2018 0
Adobe Community Professional ,
Jul 23, 2018

Copy link to clipboard

Copied

How good are you with JavaScript?

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
Reply
Loading...
Jul 23, 2018 0
New Here ,
Jul 23, 2018

Copy link to clipboard

Copied

i don't know anything bout java script. Just know that its possible to do

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
Reply
Loading...
Jul 23, 2018 0
Adobe Community Professional ,
Jul 23, 2018

Copy link to clipboard

Copied

Well, then you will either need to lean JavaScript or hire someone.

But here is a basic outline for a solution.

A. Loop over the bookmarks.

B.  Inside the loop

     1. set the page number to the first page,

     2. execute bookmark

         a. If page number changes, then continue

         b. If page number does not change, then set to last page and execute bookmark again

         c. If page number changes, then continue

         d. If page does not change, then the bookmark either doesn't have a destination, or it does something else. Move on to next bookmark.

     3. Add stamp to predefined location on current page.

  

Those are the things you need to learn how to do.  You'll fine lots of info on this topic here

PDF Stamp Annotations

And here:

https://acrobatusers.com/tutorials/finding-page-boundaries

https://acrobatusers.com/tutorials/auto_placement_annotations 

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
Reply
Loading...
Jul 23, 2018 0