Skip to main content
Known Participant
May 8, 2026
Question

How can we get Adobe to add a pdf export option as "printer spreads"?

  • May 8, 2026
  • 6 replies
  • 87 views

InDesign users need a way to easily export documents as print spreads (imposed from reader spreads) from the “print booklet” option. Currently I can either print to my home printer or print to postscript, but not print to pdf. Distiller is no longer up to the task of handling complex postscipt files. Print designers need a way, when print shops request it, to send these types of files. As a layout program, this feature should have been baked in from the beginning. 

    6 replies

    Community Expert
    May 11, 2026

    This was testing script for me and did what I think you want it to do - no idea how I got there, I’m script cobbler so I found a way eventually - pretty sure I had 90% of a similar script already so just had to wangle some other scripts I had to do what I wanted.

    It’s not the best but the best I could come up with. 

     

    // Intentionally no #target directive: run in the InDesign version that launched this script.

    var PRESET_LABEL_KEY = "printerSpreadsPdf.lastPreset";
    var VIEW_PDF_LABEL_KEY = "printerSpreadsPdf.viewPdf";
    var CROP_MARKS_LABEL_KEY = "printerSpreadsPdf.cropMarks";
    var USE_BLEED_LABEL_KEY = "printerSpreadsPdf.useDocumentBleed";

    function main() {
    if (app.documents.length === 0) {
    alert("Open a document before running this script.");
    return;
    }

    var doc = app.activeDocument;
    var pageCount = doc.pages.length;

    if (pageCount === 0) {
    alert("This document has no pages to export.");
    return;
    }

    if (pageCount % 4 !== 0) {
    alert("Printer spread export needs a page count that is a multiple of 4.\r\rCurrent page count: " + pageCount);
    return;
    }

    var printerSpreadOrder = buildPrinterSpreadOrder(pageCount);
    var printerSpreadPairs = describePrinterSpreadPairs(doc, printerSpreadOrder);
    var exportOptions = chooseExportOptions(printerSpreadPairs);
    if (!exportOptions) {
    return;
    }

    var pdfFile = choosePdfFile(doc);
    if (!pdfFile) {
    return;
    }

    try {
    exportPrinterSpreadPdf(doc, pdfFile, exportOptions, printerSpreadOrder);
    } catch (e) {
    alert("Printer spread PDF export failed:\r" + e);
    return;
    }

    alert("Printer spread PDF exported:\r" + pdfFile.fsName);
    }

    function buildPrinterSpreadOrder(pageCount) {
    var order = [];
    var low = 0;
    var high = pageCount - 1;

    while (low < high) {
    order.push(high);
    order.push(low);
    low++;
    high--;

    order.push(low);
    order.push(high);
    low++;
    high--;
    }

    return order;
    }

    function describePrinterSpreadPairs(doc, order) {
    var pairs = [];
    for (var i = 0; i < order.length; i += 2) {
    pairs.push(doc.pages[order[i]].name + " + " + doc.pages[order[i + 1]].name);
    }
    return pairs.join("\r");
    }

    function chooseExportOptions(printerSpreadPairs) {
    if (app.pdfExportPresets.length === 0) {
    alert("No PDF export presets are available.");
    return null;
    }

    var dialog = new Window("dialog", "Export PDF Printer Spreads");
    dialog.orientation = "column";
    dialog.alignChildren = "fill";
    dialog.margins = 18;
    dialog.spacing = 10;

    var presetGroup = dialog.add("group");
    presetGroup.add("statictext", undefined, "PDF preset:");
    var presetOptions = getPresetOptions();
    var presetDropdown = presetGroup.add("dropdownlist", undefined, presetOptions.names);
    presetDropdown.selection = presetOptions.defaultIndex;

    var pairsPanel = dialog.add("panel", undefined, "Printer spread pairs");
    pairsPanel.orientation = "column";
    pairsPanel.alignChildren = "fill";
    pairsPanel.margins = 12;
    var pairsField = pairsPanel.add("edittext", undefined, printerSpreadPairs, { multiline: true, readonly: true });
    pairsField.characters = 35;
    pairsField.preferredSize.height = 120;

    var viewPdfCheckbox = dialog.add("checkbox", undefined, "View PDF after exporting");
    viewPdfCheckbox.value = app.extractLabel(VIEW_PDF_LABEL_KEY) === "true";

    var marksPanel = dialog.add("panel", undefined, "Marks and bleed");
    marksPanel.orientation = "column";
    marksPanel.alignChildren = "left";
    marksPanel.margins = 12;

    var cropMarksCheckbox = marksPanel.add("checkbox", undefined, "Crop marks");
    cropMarksCheckbox.value = app.extractLabel(CROP_MARKS_LABEL_KEY) === "true";

    var useBleedCheckbox = marksPanel.add("checkbox", undefined, "Use document bleed settings");
    useBleedCheckbox.value = app.extractLabel(USE_BLEED_LABEL_KEY) === "true";

    var buttons = dialog.add("group");
    buttons.alignment = "right";
    buttons.add("button", undefined, "Cancel", { name: "cancel" });
    buttons.add("button", undefined, "Export", { name: "ok" });

    if (dialog.show() !== 1) {
    return null;
    }

    if (!presetDropdown.selection || presetDropdown.selection.index === 0) {
    alert("Choose a PDF preset before exporting.");
    return chooseExportOptions(printerSpreadPairs);
    }

    app.insertLabel(PRESET_LABEL_KEY, presetDropdown.selection.text);
    app.insertLabel(VIEW_PDF_LABEL_KEY, viewPdfCheckbox.value ? "true" : "false");
    app.insertLabel(CROP_MARKS_LABEL_KEY, cropMarksCheckbox.value ? "true" : "false");
    app.insertLabel(USE_BLEED_LABEL_KEY, useBleedCheckbox.value ? "true" : "false");

    return {
    preset: app.pdfExportPresets.itemByName(presetDropdown.selection.text),
    viewPdf: viewPdfCheckbox.value,
    cropMarks: cropMarksCheckbox.value,
    useDocumentBleed: useBleedCheckbox.value
    };
    }

    function getPresetOptions() {
    var names = ["Please Select PDF Setting"];
    var lastPreset = app.extractLabel(PRESET_LABEL_KEY);
    var defaultIndex = 0;

    for (var i = 0; i < app.pdfExportPresets.length; i++) {
    var presetName = app.pdfExportPresets[i].name;
    names.push(presetName);
    if (presetName === lastPreset) {
    defaultIndex = i + 1;
    }
    }

    return {
    names: names,
    defaultIndex: defaultIndex
    };
    }

    function choosePdfFile(doc) {
    var defaultName = getDefaultPdfName(doc);
    var defaultFile = null;

    try {
    if (doc.saved) {
    defaultFile = File(doc.fullName.parent.fsName + "/" + defaultName);
    }
    } catch (e) {
    defaultFile = null;
    }

    var chosen = defaultFile
    ? defaultFile.saveDlg("Export printer spread PDF as", "PDF:*.pdf")
    : File.saveDialog("Export printer spread PDF as", "PDF:*.pdf");
    if (!chosen) {
    return null;
    }

    if (!/\.pdf$/i.test(chosen.name)) {
    chosen = File(chosen.fsName + ".pdf");
    }

    return chosen;
    }

    function getDefaultPdfName(doc) {
    var baseName = "Printer Spreads";

    try {
    if (doc.saved) {
    baseName = stripExtension(doc.fullName.name);
    } else if (doc.name) {
    baseName = stripExtension(doc.name);
    }
    } catch (e) {}

    return baseName + "_printer_spreads.pdf";
    }

    function stripExtension(fileName) {
    return String(fileName).replace(/\.[^\.]+$/, "");
    }

    function exportPrinterSpreadPdf(doc, pdfFile, exportOptions, printerSpreadOrder) {
    var originalPreferences = app.pdfExportPreferences.properties;
    var originalMeasurementUnit = app.scriptPreferences.measurementUnit;
    var originalPdfPageNumber = app.pdfPlacePreferences.pageNumber;
    var originalPdfCrop = app.pdfPlacePreferences.pdfCrop;
    var imposedDoc = null;
    var sourcePdf = null;

    try {
    app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;

    var pageSize = getPageSize(doc.pages[0]);
    var bleed = getDocumentBleed(doc, exportOptions.useDocumentBleed);
    sourcePdf = createTemporarySourcePdf(doc, exportOptions.preset, exportOptions.useDocumentBleed);
    imposedDoc = createImposedDocument(pageSize, bleed, printerSpreadOrder.length / 2);
    placePrinterSpreadPages(imposedDoc, sourcePdf, printerSpreadOrder, pageSize, bleed);

    app.pdfExportPreferences.properties = exportOptions.preset.properties;
    app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES;
    app.pdfExportPreferences.exportReaderSpreads = false;
    app.pdfExportPreferences.viewPDF = exportOptions.viewPdf;
    applyMarksAndBleedOptions(exportOptions);

    imposedDoc.exportFile(ExportFormat.PDF_TYPE, pdfFile, false);
    } finally {
    app.pdfExportPreferences.properties = originalPreferences;
    app.pdfPlacePreferences.pageNumber = originalPdfPageNumber;
    app.pdfPlacePreferences.pdfCrop = originalPdfCrop;
    app.scriptPreferences.measurementUnit = originalMeasurementUnit;
    if (imposedDoc && imposedDoc.isValid) {
    imposedDoc.close(SaveOptions.NO);
    }
    if (sourcePdf && sourcePdf.exists) {
    sourcePdf.remove();
    }
    }
    }

    function createTemporarySourcePdf(doc, preset, useDocumentBleed) {
    var sourcePdf = File(Folder.temp.fsName + "/" + stripExtension(doc.name) + "_printer_spreads_source_" + new Date().getTime() + ".pdf");

    app.pdfExportPreferences.properties = preset.properties;
    app.pdfExportPreferences.pageRange = PageRange.ALL_PAGES;
    app.pdfExportPreferences.exportReaderSpreads = false;
    app.pdfExportPreferences.viewPDF = false;
    app.pdfExportPreferences.cropMarks = false;
    app.pdfExportPreferences.bleedMarks = false;
    app.pdfExportPreferences.registrationMarks = false;
    app.pdfExportPreferences.colorBars = false;
    app.pdfExportPreferences.pageInformationMarks = false;
    app.pdfExportPreferences.useDocumentBleedWithPDF = useDocumentBleed;

    doc.exportFile(ExportFormat.PDF_TYPE, sourcePdf, false);
    if (!sourcePdf.exists) {
    throw new Error("Could not create the temporary single-page PDF.");
    }

    return sourcePdf;
    }

    function getPageSize(page) {
    var bounds = page.bounds;
    return {
    width: Number(bounds[3]) - Number(bounds[1]),
    height: Number(bounds[2]) - Number(bounds[0])
    };
    }

    function getDocumentBleed(doc, enabled) {
    if (!enabled) {
    return { top: 0, bottom: 0, inside: 0, outside: 0 };
    }

    var prefs = doc.documentPreferences;
    return {
    top: Number(prefs.documentBleedTopOffset) || 0,
    bottom: Number(prefs.documentBleedBottomOffset) || 0,
    inside: Number(prefs.documentBleedInsideOrLeftOffset) || 0,
    outside: Number(prefs.documentBleedOutsideOrRightOffset) || 0
    };
    }

    function createImposedDocument(pageSize, bleed, sheetCount) {
    var doc = app.documents.add(false);

    try {
    doc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
    } catch (e) {}

    doc.documentPreferences.facingPages = false;
    doc.documentPreferences.pageWidth = pageSize.width * 2;
    doc.documentPreferences.pageHeight = pageSize.height;
    doc.documentPreferences.documentBleedTopOffset = bleed.top;
    doc.documentPreferences.documentBleedBottomOffset = bleed.bottom;
    doc.documentPreferences.documentBleedInsideOrLeftOffset = bleed.outside;
    doc.documentPreferences.documentBleedOutsideOrRightOffset = bleed.outside;

    while (doc.pages.length < sheetCount) {
    doc.pages.add(LocationOptions.AT_END);
    }

    while (doc.pages.length > sheetCount) {
    doc.pages[doc.pages.length - 1].remove();
    }

    return doc;
    }

    function placePrinterSpreadPages(doc, sourcePdf, order, pageSize, bleed) {
    app.pdfPlacePreferences.pdfCrop = bleed.top || bleed.bottom || bleed.inside || bleed.outside
    ? PDFCrop.cropBleed
    : PDFCrop.cropTrim;

    for (var i = 0; i < order.length; i += 2) {
    var sheetPage = doc.pages[i / 2];
    placePdfPage(sheetPage, sourcePdf, order[i] + 1, [
    -bleed.top,
    -bleed.outside,
    pageSize.height + bleed.bottom,
    pageSize.width + bleed.inside
    ]);
    placePdfPage(sheetPage, sourcePdf, order[i + 1] + 1, [
    -bleed.top,
    pageSize.width - bleed.inside,
    pageSize.height + bleed.bottom,
    pageSize.width * 2 + bleed.outside
    ]);
    }
    }

    function placePdfPage(sheetPage, sourcePdf, sourcePageNumber, bounds) {
    app.pdfPlacePreferences.pageNumber = sourcePageNumber;

    var frame = sheetPage.rectangles.add();
    frame.geometricBounds = bounds;
    frame.strokeWeight = 0;
    frame.place(sourcePdf);
    frame.fit(FitOptions.PROPORTIONALLY);
    frame.fit(FitOptions.CENTER_CONTENT);
    }

    function applyMarksAndBleedOptions(exportOptions) {
    app.pdfExportPreferences.cropMarks = exportOptions.cropMarks;
    app.pdfExportPreferences.bleedMarks = false;
    app.pdfExportPreferences.registrationMarks = false;
    app.pdfExportPreferences.colorBars = false;
    app.pdfExportPreferences.pageInformationMarks = false;
    app.pdfExportPreferences.useDocumentBleedWithPDF = exportOptions.useDocumentBleed;
    }

    main();

     

    rob day
    Community Expert
    Community Expert
    May 8, 2026

    Print designers need a way, when print shops request it,

     

    I would question the competence of a printer who can‘t handle imposition. It’s similar to trapping, which is also a printer task. InDesign lets you set trapping rules, which may be applied when printing separations, but are not applied to the document pages or a PDF export.

    Community Expert
    May 8, 2026

    Absolutely, I agree 100%. InDesign is page layout tool. There’s imposition software out there for imposition, there’s some good really cheap ones that do really good basic impositions and  you can wrangle them for more complex - then you have the upper end like Preps which is probably too much for a lot of people. 

     

    But ideally the printer should always handle the imposition - and if they can’t it raises red flags about their operation.

    Community Expert
    May 8, 2026

    I have a couple of PDF export scripts hanging around and I was testing the logic in a script and it works for a very basic case. But is failing for more robust scenarios. 

    If your goal is a PDF that you can print as Printer Spreads then the advice is Acrobat and Print Booklet - as you’re looking to make a PDF anyway - so you can make a normal PDF and acrobat can print the booklet. 
    I see no hangups here in workflows. 

    However, if you give me the weekend I’ll keep working the script and finding other scripts to see how they work and see if I can get something together. 

    There’s probably imposition scripts already out there - but if nothing is working - happy to put something together and see if it works.

     

    BobLevine
    Community Expert
    Community Expert
    May 8, 2026

    The best advice I can give you is to give up the idea that imposition is part of a pagelayout application. It’s not. If you need in house booklets, export to PDF properly and use Acrobat’s booklet printing feature. Postscript is dead.

    I know it’s not what you want to hear, but it is what it is. 

    leo.r
    Community Expert
    Community Expert
    May 8, 2026

    I guess it’s an alternative version of the feature request you already made yesterday… Did you get a chance to try the virtual PDF printer approach I suggested? 

    Community Expert
    May 8, 2026

    Export to PDF then print from Acrobat which has the booklet option. 

    That’s generally the best way.