title: How to set appearance of signature using iText?
body: <p>I am using iText for pdf signing, and I have problem with setting up the appearance of it.</p>
  
  <p>I want to split signature field in two parts. On the left side should be CN of certificate that is used for signing in capital letters. On the right side should be date and some other additional info including CN in its original format. On the background is image.</p>
  
  <p>Right now I am using NAME_AND_DESCRIPTION rendering mode which splits signature field in 2 parts. It does pretty much what I want, but iText automatically takes original CN from certificate and print it as NAME(on the left side). </p>
  
  <p>Is there a way to change the NAME part (I need CN in capital letters). Or is there other way to split signature field in 2 parts and set the text manually?</p>
  
  <p>Here is what I have so far:
  setting background and rendering mode:</p>
  
  <pre><code>    PdfSignatureAppearance appearance = stamper.getSignatureAppearance();
      appearance.setImage(Image.getInstance("image.gif"));
      appearance.setReason("I've written this.");
      appearance.setVisibleSignature(new Rectangle(420, 732, 512, 780), 1, 1);
      appearance.setRenderingMode(PdfSignatureAppearance.RenderingMode.NAME_AND_DESCRIPTION);
  </code></pre>
  
  <p>setting description(right side):</p>
  
  <pre><code>    X500Name x500name = new JcaX509CertificateHolder(x509Certificate).getSubject();
      RDN cn = x500name.getRDNs(BCStyle.CN)[0];
      String cnName = IETFUtils.valueToString(cn.getFirst().getValue());
      appearance.setLayer2Text("Digitally signed by:" + cnName + "\n\n" + x509Certificate.getSubjectDN().getName() + "\n\n" + new Date().toString());
  </code></pre>