Skip to main content
Known Participant
April 14, 2014
Answered

Scripting the Printing Booklet...

  • April 14, 2014
  • 2 replies
  • 1789 views

Hey there...

I'm trying to help a friend making the automation for some tasks on InDesign.

He want's to print the document as a booklet (he's making books), but seems like he can only print as a PostScript Printer... and then use Distiller to transform it to PDF.

So... first thing first...

I'm trying to:

  1. Define PrintBooklet Settings (done)
  2. Define PrintPreset Settings (done)
  3. Print using app.activeDocument.printBooklet();

This works but... asks me where I want to save and what name I want to give to it.

I wanted to automate this completely... because I need to print it twice (the book is composed of 2 booklet printings).

Is it possible to use app.activeDocument.printBooklet(); (or other instruction) and print it wherever I want with the name I want (I would have to make some kind of rule).

I tried app.activeDocument.printBooklet(false); but seems to be "lost in the air".

Can anyone help me? Do you need the whole code or is this enough to understand what I need?

Many thanks for the help.

This topic has been closed for replies.
Correct answer Jump_Over

Hi,

Current printer supposed to be defined as postscript and

use:

app.activeDocument.printBookletPrintPreferences.printFile = File("fullPathToFile.ps");

as many times as you want before calling printBooklet(false, yourPreset)

Jarek

2 replies

Community Expert
July 6, 2021

Hi lf.corullon,

I think, you always get a PostScript file with printBooklet() .

 

A possible workflow:

Prepare a hot folder for Acrobat Distiller with dedicated joboptions.

In Distiller menu Settings > Watched folders…

When your PostScript file from printBooklet() is finished writing just move the *.ps file to that hot folder.

 

FWIW: You can start Acrobat Distiller with ExtendScript.

Use method execute() on the PostScript file ( if suffix *.ps is connected with Acrobat Distiller ).

Or use the same method on the Distiller's exe file ( not tested ).

 

Regards,
Uwe Laubender

( ACP )

lfcorullon13651490
Legend
July 6, 2021

Nice, Uwe. That's exactly what I did.

I used the execute() to run Distiller case the exe path I set is valid.

 

Thank you! Your answer makes me think I am on the right way.

Jump_Over
Jump_OverCorrect answer
Legend
April 14, 2014

Hi,

Current printer supposed to be defined as postscript and

use:

app.activeDocument.printBookletPrintPreferences.printFile = File("fullPathToFile.ps");

as many times as you want before calling printBooklet(false, yourPreset)

Jarek

lfcorullon13651490
Legend
July 3, 2021

A loooong time passed, I know...

But I'm trying to print a booklet to PDF, using javascript.

Almost same situation... but I don't want PS file, I need PDF.

 

Is this possible?

 

with (doc.printBookletOptions) {
	autoAdjustMargins = true;
	bookletType = (dsc) ? BookletTypeOptions.TWO_UP_PERFECT_BOUND : BookletTypeOptions.TWO_UP_SADDLE_STITCH;
	pageRange = drange;
	printBlankPrinterSpreads = true;
	if (dsc) signatureSize = dsign;
	}
with (doc.printBookletPrintPreferences) {
	activePrinterPreset = dprpres;
	printFile = File(dpath + "/" + dname + ".pdf");
	}
doc.printBooklet(false , dprpres);

Thanks in advance.

rob day
Community Expert
Community Expert
July 6, 2021

I posted a script a few days ago that exports imposed (2-up) documents directly to PDF—there’s no Postscript involved. It does both saddle stitch and signatures for perfect binding. I’ve only tested it in-house, so would be curious if anyone runs into bugs.

 

The dialog:

 

 

 

 

 

 

 

 

 

https://shared-assets.adobe.com/link/3bfdb004-f188-4f3d-5904-d82dd8f8e2d1