Copy link to clipboard
Copied
Hi forum,
I’m writing a script for InDesign Server without having it installed. To be more exact, I want it to work in both versions server and desktop. In the end, it should export a PDF file. I noticed that, unlike the desktop, the server version has the withGrids parameter —
If true, exports the grids. (Optional) (default: false) — which is not very informative to me. I guess it’s equivalent to the ‘visible guides and baseline grids’ check box in the ‘export pdf’ dialog box.
Can anybody confirm/disprove/explain to me what it does?
— Kas
Copy link to clipboard
Copied
I've never used that option in ID Server scripts (mainly because I wasn't aware of it). You can simply leave it out.
A parameter that does matter is the third one in Desktop, which tells InDesign whether to show the export window. That doesn't exist in ID Server, so you should test whether the script runs in Server or Desktop. So Desktop uses
exportFile (format, file, true/false, preset)
while Server uses
exportFile (format, file, preset)
P.
Copy link to clipboard
Copied
Hi Peter,
Yes, I know the difference and handle it in my script like so:
var desktop = (app.name == "Adobe InDesign");
if (desktop) {
inddDoc.exportFile(ExportFormat.PDF_TYPE, pdfFile, false, pdfPreset); // format, to, showingOptions, using
}
else {
inddDoc.exportFile(ExportFormat.PDF_TYPE, pdfFile, pdfPreset, false); // format, to, using, withGrids
}
I wonder what withGrids does? If I had IDS, I'd export a PDF with this parameter on and off to see the difference.
— Kas
Copy link to clipboard
Copied
I imagine that it exports the visible grids and baselines. You can set that in the preset, maybe the script parameter is intended to override the preset. Which begs the question why this parameter and not others. As usual, the object model's description isn't exactly enlightening.
Why don't you let your customer run a test in ID Server of two scripts, one with withGrids enabled, the other, disabled?