These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

A simple scripting task?

kilted_john
Registered: May 8 2007
Posts: 15

I would like to be able to create a sheet index/table of contents page that lists all of the pages within a PDF automatically. I can get the current page number to display correctly ... kid's play I know, but I do not have the skills to write a script to populate the rest of the fields with the desired information.

Any help/direction/assistance would be appreciated. Is there a template file I could use? I've been unable to locate anything worthwhile so far ...

TIA ... John

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You can create a PDF in JavaScript with the Report Object.

http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/building_reports/

It's not very pretty text, but it's a great way to create something like a table of contents or index.

The only other issue you have is getting a Name for the page entry in the table of contents. I've done this before using the bookmarks as a template. But you could also use the "doc.getPageNthWord" function to grab some words off the page.

Good Luck

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

kilted_john
Registered: May 8 2007
Posts: 15
Thanks Thomp for the insight ... I've contacted a consultant to see about helping me out.

Cheers ... John