From single document in InDesign I export 2 pdf files.

First pdf file contains all pages as grayscale, second pdf document contains only colour pages. Color pages pdf document carries information about page numbers.

How can I automatically replace relevant grayscale pages in first PDF document with respective colour pages from second PDF document?


  • 1st exported PDF document has 100 grayscale pages.
  • 2nd PDF document has color pages i.e.: 5,8,52,68,90.

I want to put these color pages from second PDF document into the first PDF document at once, by replacing the respective grayscale pages in it.

  • Do you have only 5 pages to replace?
    – go-junta
    Aug 20, 2015 at 9:20
  • 1
    5 pages is a bit problematic for the printer, usulally you add pages at a multiple of 4 since each separate page adds reader pages worth of paper.
    – joojaa
    Aug 21, 2015 at 7:06
  • @joojaa It is just an example, but not his is not a point. First I have to prepare document in one-production (an this topic is about it) and in the end I make the 4-up production.
    – Lubos
    Aug 21, 2015 at 19:36

5 Answers 5


I don't think there is a way for InDesign to manage this task unless you break each section into its own file and assemble it as an InDesign book (maybe?). That's probably more of a hassle than you want to deal with. However, PDFTK (PDF Toolkit) is a free tool that has (among other things) a combine function that will allow you to accomplish this via traditional command line, their more friendly command line tool or a batch file. You will place both color and BW PDF's in the same folder, run the command, and it will output the combined PDF per your pre-determined specifications.

  • Thanks for a tip, in another words I need to update/replace pages in BW pdf document with all the pages from color document. Is there an update command for pdftk server command line?
    – Lubos
    Aug 20, 2015 at 16:17
  • There is no "update" per se, but what you want can be achieved with PDFTK using the same commands used to create the original combined PDF. You simply drop the newly revised files into the working folder and run the command again. It's unnecessary to replace bad pages when it's so easy to completely rebuild from updated source files.
    – 13ruce
    Aug 20, 2015 at 17:02
  • For example, if you have edited some of the bw pages, just export a new bw pdf and replace the old one (being sure the keep file names and page counts the same). Run the command again and PDFTK will output a new combined pdf containing the updated content.
    – 13ruce
    Aug 20, 2015 at 17:04
  • I am not sure who of us does not understand so I will give an example again. We are printing books on color digital printing machines. The problem is, that the printing machine price for color page is about 3x more expansive than bw so I want to make sure that bw pages in printed file are REALLY bw. So when I want to get the printing pdf file from InDesign I do it the following way. I export all the pages of the book as b/w with InDesign export setting with bw profile (this is the 1st file with all the pages bw).
    – Lubos
    Aug 20, 2015 at 20:58
  • Then I export only color pages from the same InDesign file (this is the 2nd file with color pages, here are usually only several pages). Now comes the point. So far I had to manually drag and drop color pages, page by page, from 2nd file to 1st file, replacing respective bw pages by color ones. Sometimes it takes a time and you have to be careful not to make mistake. That's why I am looking for the solution how to replace the pages automatically. Acrobat allows to replace just the group of consecutive pages.
    – Lubos
    Aug 20, 2015 at 20:59

You can do this in Acrobat Pro. You can do this manually trough the GUI but it might get involved so you can just type this in the JavaScript console

  1. Open the document you want to manipulate.

  2. Open the JavaScript console, you can find it in the debugger.

  3. In console type:

    this.insertPages({ nPage: 4 ,cPath:"x:\\path\\color.pdf", nStart: 0});
    this.insertPages({ nPage: 7 ,cPath:"x:\\path\\color.pdf", nStart: 1});
    this.insertPages({ nPage: 51 ,cPath:"x:\\path\\color.pdf", nStart: 2});
    this.insertPages({ nPage: 67 ,cPath:"x:\\path\\color.pdf", nStart: 3});
    this.insertPages({ nPage: 89 ,cPath:"x:\\path\\color.pdf", nStart: 4});
  4. Press ctrl + enterto execure

  5. Save. Your done.

You can also do this from command line. Or togh the Acrobat API.


For a bit better usability use:

