I am trying to reliably retrieve "spread bounds" which, if I did not miss anything, is only possible via page bounds. So, to get the spread bounds I would do something like this:
var spreadBounds = [spread.pages.bounds, spread.pages.bounds, spread.pages.bounds, spread.pages[-1].bounds ];
(this assumes that all pages have the same height)
Now, this does work most of the times, but when I have my viewPreferences.rulerOrigin set to RulerOrigin.SPINE_ORIGIN, it always seems to assume that pages.bounds is 0, even if it is some negative value. However, when I retrieve geometricBounds of pageItems, everything works as expected.
Consider this script:
#target InDesign var doc = app.documents.add(); doc.documentPreferences.facingPages = true; doc.documentPreferences.pagesPerDocument = 3; var spread = doc.spreads; doc.viewPreferences.rulerOrigin = RulerOrigin.SPINE_ORIGIN; var rect = spread.rectangles.add(); alert("Rectangle left bound: " + rect.geometricBounds); // --> -209,999 alert("Spread left bound: " + doc.spreads.pages.bounds); // --> 0
If you try this, you will find that the resulting rectangle's left bound is exactly at the left edge of the first page, however, two different values are returned.
Is this a bug, or am I missing something obvious here? Oh, and this is happening in CS6, I cannot test it for any other versions.