Script to split pdf into sections

Hello
I have an awful lot of books in pdf format
I now have to be able to split them into their chapters, I'm assuming I'll have to make a text file up for each book to tell the script where each chapter starts
I've done some scripting in Indesign and Quark on the Mac OS X but am yet to do anything in Acrobat, I'd want something that could loop through the list of page numbers for each chapter start and extract each chapter as a seperate pdf
I'd be grateful for pointers to anything useful, I've found bit and bobs with google but nothing that useful so far
I'm decent at canablising, hpeless working from scratch
Thanks
Tynan

Use the extractPages document method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.465.html

Similar Messages

  • Script to Split PDF files on Bookmarks

    I'm totally new to Java scripting.  What I'm looking for is a script I can run from batch processing with professional that will look at a collection files in s directory and split ech one of them on their bookmarks into smaller files.
    The bookmarks are all based on the page so it is possible to use the bookmark object's "execute" method to execute the bookmark action and pickup the page number.
    I read that last part somewhere. If someone can give me a reference to a thread or just some code to get me started that would help. Thanks,
    Josh

    5 years later... hopefully this helps someone out there.
    I couldn't find much information online about this myself, but hammered away until it worked. My code is for a slightly different purpose, but you should easily be able to adjust it for your needs.
    My sources:
    Adobe IAC Developer Guide
    Adobe IAC API Reference
    Adobe JS API Reference
    Adobe Acrobat and VBA – An Introduction | Karl Heinz Kremer's Ramblings
    UtterAccess Discussion Forums > Splitting Pdf Files
    Private Sub extractBookmark()
    Dim AcroApp As AcroApp, AVDoc As AcroAVDoc, PDDoc As AcroPDDoc, PDBookmark As AcroPDBookmark, AVPageView As AcroAVPageView
    Dim newPDF As AcroPDDoc, mergePDF As AcroPDDoc
    Dim jso As Object, BookMarkRoot As Object
    Dim masterPath As String, testName As String, i As Variant, bookmark As Variant
    Dim startN As Integer, endN As Integer, nPages As Integer, totalP As Integer
    Set AcroApp = CreateObject("AcroExch.App")
    Set AVDoc = CreateObject("AcroExch.AVDoc")
    Set PDDoc = CreateObject("AcroExch.PDDoc")
    Set PDBookmark = CreateObject("AcroExch.PDBookmark")
    masterPath = ActiveWorkbook.Path & "\MasterDocument.pdf"     'Path of the PDF containing the bookmarks to be extracted
    AVDoc.Open masterPath, vbNull
    Set AVPageView = AVDoc.GetAVPageView
    Set PDDoc = AVDoc.GetPDDoc
    Set jso = PDDoc.GetJSObject
    Set BookMarkRoot = jso.BookMarkRoot
    bookmark = jso.BookMarkRoot.Children
    totalP = PDDoc.GetNumPages
    'Loop through the 10 bookmarks in MasterDocument.pdf and get the starting page # of each. This # has to be changed to the # of bookmarks in your pdf. Or write something to count the bookmarks and use that variable. "productName" is a global variable for my specific project... You'll need to revise this for your purpose.
    For i = 0 To 9
        If bookmark(i).Name = productName Then
            PDBookmark.GetByTitle PDDoc, bookmark(i).Name
            PDBookmark.Perform AVDoc
            AcroApp.Exit
            startN = AVPageView.GetPageNum
            If i < 9 Then
                PDBookmark.GetByTitle PDDoc, bookmark(i + 1).Name
                PDBookmark.Perform AVDoc
                AcroApp.Exit
                endN = AVPageView.GetPageNum
                nPages = endN - startN
            Else
                nPages = totalP - startN
            End If
        End If
    Next
    PDDoc.Close
    'This part will also need to be modified. I am inserting the bookmarks into an already made PDF (global variable for me "fName"). You'll want to create a new pdf.
    Set newPDF = CreateObject("AcroExch.PDDoc")
    Set mergePDF = CreateObject("AcroExch.PDDoc")
    newPDF.Open fName & ".pdf"     'This line needs changing for your purpose. Probably could be.... newPDF.Create
    mergePDF.Open masterPath
    newPDF.InsertPages 0, mergePDF, startN, nPages, 0
    newPDF.Save PDSaveFull, fName & ".pdf"
    newPDF.Close
    mergePDF.Close
    End Sub

  • Split PDF into several new files

    I have a .pdf file that I'd like to turn into three separate .pdf files. I know I can do this through screen capture, but the image isn't as sharp as the original text. How can I create new .pdfs from portions of the original one?

    Alas, the sections I want to split the .pdf into don't break down neatly by page. For instance, the first section is only part of the first page, and the second section bridges two pages.
    Is there any way I can create page breaks for each section and then extract pages?

  • Split PDF into separate PDF files

    I have a seven page PDF and I want to separate it ino seven individual PDF files.  Is this possible?  If so, how?

    Not possible with Adobe Reader. You can extract pages from a unprotected PDF document with Adobe Acrobat.

  • How do I split a large wall graphic on Illustrator into sections for printing?

    I work in marketing and occasionally have to put together graphics on Illustrator.
    I am currently putting together a large wall graphic for an exhibition and want to find out how to split it into sections for printing. It has a total length of 5757mm but will need to be split into 6 panels (4x 980mm, 1x 841mm & 1x 996mm)
    It would be best for me to design this as one large graphic and then split it, however I'm not sure of the best way to do this.
    Any help would be greatly appreciated!

    Louise,
    There is just room enough for the whole artwork in 1:1 within the Workspace.
    You may create it as one entity, then create Artboards for each panel, but the exact way depends on a few things such as whether you are working with overlaps and whether the printer prints to the edge or has a non printing area.
    You may need two sets of the artwork with every second artboard on each so that you end up with overlapping artboards for printing/assembly.

  • What version of Acrobat is needed to split pages of a PDF into separate documents? Standard or Pro?

    Need to be able to split PDFs into separate files dependent of what page. Can standard do this? Or will i need Pro?

    Hi asfkmg,
    Both Acrobat Standard and Pro will allow you to split a PDF into separate documents. Here's a great video that shows you how: https://acrobatusers.com/tutorials/how-to-break-a-pdf-into-parts
    Best,
    Sara

  • How to split PDF file by pages

    Is there any programming way to split PDF into pages, say one PDF file per page or specify page range to split PDF file?
    Thanks for your help.

    Yes it does. It disassembles pdf1 by extracting pages 1-3 and disassembles pdf2 by extracting pages 4-5. Then re-assembles the two subsets into a new PDF.
    You could extract page1 from pdf1 only and create a pdf, then page2 of pdf1 into a different PDF using something similar to:
    <?xml version="1.0" encoding="UTF-8"?>
    <DDX xmlns="http://ns.adobe.com/DDX/1.0/">
    <PDF result="Final.pdf">
         <PDF source="PDF1.pdf" pages="1"/>
    </PDF>
    <PDF result="Final2.pdf">
          <PDF source="PDF1.pdf" pages="2"/>
    </PDF>
    </DDX>
    You can also use the  PDFFromBookmarks tag to generate a new document for each level 1 bookmark created in a PDF.
    <PDFsFromBookmarks prefix="stmt">
         <PDF source="doc1.pdf"/>
    </PDFsFromBookmarks>
    You can get more info at http://livedocs.adobe.com/livecycle/8.2/ddxRef/000640.html
    Jasmin

  • Split a PDF by sections and name them into one unmanaged disk destination

    Hi,
    I have a report wich I export as a PDF to an unmanaged disk destination. The report is grouped by geographic area, and I want to separate the PDF into each of the 200 geographic areas. Is there any way to do this without having 200 versions of the report or without having 200 instances with a different parameter?
    Thanks,

    Thanks Bashir,
    It is a Crystal report, and I already have the sections with the tree in the left part to get to the appropiate section, the problem is that the report is too big and users prefer to access just the file they need; that is why I want to split into separate PDFs.  The other advantage is that it make it easier to link from my Intranet just to the part each group need, and for users who access remotly, opening a small file takes less time than opening a huge file, so there are many reson to split it.
    Any ideas?

  • Need Script to split multi-paged ID file into multiple single paged ID files

    I have created a 366 page document (and have 2 more to create). None of the text threads from page to page, and there are no master page items. Each page is destined to be used as a single block that will be copied and pasted into a master document by a database driven plugin (and for color editing reasons it needs to be separate .indd files). For expediency, I created these as a single document because I could import the text with ID style tags to pre-format the text (with all text blocks threaded). I then broke all the text threads using API's Auto Unstich plugin. We then manually tweaked the text of each page.
    Gluon once sold a plugin called DocSplitter, but it has not been updated since CS1 and does not work with CS4.
    Before you ask why I don't have the database plugin create multiple single page docs — the plugin doesn't currently save to individual ID docs (yet - feature to be released in 3 months).
    I know that scripting could possibly do what I need, but I have little to no experience with AppleScript (7 years ago) and none with Javascript. Would love to find a pre-packaged solution and am willing to pay someone for it.
    To guess there are two ways a script could work:
    1) script breaks the doc into single pages (not sure how that would work really) but the files would be named based on page number — i.e filename-01.indd, filename-02.indd, etc.
    2) script selects all objects on a page, groups the objects, copies the objects, creates a new page, pastes the objects and then saves the file in the same manner as number 1 above - loop and repeat for al the pages.
    Any help would be greatly appreciated.
    many thanks
    Roger

    Hi Roger,
    This topic was discussed in this thread: http://forums.adobe.com/message/1113562#1113562
    Check out this script:
    http://creative.mediabox.fr/index.php?app=core&module=attach&section=attach&attach_id=6440
    Kasyan

  • How to split a parallell-page PDF into single-page PDF

    My situation: I have a few hundred pages of files I made quite a few years ago, optimized for "self-publishing" via the printer. I no longer have any source files (my own bad). These files have 2 pages next to each other in an A4 landscape PDF. I would like to change and combine these files into a US Letter portrait PDF.
    I have browsed earlier, similar threads, most notably the most referred to thread:
    http://forums.adobe.com/message/3331516
    which recommends using Adobe PDF printer. However, as this thread points out, and as I for one have found on my own system (10.8.3), Adobe PDF printer is no longer an option on Mac OS X (version 10.6 and on):
    http://forums.adobe.com/thread/556366
    So the question then is: How do we now split double-page landscape PDFs into single-page portrait PDFs?

    Since at least OSX.5 adobe has removed PDF Printer which was begining to fail it was written in Adobe's altered version of javascript and it was a wonder it was working to begin with They replaced it with an Automator action that's called up through the print Driver.
    Here are the steps for applications other than Acrobat.
    create you doucument. laying it out the way you want it.
    Go to Print menu.
    click and hold the pdf button - a context menu pops up.
    now scan the list of choices and choose Adobe PDF or Adobe Quality PDF (depends on version of OS)
    wait for direction fields to come up and make the desired choices (the first screen is basically job options).
    when asked ask for name either ecept name give or choose name of your choice.
    Browse to desired location for file
    then click save.
    How the PDF is layed out in acrobat is determinedby acrobat. Adobe add an additional Layer on top of the Print Driver. You can by pass it and use the Print Driver but if there is an orientation switch in your docment the page is turned so everything comes out with same edge of Paper
    Oh, look out for a Grand idea Adobe did that even Forest Gump would have left alone.
    If you want to do duplex printing to a PDF with more than one page you won't be able to do so whether you have your printer setup for duplex printing. You can go back and forth from printer setting s to Printer setting toggling off and on til you turn blue in the face. You have to go into the document properties and loo for a command called SIMPLEX printing its on by default and needs to be turned off. Even my cat Boots would be smart enough not to put that in.
    This settinging does not permanently turn off and you have to do with each document you create or resave.

  • Splitting text column into sections

    (Using Oracle 9i SQL)
    I need to be able to split text which may be from 0 to 2000 bytes into sections of no more than 10 characters and assign a sequence to each. As usual, example is the best way to illustrate.
    The following presents the "raw" data:
    with src as (
    select     'A100000'     part_no,
         'Short'          descr
    from     dual
    UNION ALL
    select 'A100001','two words' from dual
    UNION ALL
    select 'A100002','Should be two lines' from dual
    UNION ALL
    select 'A100003','This is going to be 3' from dual
    UNION ALL
    select 'A100004','Oneverylongword' from dual
    UNION ALL
    select 'A100005','Perfectfit' from dual
    UNION ALL
    select 'A100006','' from dual
    UNION ALL
    select 'A100007','A Perfectfit but 3 lines' from dual
    UNION ALL
    select 'A100008','Toolongforone' from dual
    UNION ALL
    select 'A100009','Toolongforone too' from dual
    select     part_no,
         descr
    from     src
    PART_NO DESCR
    A100000 Short
    A100001 two words
    A100002 Should be two lines
    A100003 This is going to be 3
    A100004 Oneverylongword
    A100005 Perfectfit
    A100006
    A100007 A Perfectfit but 3 lines
    A100008 Toolongforone
    A100009 Toolongforone too
    10 rows selected.What I want is this kind of thing:
    PART_NO DESCR                           SEQ TEXT
    A100000 Short                             1 Short
    A100001 two words                         1 two words
    A100002 Should be two lines               1 Should be
    A100002 Should be two lines               2 two lines
    A100003 This is going to be 3             1 This is
    A100003 This is going to be 3             2 going to
    A100003 This is going to be 3             3 be 3
    A100004 Oneverylongword                   1 Oneverylon
    A100004 Oneverylongword                   2 gword
    A100005 Perfectfit                        1 Perfectfit
    A100006                                   0
    A100007 A Perfectfit but 4 lines          1 A
    A100007 A Perfectfit but 4 lines          2 Perfectfit
    A100007 A Perfectfit but 4 lines          3 but 4
    A100007 A Perfectfit but 4 lines          4 ines
    A100008 Toolongforone                     1 Toolongfor
    A100008 Toolongforone                     2 one
    A100009 Toolongforone too                 1 Toolongfor
    A100009 Toolongforone too                 2 one too

    Thanks although there is a bug when the text is too big:
    with src as (
    select     'Alen0000'     id,
         'Short'          str
    from     dual
    UNION ALL
    select 'Alen0001','two words' from dual
    UNION ALL
    select 'Alen0002','Should be two lines' from dual
    UNION ALL
    select 'Alen0003','This is going to be 3' from dual
    UNION ALL
    select 'Alen0004','Oneverylongword' from dual
    UNION ALL
    select 'Alen0005','Perfectfit' from dual
    UNION ALL
    select 'Alen0006','' from dual
    UNION ALL
    select 'Alen0007','A Perfectfit but 3 lines' from dual
    UNION ALL
    select 'Alen0008','Toolongforone' from dual
    UNION ALL
    select 'Alen0009','Toolongforone too' from dual
    SELECT
         ID, STRING
    FROM
         (SELECT    
              ID, LEVEL level#,
              SUBSTR (str, INSTR (str, base, 1, LEVEL) + len,
                   INSTR (SUBSTR (str, INSTR (str, base, 1, LEVEL) + len, limit# + 1),
                        base, -1) -1) STRING,
            INSTR (str, base, 1, LEVEL) + len - 1 start#,
            INSTR (SUBSTR (str, INSTR (str, base, 1, LEVEL) + len, limit# + 1), base, -1)
                   + INSTR (str, base, 1, LEVEL) + len - 1 end#
         FROM
              (SELECT
                   ROWNUM ID, ' ' base, ' ' || str || ' ' str, LENGTH (' ') len, 10 limit#
              FROM src
         CONNECT BY LEVEL <= (length (str) - length (REPLACE (str, base))) / len - 1
    START WITH start# = 1
    CONNECT BY PRIOR end# = start# and prior ID=ID
      GROUP BY ID, level#, STRING
    /ERROR at line 4:
    ORA-01436: CONNECT BY loop in user data
    yet is I change limit from 10 to 15 it is OK

  • How to split a large PDF into many smaller PDFs

    In my wanderings, I couldn't find an answer to this question. Thus my post.
    I have a large, 20 page, pdf. I'd like to split that pdf into 10 two page pdfs. How can I do it?
    The 20 pager is a pdf of a number of account statements. The account statements varying in length from 1 to 3 pages. I'd like to split the pdf so I end up with one pdf per account.
    In advance, thank you for your help

    Hi.
    It's simple: open the PDF, go to File, Print, and in the print dialog select Copies & Pages, enter the range you want, click PDF/Save as PDF.
    Good Luck.
    MacMini G4 1.25GHz 1GB   Mac OS X (10.4.9)  

  • Extra long track- can I split into sections?

    IT's hard to explain why, but I have one audio file that is about 20 hours long. It is hard for my ipod to play this file. Is it possible to split it up into pieces, like, split it into 20 1 hour audio files?

    On a Windows-System you can use "mp3DirectCut". Its my favorite for spliiting mp3's into smaller parts.
    P4   Windows 2000  

  • Script to change page to section in entire document

    Hi,
    using CS2 (WIN) I have a problem with setting sections which might sound trivial. From time to time I have to set-up a questionnaire containing forms. These forms will be filled in later by the user. In order to give some advice on how to fill in the forms correctly, completion instructions will be provided as well. The problem now is that I have to create the forms first on numbered pages. After they have been reviewed, the instructions are added next to each questionnaire form and these must not have page numbers. Up to now I use two masterpages (one with and one without page numbers) but it is very time-consuming to set a new section for each numbered page manually (several 100 pages), so I was wondering if there is a possibility to let a script do the "splitting into sections" work once the numbered pages have bee set up, before I add the completion instruction pages.
    Thanks for your help in advance.
    Angus

    Looks interesting. But I'd like to keep it as simple as possible and avoid the part with the extra textfiles and just insert the code text straight into the menu file, kind of like this:
    mmaker --no-desktop -vf pekwm
    sed {
            find-and-goto-line-below-'root menu'-declaration, insert-text {
                                                                                                           entry for 'terminal'
                                                                                                           entry for 'run"
           ~/.pekwm/menu
    sed {
             find-line-below-'pekwm'-submenu-declaration, insert-text {
                                                                                                       entry for 'themes'
           ~/.pekwm/menu
    Obviously it's not real code but it's just to outline how I'd like to have it. Just need to know the correct syntax to make it work. I don't care much for 'Go To' and the rest.
    Last edited by lostinpurdy (2010-07-10 03:48:10)

  • Split PDF Files by Bookmarks

    Can anyone please let me know how do I split PDF Files by bookmark using Java Script.
    I am making a Visual Basic utility to read the bookmarks in PDF Files and split them based on the bookmarks. I am able to split the PDF Files by using Arts PDF Split Pro. However since I am already using Adobe Standard, I would like to do it with Adobe itself.
    Thus, I pay license for only one software and not two.
    Thanks
    Rahul

    I couldn't find much information online about this myself, but hammered away until it worked. You should easily be able to adjust it for your needs.
    My sources:
    Adobe IAC Developer Guide
    Adobe IAC API Reference
    Adobe JS API Reference
    Adobe Acrobat and VBA – An Introduction | Karl Heinz Kremer's Ramblings
    UtterAccess Discussion Forums > Splitting Pdf Files
    Private Sub extractBookmark()
    Dim AcroApp As AcroApp, AVDoc As AcroAVDoc, PDDoc As AcroPDDoc, PDBookmark As AcroPDBookmark, AVPageView As AcroAVPageView
    Dim newPDF As AcroPDDoc, mergePDF As AcroPDDoc
    Dim jso As Object, BookMarkRoot As Object
    Dim masterPath As String, testName As String, i As Variant, bookmark As Variant
    Dim startN As Integer, endN As Integer, nPages As Integer, totalP As Integer
    Set AcroApp = CreateObject("AcroExch.App")
    Set AVDoc = CreateObject("AcroExch.AVDoc")
    Set PDDoc = CreateObject("AcroExch.PDDoc")
    Set PDBookmark = CreateObject("AcroExch.PDBookmark")
    masterPath = ActiveWorkbook.Path & "\MasterDocument.pdf"     'Path of the PDF containing the bookmarks to be extracted
    AVDoc.Open masterPath, vbNull
    Set AVPageView = AVDoc.GetAVPageView
    Set PDDoc = AVDoc.GetPDDoc
    Set jso = PDDoc.GetJSObject
    Set BookMarkRoot = jso.BookMarkRoot
    bookmark = jso.BookMarkRoot.Children
    totalP = PDDoc.GetNumPages
    'Loop through the 10 bookmarks in MasterDocument.pdf and get the starting page # of each. This # has to be changed to the # of bookmarks in your pdf. Or write something to count the bookmarks and use that variable. "productName" is a global variable for my specific project... You'll need to revise this for your purpose.
    For i = 0 To 9
        If bookmark(i).Name = productName Then
            PDBookmark.GetByTitle PDDoc, bookmark(i).Name
            PDBookmark.Perform AVDoc
            AcroApp.Exit
            startN = AVPageView.GetPageNum
            If i < 9 Then
                PDBookmark.GetByTitle PDDoc, bookmark(i + 1).Name
                PDBookmark.Perform AVDoc
                AcroApp.Exit
                endN = AVPageView.GetPageNum
                nPages = endN - startN
            Else
                nPages = totalP - startN
            End If
        End If
    Next
    PDDoc.Close
    'This part will also need to be modified. I am inserting the bookmarks into an already made PDF (global variable for me "fName"). You'll want to create a new pdf.
    Set newPDF = CreateObject("AcroExch.PDDoc")
    Set mergePDF = CreateObject("AcroExch.PDDoc")
    newPDF.Open fName & ".pdf"     'This line needs changing for your purpose. Probably could be.... newPDF.Create
    mergePDF.Open masterPath
    newPDF.InsertPages 0, mergePDF, startN, nPages, 0
    newPDF.Save PDSaveFull, fName & ".pdf"
    newPDF.Close
    mergePDF.Close
    End Sub

Maybe you are looking for

  • Can't print from my new Mini-HP 952C via IP print server

    I have a 1 week old Mini that I cannot get to print on my existing home network. It works with my router just fine for internet access, but I have a Netgear print server on there to share my printer with my home office laptop and now the Mini. I set

  • How do I save email addresses for all my contacts

    I have just purchased and Apple ipad air and do not find a way of saving all the contacts I have with email addresses. Can you help please?

  • HT5219 Thunderbolt ports and displays

    I bought a TB screen and i am connecting it to My Macbook Pro 13'' & it's working perfectly, but i tried to connect my TV screen from the second TB port available in the TB screen through MiniDisplay-HDMI adaptor and isn't working, any clue?

  • How to manually install driver? Not detecting sound c

    Hi, My problem is when installing off the cd and off the downloaded driver it will not detect a creative product. I have li've! 5. with windows SP2. All I want to do is install the driver, doing it the windows search way does not work. I want do MANU

  • WRE54G v3 - I manage to set it up manually but it crashes when I add security

    I have attempted to set up the WRE54G via the cd but kept getting the "can not associate AP in repeater mode". I googled it and tried all the solutions suggested with no joy. It doesn't want to use the cd, I did it time after time changing things and