public override void WriteToPdf(PdfDocument doc) { // to do RectArea rect = new RectArea(PosX, PosY, Width, Height, false); rect.SetFillColor(0, 0, 0, 0); rect.SetStrokeColor(0, 0, 0, 250); rect.Stroked = true; rect.AddToDocument(doc); }
public override void WriteToPdf(PdfDocument doc) { // LABEL // --------------- // | Hodnota(Text) | // --------------- // biely stvorec obsahujuci hodnotu elementu (ulozenu v Text) // sirka bieleho pola je priamoumerna dlzke textu ktory v nej bude vykresleny if (FieldWidth == -1) FieldWidth = 15 + (int)customfont.GetWidthPointKerned(Text, FieldFontSize); if (FieldHeight == -1) FieldHeight = FieldFontSize + 2; RectArea r = new RectArea(PosX + 1, PosY +2, FieldWidth+2, FieldHeight); r.SetFillColor(0, 0, 0, 0); r.AddToDocument(doc); if (Label.Text != "") { // vykreslenie labelu, ktory popisuje hodnoty nizsie Label.PosX = this.PosX + 3; Label.PosY = this.PosY + FieldHeight + 3; Label.WriteToPdf(doc); } // vpisanie hodnoty elementu do bieleho pola Label l = new Label(); l.Width = FieldWidth-10; l.Height = FieldHeight; l.Text = this.Text; l.PosX = PosX ; l.PosY = PosY + 4; l.FontSize = FieldFontSize; if (FieldWidth > -1) l.Width = FieldWidth; if (FieldHeight >= -1) l.Height = FieldHeight; l.WriteToPdf(doc); }