// --------------------------------------------------------------------------- /** * 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; }