Create InDesign document with specific preferences UXP
Hi form, this is my first atempt to create a document using UXP plugin.
From the code below the document is creating 6 Pager document with size 100x210mm and with 3mm bleeds as described in the "documentPreferences"
However I'm not able to set "marginPreferences" as 5mm.
The ocde runs well without errors but margins 15mm (which I guess taken from default parameters - I see 15mm margins in the file > new Window)
Could you mabe give me some suggestions?
const { entrypoints } = require("uxp");
const { app } = require("indesign");
//const indesign = require("indesign");
entrypoints.setup({
panels: {
showPanel: {
show({node} = {}) {
document.getElementById("btnCreateTrifold").addEventListener("click", () => {
const doc = app.documents.add({
marginPreferences: {
top: "5mm",
left: "5mm",
bottom: "5mm",
right: "5mm"
},
documentPreferences: {
pageWidth: "100mm",
pageHeight: "210mm",
pagesPerDocument: 6,
documentBleedBottomOffset: "3mm",
documentBleedInsideOrLeftOffset: "3mm",
documentBleedOutsideOrRightOffset: "3mm",
documentBleedTopOffset: "3mm",
facingPages: false,
allowPageShuffle: false,
}
});
console.log(doc.marginPreferences);
// Set margin sizes
// Set the page size for pages 1 and 6
// Stick pages 1, 2 and 3 together
// Stick pages 4, 5 and 6 together
});
}
}
}
});