var pages = [0,2];
for (var i = 0; i < pages.length;i++){
    var page = pages[i];
    var pagebefore = page-1;
    this.deletePages({nStart: page});
         nPage: pagebefore,
         nStart: i // or use `page` if you have exact same document
  • Good to know. Does that also delete the bw analogs?
    – 13ruce
    Aug 21, 2015 at 11:59
  • @13ruce no that would be this.deletePages. I was a bit distracted by other things when i wrote this
    – joojaa
    Aug 21, 2015 at 13:51
  • @13ruce Added a slightly more usable script
    – joojaa
    Aug 24, 2015 at 6:33

1. Color Swatches

If it was my project, I would update my color swatches to grayscale and the style will be updated as well. Or vice versa.

Of course, it's something easier to do if you plan from the start that you'll use 2 versions; this way you add color swatches for your grayscale 60% and name them this way, and then replace that recipe with the color one you want. Or vice versa. I hope I make sense.

2. Pictures: Move them

If you have a lot of pictures to replace, you can always move the color pictures somewhere else and put the grayscale in the linked folder, using the same names.

Then you go in the Links panel and simply relink one image that is now in the linked folder, and it will link back all the others as well from the same folder with the same name... They will get updated in InDesign, at the same exact size and position.

It's really the fastest way to update everything. If you have a lot of pictures to update, I don't know exactly if it works for InDesign but in Quark, I even put my mouse on the numeral keypad Enter Key and its weight presses the "ok" button to update, so I don't even need to click anything if there's a lot of images to update :D (I know it's ultra lazy, but admit it, it's clever!)

3. 2x Documents

Personally, I prefer to prepare 2 documents for this; one grayscale and one in color. If there's lot of changes, I simply use the grayscale version as main one and then do a duplicate in color with the tricks above. My priority will always be on the version that goes on press and I guess it's the grayscale one for you.

4. Why not use the "insert" command in Acrobat Pro

You can still do what I mentioned above, export your 5 pages from InDesign and then use the "insert" command in Acrobat Pro to replace the grayscale pages with the color ones. Or Vice Versa.

That seems faster than trying to find "automatic" solutions and at least you can verify manually if you replaced the right pages.


  • Printers usually ignore registration marks when there's obviously only these using CMY, just so you know. You simply need to mention it's a one color job and you'll be fine. When they "rip" your work, they don't send 4 separations for no reasons, plates are not free. And real proofs are done with the exact color separations too.
  • And there's no color separation on digital printing, it's like printing grayscale on your home inkjet.
  • InDesign colorbars are decorative to printers as well, they use their own.
  • With Acrobat Pro you can always flatten all this to grayscale in Preflight if you want to be certain there's no CMY left and it can even convert your whole PDF to grayscale, if that can help. I still suggest you do your color changes in InDesign and adjust your grayscale pictures in Photoshop for better results.
  • One last thing, if that project is meant to be printed, know that you could always provide your 5 color pages as a separate document and mention to your printer where they go. As Jooja mentioned, these will be printed separately anyway and need to be 'imposed'. In fact the printer himself will isolate them to print them separately...! So maybe you could ask the printer if you can simply provide a 5 pages PDF with your color pages and add a note on the grayscale pages in the PDF to mention the color page goes there.
  • Thanks for your long answer. Yes, I can insert or replace pages with "insert" command, but only series of consecutive pages. Also Acrobat Pro Preflight allows me to change page content into gray, but again only series of consecutive pages or current page. My problem is, better said was, that the pages I need to replace are far not consecutive, but random and sometimes there are quite a lot of them. I have found solution thanks to 13ruce advise to use PDF Toolkit and combine two files into the third one.
    – Lubos
    Aug 28, 2015 at 20:31
  • The only bad thing on it is, that you need to write PDFTK string defining how to combine the pages in files. I made a simple Excel VBA macro based file which I will try to post in a while.
    – Lubos
    Aug 28, 2015 at 20:32

Thanks a lot to everyone who tried to find solution of my problem. Special thanks to @13ruce advice I found very nice and simple solution.

I use PDF Toolkit server and its feature of combining two files into the third one.

The general PDFTK string is:

pdftk K=black.pdf C=color.pdf cat K1-2 C3 C4 C5 C6 C7 C8 C9 C10 K11 K12 output out.pdf

In this example the output.pdf will contain pages 1-2 from black.pdf, pages 3-10 from color.pdf and again pages 11-12 from black.pdf.

The only time consuming thing can be writing this string, especially, when the color pages are randomly distributed over the whole range of pages. That is why I programmed a simple utility in MS Excel, using VBA macro, that automatically creates this string. You can download it free.

It looks like this:

enter image description here

Here are some instructions:

After opening xlsm file, macros need to be allowed. Insert Total pages in document (cell B1). Define which pages will be replaced by color ones (cell B2). The last defined color page must be lower or equal the total pages. Color pages must be comma separated, without space. In defining the page range dashes are not allowed in this version. Press Create PDTK String and the PDFTK String will be written into cell B4.

If you have PDFTK server installed, you can use Total Commander to run PDFTK string. Just open it in the subfolder when your processed files are and insert PDFTK string into Command window of Total Commander. See the next picture.

black.pdf document contains all the document pages as black (grayscale), color.pdf document contains the same pages as color, out.pdf document contains all the black pages but pages defined in cell B2 are replaced by color ones.

I hope it will be helpful for someone. Feel free to give me ideas for improvements.

enter image description here


Use Adobe Acrobat 3D to replace pages in pdf file.

  • 3
    Can you edit your answer and explain a bit more how Acrobat 3D can fix that issue?
    – go-junta
    Aug 20, 2015 at 9:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.