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

How to Quickly Insert Pages from One InDesign Document into Another

New Here ,
Oct 08, 2024 Oct 08, 2024

Copy link to clipboard

Copied

Hello

I have two InDesign documents. A first (A) of 300 different pages and a second (B) of 1 page.

I want to insert the second document (B) after each of the 300 pages, for a total of 600 pages. That is: A1-B-A2-B-A3-B-A4-B…. Up to….A299-B-A300-B What would be the quickest method?

THANKS


<Title renamed by MOD>
TOPICS
How to

Views

463

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 08, 2024 Oct 08, 2024

Copy link to clipboard

Copied

Write a script, or get someone to write a script. There is no built-in feature in InDesign to do it.

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 08, 2024 Oct 08, 2024

Copy link to clipboard

Copied

Create PDFs of each file. Check out PDFsam Basic, a free open-source program. It can do an alternative mix of the pages. 

https://pdfsam.org/

 

David Creamer: Community Expert (ACI and ACE 1995-2023)

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 08, 2024 Oct 08, 2024

Copy link to clipboard

Copied

Put all INDD files into a book INDB and export from there all you need. 

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 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

quote

Put all INDD files into a book INDB and export from there all you need. 


By @Willi Adelberger

 

How this will mix pages from both files? 

 

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 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

Hi @Eugene Tyson , Think you need pages[i] not pages[0]

 

insertDoc.pages[i].duplicate(LocationOptions.AFTER, mainDoc.pages[addPageLocation]);

 

Also if the docs are facing pages the allow shuffle prefs will matter, and you might need to consider the masterspreads contents.

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 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

@rob day

 

But doc "B" is the one page document, and this single page should be inserted after every page in the doc "A"?

 

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 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

Thanks missed that.

 

If the doc is facing the shuffle prefs still need to be checked, and does B have masterpage items?

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 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

With a facing page document without setting shuffle prefs I get this before and after:

Screen Shot 20.png

 

Screen Shot 18.png

 

With this:

 

var mainDoc = app.activeDocument; // Assuming this is Document A
//make sure to allow shuffling
mainDoc.spreads.everyItem().allowPageShuffle = true;
mainDoc.documentPreferences.properties = {allowPageShuffle:true};

var insertDoc = app.documents.itemByName("B.indd"); // Open Document B separately

//bring any masterpageitems?
var mpi = insertDoc.pages[0].masterPageItems;
for (var i = 0; i < mpi.length; i++){
    mpi[i].override(insertDoc.pages[0])
};   


var addPageLocation = 0;  
var docLength = mainDoc.pages.length;  // Start with the original length of Document A
var p 
for (var i = 0; i < docLength; i++) {

    // Duplicate the page from Document B to Document A after each page
    p = insertDoc.pages[0].duplicate(LocationOptions.AFTER, mainDoc.pages[addPageLocation]);
    //remove the insert page’s section?
    p.appliedSection.remove()

    // Update the page location to skip over the newly added page from Document B
    addPageLocation += 2;
}


 

 

Screen Shot 19.png

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 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

Sometimes I think that scripters only know script-based solutions. 😁 I was able to combine two 1000-page documents with an alternative mix using PDFsam Basic in less than a minute.

 

David Creamer: Community Expert (ACI and ACE 1995-2023)

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 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

@Dave Creamer of IDEAS

 

Yeah. But it depends on what you need - just print - or edit something afterwards... 

 

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 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

True enough!

David Creamer: Community Expert (ACI and ACE 1995-2023)

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 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

LATEST

Great you mentioned this. 

 

And I've done something similar in the past but not sure how or remember when or what I used. 

 

I think someone have me a script up use in acrobat. 

 

Since you have this option I thought I'd try offer the way I may have approached it before. 

 

It's a good suggestion, along with the book file. 

 

I think there is many ways to do it. And great we all come together to share experience

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 08, 2024 Oct 08, 2024

Copy link to clipboard

Copied

Try it out on a duplicate set of files - I'm not the best scripter

 

Found a script here that looks like what you want

https://stackoverflow.com/questions/57545582/indesign-script-to-add-a-page-to-every-given-page

 

Haven't tested it properly but I suspect this might work better with a tweak 

var mainDoc = app.activeDocument; // Assuming this is Document A
var insertDoc = app.documents.itemByName("B.indd"); // Open Document B separately

var addPageLocation = 0;  
var docLength = mainDoc.pages.length;  // Start with the original length of Document A

for (var i = 0; i < docLength; i++) {

    // Duplicate the page from Document B to Document A after each page
    insertDoc.pages[0].duplicate(LocationOptions.AFTER, mainDoc.pages[addPageLocation]);

    // Update the page location to skip over the newly added page from Document B
    addPageLocation += 2;
}

 

 

 

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 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

@Eugene Tyson

 

It should work - I'm on my phone so can't test your code.

 

But just in case, in situations like this - it's better to iterate backward. 

 

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
Guide ,
Oct 09, 2024 Oct 09, 2024

Copy link to clipboard

Copied

Correction:

 

    var myPage = insertDoc.pages[0].duplicate(LocationOptions.AFTER, mainDoc.pages[addPageLocation]);
    myPage.appliedSection.remove();

 

(^/)  The Jedi

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