Skip to main content
Participant
June 7, 2019
Answered

InDesign CC Variable Data Printing

  • June 7, 2019
  • 1 reply
  • 3190 views

Good Day,

If anyone can help, I would like to know if there is a script that can be used within INDD that will allow me to produce PDF's from specific pages in a multi page document?

For example:

If I have a INDD doc with a Certificate, Letter and Address page can the script say only export Certificate and Address page ignore Letter? I've bee stuck on this for days now . I'm trying to find a solution within INDD without the use of 3rd party software like Fusion Pro.

This is the current code used for multi page output using Fusion Pro

var outputName = GetFileName(FusionPro.Composition.inputFileName)

//CVPI and page name

var a1 = "LETTG371"

var a2 = "Letter"

var b1 = "CRT3G434"

var b2 = "3.5x5.5"

var c1 = "ADDPG123"

var c2 = "12.75x9.75"

var d1 = ""

var d2 = ""

//file seperaator

if (FieldChanged("CVPI") && Field("CVPI") == a1)

{

    FusionPro.Composition.OpenNewOutputFile( outputName + "_"+ a2 +"."+

        FusionPro.Composition.outputFormatExtension);

}

if (FieldChanged("CVPI") && Field("CVPI") == b1)

{

    FusionPro.Composition.OpenNewOutputFile( outputName + "_"+ b2 +"."+

        FusionPro.Composition.outputFormatExtension);

}

if (FieldChanged("CVPI") && Field("CVPI") == c1)

{

    FusionPro.Composition.OpenNewOutputFile( outputName + "_"+ c2 +"."+

        FusionPro.Composition.outputFormatExtension);

}

if (FieldChanged("CVPI") && Field("CVPI") == d1)

{

    FusionPro.Composition.OpenNewOutputFile( outputName + "_"+ d2 +"."+

        FusionPro.Composition.outputFormatExtension);

}

//page seporator

FusionPro.Composition.SetBodyPageUsage(a2, false);

FusionPro.Composition.SetBodyPageUsage(b2, false);

FusionPro.Composition.SetBodyPageUsage(c2, false);

if (Field("CVPI") == a1)

{

FusionPro.Composition.SetBodyPageUsage(a2, true);

}

else

if (Field("CVPI") == b1)

{

FusionPro.Composition.SetBodyPageUsage(b2, true);

}

else

if (Field("CVPI") == c1)

{

FusionPro.Composition.SetBodyPageUsage(c2, true);

}

else

if (Field("CVPI") == d1)

{

FusionPro.Composition.SetBodyPageUsage(d2, true);

}

Thank you for you time

This topic has been closed for replies.
Correct answer Manan Joshi

Hi Greg,

Did you investigate to use the PDF export dialog to input the pages that you want exported. The string format that you can use is using - to denote a range and, separates non continuous pages. Like 1-3,6 will export pages 1,2,3 and 6 of the document

-Manan

1 reply

Manan JoshiCommunity ExpertCorrect answer
Community Expert
June 7, 2019

Hi Greg,

Did you investigate to use the PDF export dialog to input the pages that you want exported. The string format that you can use is using - to denote a range and, separates non continuous pages. Like 1-3,6 will export pages 1,2,3 and 6 of the document

-Manan

-Manan
Community Expert
June 7, 2019

If you need a script to do the same as i discussed above you can follow the correct answer in the thread mentioned below

Re: Exporting individual pages to PDF / Indesign

Edit line no, 22, change myPageName to the string in the format i described in the above post. It should work

-Manan

-Manan
Community Expert
June 9, 2019

Would you happen to know how I can get it to select certain pages without me manually entering the page numbers? I would run a data merge and then only have the script select for example all the 25 years of service recipients? If that makes sense or is it not possible?

I really appreciate your help


Hi Greg,

I would not say it is impossible without knowing the whole scenario, Mike above gave a script see if it fits your need. The key point here is how do you want the script to identify the pages to export. You could have a script that prompts the user for the pages to export, you could name the pages in a specific manner so the script can search based on that or anything that can help identify which pages to export.

-Manan

-Manan