Skip to main content
October 30, 2019
Question

Extract PDF with Page Numbers?

  • October 30, 2019
  • 3 replies
  • 3324 views

I have a multi-page PDF where when viewing the pages in thumbnail view are corrected noted with pagination to match the page number that appears on the page itself. Is there a way to extra the pages as single pages while retaining those noted page numbers under the thumbnail--looking for a way to not manually renumber 200+ PDFs. Thanks!

    This topic has been closed for replies.

    3 replies

    Luke Jennings
    Inspiring
    October 30, 2019

    If the original PDF was exported from InDesign, you can re-export to PDF using the option Create separate PDF files, the single PDFs will retain the original page number label. Alternately, you could place the PDF into a new InDesign file (using the place multipage PDF script included with InDesign) and export to separate PDfs.

    Thom Parker
    Community Expert
    Community Expert
    October 30, 2019

    There are two types of page numbers in a PDF, there is the actual page number, and the page label. So if you have a single page PDF, then the page number will always be 1, because it's the first page. However, the page label can be anything, such as 5, IV, or Boo. You can make it whatever you want. 

     

    So if you want to maintian the printed label on the page as the electronic Label (displayed page num), then you need to set it.   Unfortunately, page labels do not survive page extraction, so setting it in the original doc doesn't help. However, a script can be written to do the extraction and set the label of the extracted page to match the original page number, so you don't have to do this process manually.   

    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
    Participating Frequently
    January 13, 2020

    Hi Thom,

    Your reply mentions a script can set the label of the extracted pages. I have a very simple javascript that is used in an action to extract pages, name the file and save. Is there any way to incorporate setting the electronic label in this?

     

    this.extractPages(2, 24, "01 first.pdf");

    this.extractPages(15, 18, "01a second.pdf");

    this.extractPages(25, 27, "02 third.pdf");

    this.extractPages(28, 35, "03 fourth.pdf");

    this.extractPages(36, 41, "04 fifth.pdf");

     

    The extract works great but I currently have to manually change the electronic page label on all the extracted files. 

     

    Thanks,

    Shelley

     

     

     

    Thom Parker
    Community Expert
    Community Expert
    January 15, 2020

    It's the "doc.setPageLabels()" function. Here's the reference entry

    https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FDoc_methods.htm%23TOC_setPageLabelsbc-101&rhtocid=_6_1_8_23_1_100

     

    If you don't include the path in the extractPages function it will return the doc object. Then the script could set the page label, and save the file before extracting the next one. 

    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
    Participant
    October 30, 2019

    what do you mean extra the pages?

    Working with multiple pages i usually work with "thumbnail" and "header & footer". 4-5 years back a go I would renumber it manually. Now everything is automatic.