iTextSharp.text.pdf.PdfContentByte.CreateAppearance C# (CSharp) Метод

CreateAppearance() публичный Метод

public CreateAppearance ( float width, float height ) : PdfAppearance
width float
height float
Результат PdfAppearance
        public PdfAppearance CreateAppearance(float width, float height)
        {
            return CreateAppearance(width, height, null);
        }

Same methods

PdfContentByte::CreateAppearance ( float width, float height, PdfName forcedName ) : 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