Solved

Printing Bookmarks

Posted on 2010-09-09
5
1,074 Views
Last Modified: 2012-05-10
Is it possible to print a list only of the bookmarks in Adobe Acrobat 9 Standard version?
0
Comment
Question by:pruski
  • 3
  • 2
5 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
Comment Utility
You can do this with Javascript - however, Standard does not come with the JS development environment, so you have to write the code without having a way to debug. Even though Standard does not come with the JS development tools, it still can run JS commands.
Have you ever done anything with Javascript in Acrobat?


0
 

Author Comment

by:pruski
Comment Utility
Thanks for the response.  I have never done anything with Java in Acrobat.  Any pointers will be greatly appreciated!
0
 
LVL 44

Assisted Solution

by:Karl Heinz Kremer
Karl Heinz Kremer earned 500 total points
Comment Utility
I'm leaving for the weekend, I will be back on Tuesday with a sample JavaScript.
0
 
LVL 44

Assisted Solution

by:Karl Heinz Kremer
Karl Heinz Kremer earned 500 total points
Comment Utility
Sorry for the delay.

Save the attached Javascript program as a text file in the Acrobat Javascript directory (I'm assuming that you are using Windows) C:\Program Files\Adobe\Acrobat 9.0\Acrobat\Javascripts (if you are not using A9, adjust the path). Use a descriptive file name with the extension .js (e.g. dumpBookmarks.js). Then restart Acrobat. You should now have a new menu item under the Documents menu. If it does not show up, you may have to go into Acrobat's preferences and enable the "Enable menu item JavasScript execution privileges" in the JavaScript category.
function DumpBookmark(rep, bkm, nLevel)
 {
    if (DBM_line >= 50)
    {
        rep.breakPage();
        DBM_line = 0;
    }

    rep.indent(20*nLevel);
    rep.writeText("+-" + bkm.name);
    rep.outdent(20*nLevel);

    DBM_line++;

    if (bkm.children != null)
    for (var i = 0; i < bkm.children.length; i++)
    DumpBookmark(rep, bkm.children[i], nLevel + 1);
}

function doDumpBookmarks()
 {
    // Open a new report
    var rep = new Report();

    rep.size = 1.2;
    rep.color = color.blue;

    rep.writeText("Summary of Bookmarks:");

	rep.size = 1.0;
	rep.color = color.black;
	
    DumpBookmark(rep, this.bookmarkRoot, 0);

    // Now open the report
    var docRep = rep.open("myreport.pdf");
    docRep.info.Title = "Bookmarks Summary";

    DBM_line = 0;
}

var DBM_line = 0;

// add the menu item
app.addMenuItem({
	cName: "dumpBookmarksToReport",     // this is the internal name used for this menu item
	cUser: "Dump Bookmarks",       // this is the label that is used to display the menu item
	cParent: "Document",              // this is the parent menu. The file menu would use "File"
	cExec: "doDumpBookmarks()",  // this is the JavaScript code to execute when this menu item is selected
	cEnable: "event.rc = (event.target != null);",       // when should this menu item be active?
	nPos: 0
});

Open in new window

0
 

Author Comment

by:pruski
Comment Utility
Thanks very much.  I will give the script a try.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
This article is in response to a question here (http://www.experts-exchange.com/Other/URLs/Q_28283850.html) at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now