0 Replies Latest reply on Apr 26, 2016 3:29 AM by MasterDomino

    Possible bug with page.bounds if RulerOrigin.SPINE_ORIGIN ?

    MasterDomino

      Hello all,
      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[0].bounds[0],
                          spread.pages[0].bounds[1],
                          spread.pages[0].bounds[2],
                          spread.pages[-1].bounds[3] ];
      

       

      (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[0].bounds[1] 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[1]; 
      
      doc.viewPreferences.rulerOrigin = RulerOrigin.SPINE_ORIGIN; 
      
      var rect = spread.rectangles.add(); 
      
      alert("Rectangle left bound: " + rect.geometricBounds[1]); // --> -209,999 
      alert("Spread left bound: " + doc.spreads[1].pages[0].bounds[1]); // --> 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.

       

      Thanks

       

      md