Beispiel #1
0
            override public void Draw(DrawContext drawContext)
            {
                base.Draw(drawContext);
                iText.Kernel.Geom.Rectangle cuadro = GetOccupiedAreaBBox();
                cuadro.MoveUp(margenExterior).MoveRight(margenExterior);
                cuadro.SetHeight(cuadro.GetHeight() - (margenExterior * 2));
                cuadro.SetWidth(cuadro.GetWidth() - (margenExterior * 2));
                PdfTextFormField field = PdfFormField.CreateText(drawContext.GetDocument(), cuadro, fieldName, valor);

                field.SetJustification(justificacion);
                field.SetVisibility(PdfFormField.VISIBLE);
                field.SetFontSize(fontSize);
                PdfAcroForm form = PdfAcroForm.GetAcroForm(drawContext.GetDocument(), true);

                form.AddField(field);
            }