iTextSharp.text.pdf.PdfContentByte.CreateAppearance C# (CSharp) 메소드

CreateAppearance() 개인적인 메소드

private CreateAppearance ( float width, float height, PdfName forcedName ) : PdfAppearance
width float
height float
forcedName PdfName
리턴 PdfAppearance
        internal PdfAppearance CreateAppearance(float width, float height, PdfName forcedName)
        {
            CheckWriter();
            PdfAppearance template = new PdfAppearance(writer);
            template.Width = width;
            template.Height = height;
            writer.AddDirectTemplateSimple(template, forcedName);
            return template;
        }

Same methods

PdfContentByte::CreateAppearance ( float width, float height ) : PdfAppearance

Usage Example

예제 #1
0
 // ---------------------------------------------------------------------------    
 /**
  * Creates an appearance for a key
  * @param cb the canvas
  * @param btn the label for the key
  * @param color the color of the key
  * @param w the width
  * @param h the height
  * @return an appearance
  */
 public PdfAppearance CreateAppearance(
   PdfContentByte cb, String btn, BaseColor color, float w, float h)
 {
     PdfAppearance app = cb.CreateAppearance(w, h);
     app.SetColorFill(color);
     app.Rectangle(2, 2, w - 4, h - 4);
     app.Fill();
     app.BeginText();
     app.SetColorFill(BaseColor.BLACK);
     app.SetFontAndSize(bf, h / 2);
     app.ShowTextAligned(Element.ALIGN_CENTER, btn, w / 2, h / 4, 0);
     app.EndText();
     return app;
 }
PdfContentByte