3 Replies Latest reply on Jan 21, 2014 2:45 PM by Lane Goolsby

    Drawing a rectangle annotation over a form field and setting Z index?

    Lane Goolsby

      I am trying to draw a rectangle on a page over a chunk of text based on a click event on a check box. I have this working fine but I ran into issues with form fields on the page bleeding through/on top of the rectangle. I originally solved this by flattening the pages, which is perfectly acceptable for use case. However, when I call this.flattenPages() in Reader I get "Security settings prevent access to this property or method". After reading up on the error it appears that using flattenPages() won't work in Reader likely because our templates were authored in LiveCycle (although I welcome any other solutions/suggestions if any know of any because the flattenPages() works fine in Acrobat, just not in Reader).


      That puts me back in front of the drawing board. Is there a way I can draw an annotation over a form field and tell Acrobat that the rectangle has a higher Z index than everything else?


      This is how I am creating the rectangle.


      var pageSize = this.getPageBox("Crop", pageNumber);
          var rectULX = 0;
          var rectULY = pageSize[1];
          var rectLRX = 202;
          var rectLRY = pageSize[1] - 503;
          console.println("rectangle coord [" + rectULX + ", " + rectULY + ", " + rectLRX + ", " + rectLRY + "]");
              var annot = this.addAnnot({{
                  page: pageNumber,
                  type: "Square",
                  rect: [rectULX, rectULY, rectLRX, rectLRY], //[upper left x, upper left y, lower right x, lower right y]
                  name: annotName,
                  strokeColor: color.red,
                  fillColor: ["G",1]