I created the following JS to combine tow documents, but there are no bookmarks present. Is there a way to combine these two documents via JS and maintain the bookmarks?
Current code:
var filepath = "/c/filepath/"
// Create a new PDF document for Profile:
doc = app.newDoc();
doc.saveAs({ cPath: filepath + "Temp.pdf" });
doc.closeDoc(true);
doc = app.openDoc({cPath: filepath + "Temp.pdf" })
// List of files of different extensions
aFiles = new Array( "Doc1.xls", "Doc1.doc");
for ( var i=0; i < aFiles.length; i++) {
// Open and convert the document
newDoc = app.openDoc({
oDoc: doc,
cPath: aFiles[i],
bUseConv: true
})
// Save the new PDF file to a temp folder
newDoc.saveAs({ cPath: filepath + "Combined.pdf" });
// Close it without notice
newDoc.closeDoc(true);
// Now insert that PDF file just saved to the end of the first document
doc.insertPages ({
nPage: doc.numPages-1,
cPath: filepath + "Combined.pdf",
nStart: 0
});
}
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script