title: How to control size of validity icon in a pdf
body: <p>I've been trying for at least 2 days now to control the size of the validity icon of a pdf file, when signed.</p>
  
  <p>The icon is set by the pdf reader usually.</p>
  
  <p>I've tried different approaches to the problem :</p>
  
  <ol>
  <li>Redimensioned the Signature Annotation Rectangle - which reshaped
  all the contents within</li>
  <li>Redimensioned the Signature Annotation Appearance BBox - which also
  reshaped the text and icon contents.</li>
  <li>I've also tried to reshape n2 and n0 layers, and created a new one
  n5, expecting to be able to control it's size without success</li>
  </ol>
  
  <p>In the end, I would just want to individually resize the validity icon. </p>
  
  <p>Any suggestions shall be deeply appreciated.</p>
  
  <pre><code>dsblank = Annotation::AppearanceStream.new.setFilter(:FlateDecode)
  dsblank.Type=Name.new("XObject")
  dsblank.Resources = Resources.new
  dsblank.BBox = [ 0, 0, width, height ]
  dsblank.draw_stream('% DSBlank')  
  
  
  n2 = Annotation::AppearanceStream.new.setFilter(:FlateDecode)
  n2.Resources = Resources.new
  n2.BBox = [ 0, 0, width, height ]
  n2.draw_stream('% DSBlank')
  
  n5 = Annotation::AppearanceStream.new.setFilter(:FlateDecode)
  n5.Resources = Resources.new
  n5.BBox = [ 0, 0, width, height ]
  n5.write(caption,x: padding_x, y: padding_y, size: text_size, leading: text_size )
  
  sigannot = Annotation::Widget::Signature.new
  sigannot.Rect = Rectangle[ llx: x, lly: y, urx: x+width, ury: y+height ]
  sigannot.F = Annotation::Flags::PRINT #sets the print mode on
  
  #
  # Creates the stream for the signature appearance
  #
  streamN = Annotation::AppearanceStream.new.setFilter(:FlateDecode)
  streamN.BBox = [ 0, 0,width, height]
  streamN.Resources = Resources.new
  streamN.Resources.add_xobject(Name.new("n0"), dsblank)
  streamN.Resources.add_xobject(Name.new("n1"), dsblank)
  streamN.Resources.add_xobject(Name.new("n2"), n2)
  streamN.Resources.add_xobject(Name.new("n3"), dsblank)
  streamN.Resources.add_xobject(Name.new("n5"), n5)
  streamN.draw_stream('q 1 0 0 1 0 0 cm /n0 Do Q')
  streamN.draw_stream('q 1 0 0 1 0 0 cm /n1 Do Q')
  streamN.draw_stream('q 1 0 0 1 0 0 cm /n2 Do Q')
  streamN.draw_stream('q 1 0 0 1 0 0 cm /n3 Do Q')
  streamN.draw_stream('q 1 0 0 1 0 0 cm /n5 Do Q')
  
  sigannot.set_normal_appearance(streamN)
  
  page.add_annot(sigannot)
  </code></pre>