Solved

Printing Bookmarks

Posted on 2010-09-09
5
1,080 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
ID: 33645033
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
ID: 33648303
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
ID: 33651801
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
ID: 33694093
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
ID: 33725288
Thanks very much.  I will give the script a try.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe INTRODUCTION This Article is a follow-up to the Article entitled How To Rename-Move a Batch of PDF Files Based o…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

777 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