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

Split PDF Files by Bookmark

rahulunlimited
Registered: May 7 2008
Posts: 2

Hello,

I have Adobe Standard installed on my Desktop and I will like to use that to split large PDF Files using Bookmark. I read in a couple of forums that I can do so with the Execute Method of Javascript. However I am not able to do so.

I have the following code written. Can anyone help me with this.

Some of the lines in the code have been deleted for simplicity.

Private Sub SplitPDF()
Dim PDFDoc As Object
Dim JSO As Object
Dim PDFCompletePath As String
PDFCompletePath = "C:\Documents and Settings\ragarwal\My Documents\My Docs\PDFTest\Test.pdf"
Dim BookMarkRoot As Object
Dim BookMarks As Variant
Dim LevelCount As Long
Set PDFDoc = CreateObject("AcroExch.PDDoc")
Stop
If PDFDoc.Open(PDFCompletePath) Then
Set JSO = PDFDoc.GetJSObject
BookMarks = JSO.BookMarkRoot.Children
LevelCount = UBound(BookMarks)
Dim FirstNode
FirstNode = BookMarks(0).Children
Dim i As Integer
Dim CurrentRootNode
For i = 0 To LevelCount
CurrentRootNode = BookMarks(i).Children
BookMarks(i).Execute
Next
End If
Exit Sub
End Sub

My Product Information:
Acrobat Standard 6.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
I do not see where you are picking up the page number of the page that the executed bookmark took you to as a variable. The "extractPages" requires a beginning page number and an ending page number. More information about the "extractPage" method of the "doc" object is contained in Acrobat's JavaScript Reference.

George Kaiser