• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
2

SCRIPT: export Page Ranges To Multiple PDFs - fast export workflow

Participant ,
Sep 09, 2024 Sep 09, 2024

Copy link to clipboard

Copied

Hello Adobe Community,

I'm pleased to share my PDF export script with everyone.

 

"exportPageRangesToPDF.jsx"

https://github.com/MoebiusSt/exportPageRangesToPDF.jsx

 

Description:

This InDesign script (Adobe InDesign CC 19.5 currently) exports page ranges to separate PDFs. It provides a fast way to export multiple page ranges from your InDesign document to individual PDF files and reduces file-naming and handling for you. It's become my standart PDF export routine used daily.

 

See screenshots attached.

exportPageRangesToPDFs_screenshot-1.jpgexportPageRangesToPDFs_screenshot-2.jpg

 

 

 

 

 

 

 

 

 

Version:

v2.0, Date: 2024-09-07

 

Features:

  • Export multiple page ranges to individual PDFs
  • Specify export folder and PDF preset to use
  • Manually input page ranges and labels/identifiers for each range
  • Retrieve a list of page ranges from:
    - Previously exported PDFs in the target directory
    - Active document's sections and section markers
    - Currently viewed section(s) for quick versioned export
  • Handle odd/even page starts in PDF view settings (cover sheet YES/NO)
  • Automatic versioning for exported PDFs (can be overridden)
  • Save settings to a document script label for persistence
  • Multi-Language: English, French, German, Spanish, Russian, and Arabic

 

Usage:
Launch the script from within Adobe InDesign's script panel or with your custom keyboard shortcut. Enter your desired page ranges into its edit text box and click "PDF export". It will export all page ranges to PDFs with the given PDF preset and  work folder you provide in its settings. It has many features designed for convenience.

 

Input Format
Each line in the input text area should follow this format:

Page or PageRange(label)
The label in brackets is optional. Do not use commas.

 

Example Input:
1
5-7(Introduction)
8-15
16
17-20(Chapter 2)

Output File Naming
Exported PDF files will be named according to this schema:

[DocumentName]_pages_[PageRange]_[Label-from-brackets-if-given]_v[Version].pdf

Example Output:
MyDocument_pages_1_v1.pdf
MyDocument_pages_5-7_Introduction_v1.pdf
...
MyDocument_pages_17-20_Chapter 2_v1.pdf

Version Control:
The version number will auto-increment if an existing PDF file with the same name is found (e.g., from _v1 to _v2). To overwrite the last PDF file version and suppress version incrementation, add a minus (-) to the end of a line:


1-
5-7(Introduction)-
17-20

In this example, existing v1 PDFs for pages 1 and 5-7 will be overwritten, while the 17-20 range will increment to the next version.

 

Author and Credits:
Author: Stephan Möbius
Original idea: Jongware
Multi-language L10N function: Marc Autret (equalizer.js, 2012)

 

License:
MIT License – Do whatever you like with it, but whatever you do must also adhere to MIT License.

 

Contributing / Support
stephan dot moebius att gmail dot com

 

Caveats - Who will not benefit from this script:
- The script works EXCLUSIVELY WITH ABSOLUTE PAGE NUMBERING.
- It is not designed or tested for Book files (.indb).
- If section prefixes or unconventional page numbering are used, the script will likely give up quickly. Try it in simple, linearly numbered magazines, brochures, etc.
- Does it run on macOS? I can't test it. – The different decoding of file paths was difficult for me. I'm curious if it works.

 

Best regards,
Stephan

TOPICS
Import and export , Scripting

Views

462

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 19, 2024 Oct 19, 2024

Copy link to clipboard

Copied

Hi, thanks a lot for sharing, I tried it on version 18.3 on OSX and it shows this alert

Captura de Pantalla 2024-10-19 a la(s) 13.43.47.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2024 Oct 19, 2024

Copy link to clipboard

Copied

@LMatiel

 

Can you export manually? 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 19, 2024 Oct 19, 2024

Copy link to clipboard

Copied

Hi, yes, without using the script you can make the PDF without any problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2024 Oct 19, 2024

Copy link to clipboard

Copied

@LMatiel 

 

Your screenshot isn't an error generated by script - it's InDesign's error.

 

Are you exporting manually to exactly the same destination? 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 19, 2024 Oct 19, 2024

Copy link to clipboard

Copied

LATEST

It seems that this is it, it does not find the correct destination to save the PDF, it may be that since it was created for Windows there are differences with OSX
The developer himself has the doubt

"Does it run on macOS? I can't test it. – The different decoding of file paths was difficult for me. I'm curious if it works."

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2024 Oct 19, 2024

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines