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

automated stamp/text

New Here ,
Jul 23, 2018 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

393

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

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
New Here ,
Jul 23, 2018 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

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
New Here ,
Jul 23, 2018 Jul 23, 2018

Copy link to clipboard

Copied

(The bookmark tree only has one level)

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

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 ,
Jul 23, 2018 Jul 23, 2018

Copy link to clipboard

Copied

How good are you with JavaScript?

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
New Here ,
Jul 23, 2018 Jul 23, 2018

Copy link to clipboard

Copied

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

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 ,
Jul 23, 2018 Jul 23, 2018

Copy link to clipboard

Copied

LATEST

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 

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