Mobile app version of vmapp.org
Login or Join
Samaraweera207

: Replacing non consecutive pages from one (InDesign exported) pdf file to another From single document in InDesign I export 2 pdf files. First pdf file contains all pages as grayscale, second

@Samaraweera207

Posted in: #AdobeIndesign #Pdf

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?

Example:


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.

10.05% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera207

5 Comments

Sorted by latest first Latest Oldest Best

 

@Samaraweera207

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:



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.

10% popularity Vote Up Vote Down


 

@Rambettina927

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.



Also:


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.

10% popularity Vote Up Vote Down


 

@Yeniel278

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


Open the document you want to manipulate.
Open the JavaScript console, you can find it in the debugger.
In console type:

this.insertPages({ nPage: 4 ,cPath:"x:pathcolor.pdf", nStart: 0});
this.insertPages({ nPage: 7 ,cPath:"x:pathcolor.pdf", nStart: 1});
this.insertPages({ nPage: 51 ,cPath:"x:pathcolor.pdf", nStart: 2});
this.insertPages({ nPage: 67 ,cPath:"x:pathcolor.pdf", nStart: 3});
this.insertPages({ nPage: 89 ,cPath:"x:pathcolor.pdf", nStart: 4});

Press ctrl + enterto execure
Save. Your done.


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

Edit

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});
this.insertPages({
nPage: pagebefore,
cPath:"x:pathcolor.pdf",
nStart: i // or use `page` if you have exact same document
});
}

10% popularity Vote Up Vote Down


 

@Connie430

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

10% popularity Vote Up Vote Down


 

@Heady304

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme