Uderc programming article aggregator sites

Unwanted bookmarks when combining PDFs

Answers: Have 12 answers
I've been trying to PDF a 344 page FrameMaker book (several documents) but I keep getting a memory error (I doubt it's my machine cause it happens on others). So I PDFd the individual documents in the book then combined them in Acrobat. That works fine except that a top level bookmark is added for each PDF filename. Looks something like this:
Quick Report
Financial Report Writer
Order Entry
Invoice - Laser Graphics
Invoice - Grey Bars
Order Entry Reports
And so on...
I cannot figure out how to get rid of these bookmarks (e.g., Report_Guide_2.pdf) and just have the bookmarks that were established in the individual PDF files. I've gone through the Acrobat Help but I don't find any obvious reference to a setting that controls this. Does anyone know how to prevent the generation of these unnecessary bookmarks during combining (Insert pages)?
I have also used the Create PDF/From Multiple Files method and it also generates the unnecessary bookmarks.
I'm using Acrobat 7.1.0 Professional on Windows XP Pro.
The best answer: As the script is written, you can cut and paste it into the JavaScript console/ Debugger, "Ctrl + J", and then highlight the text and press the keypad  "Enter" key.<br /><br />You can place the following variation in Acrobat's JavaScript folder and have a menu item:<br /><br />function RemovePDFTypeFromBookmarks() {<br /> /*<br />Author: Sean Stewart, ARTS PDF<br />Date: 2 June 2004<br />Description: When you merge documents using Acrobat's merge process<br />it creates a high-level bookmark with the filename of the merged document and<br />subordinates all bookmarks from the merged document below this.<br /><br />This script can be used to:<br />1) moves all subordinated bookmarks up the bookmark tree; and<br />2) delete the filename bookmark<br /> */<br /><br />var bm = this.bookmarkRoot;<br /><br />// Find the bookmarks which have .PDF and move all their children to the end<br />// of the bookmark tree. Add each found bookmark to an array so that<br />// it can be deleted at the conclusion of the process<br /><br />// Create an array to hold the bookmarks to delete @ a later stage<br /><br />try {<br />var bmToDeleteArray = new Array();<br />// console.show();<br />// console.clear();<br />// console.println("Removing bookmarks with string \".PDF\" in name");<br />// Iterate through each bookmark<br />var ibmLength = bm.children.length;<br />for (var i = 0; i < ibmLength; i++) {<br /><br />    // Check to see if this is a filename which<br />    // contains sub-ordinate bookmarks<br />    var bmToCheck = bm.children[i];<br />    // test as case insative<br />    if((bmToCheck.name.toLowerCase().indexOf(".pdf")!=-1) && (bmToCheck.children!=null)) {<br /><br />        // console.println("found bookmark with children " + i);<br /><br />        // Move all children to the end of the root bookmark tree<br />        // being sure to move the first item in each case<br />        // note: this is because the queue is shrinking as<br />        // we move each item<br /><br />        var ibmChildrenToMoveLength = bmToCheck.children.length;<br />        for(var j=0; j<ibmChildrenToMoveLength; j++) {<br /><br />           // console.println("moving bookmark " + j);<br /><br />           bm.insertChild(bmToCheck.children[0], bm.children.length);<br />        }<br /><br />        // Add this to the array of bookmarks to be deleted later<br />        bmToDeleteArray[bmToDeleteArray.length] = bmToCheck;<br />    }<br />}<br /><br />// Iterate through the array of 'filename' bookmarks to delete<br />// and delete them<br /><br />for (var i = 0; i < bmToDeleteArray.length; i++){<br /><br />// Delete bookmark<br />   bmToDeleteArray[i].remove();<br />}<br /><br />// Finally remove the array as a nicety<br />delete bmToDeleteArray;<br />// console.println(bmToDeleteArray.length + " booksmarks found and removed.");<br />}<br />catch (error) {<br />app.alert("Action failed.\nThere must be an open document to process\n"+ error, 0, 3); }<br />finally {<br />// console.hide();<br />return;<br />} //end try<br /><br />} end funciton<br /><br />// insert after the "Close" item (the default behavior)<br />app.addMenuItem( { cName: ,<br />cUser: "Remove \".PDF\" Bookmarks",<br />cParent: "Tools",<br />cExec: "RemovePDFTypeFromBookmarks()",<br />cEnable: "event.rc = event.target != null",<br />nPos: "Object Data"});


Related articles

Save as pdf deleted bookmarks when combining pdf-files

The function to combine pdf files and the function to add bookmarks stopped working in 10.x

Combine pdf + html files

How do you move pages around in a combined pdf online.

When saving a PDF from a FrameMaker book, is it possible to set document filenames as bookmarks in the PDF?

Bug in Automator's Combine PDF Pages action?

Merge and Combine PDF files in a numerical order

Combined PDF's and created links to original PDF's

Trying to create a "Combine PDF" that also has a "save as" dialog box

Getting File Name in Automator workflow - combine PDF

Recommended article

I had to change my verizon no contract phone number and when i registered with my verizon i already forgot my id,password and now my phones missing. how can i find out my new number if i cant remember any of my info? please help

Material/Serial Nbr is "Stuck" in a storage location and can not be moved

The border of a table in a BI Report not renderd properly with Firefox3.6.x

Third party issue

Actionscrip Linking Question

In EBAY, my auction descriptions can't be viewed by me. I see only a red frame. I don't have this problem in Internet Explorer and this is a new issue for me that only seems to have started in the last day or so.

Tcode for creating product

AME 7.2.2 crash

MVC 4 Using Entity Framework How to save Images in Database

HT4060 Since I load the new software my battery does not hold power as long.  What can I do?