code: public PdfTemplate getLayer(int layer) {
          if (layer < 0 || layer >= app.length)
              return null;
          PdfTemplate t = app[layer];
          if (t == null) {
              t = app[layer] = new PdfTemplate(writer);
              t.setBoundingBox(rect);
              writer.addDirectTemplateSimple(t, new PdfName("n" + layer));
          }
          return t;
      }
docs: Gets a template layer to create a signature appearance. The layers can go from 0 to 4.
  <p>
  Consult <A HREF="http://partners.adobe.com/asn/developer/pdfs/tn/PPKAppearances.pdf">PPKAppearances.pdf</A>
  for further details.
  @param layer the layer
  @return a template