iTextSharp.text.pdf.PdfAcroForm.DrawMultiLineOfText C# (CSharp) Метод

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

public DrawMultiLineOfText ( PdfFormField field, string text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury ) : void
field PdfFormField
text string
font BaseFont
fontSize float
llx float
lly float
urx float
ury float
Результат void
        public void DrawMultiLineOfText(PdfFormField field, string text, BaseFont font, float fontSize, float llx, float lly, float urx, float ury)
        {
            PdfAppearance tp = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
            PdfAppearance tp2 = (PdfAppearance)tp.Duplicate;
            tp2.SetFontAndSize(font, fontSize);
            tp2.ResetRGBColorFill();
            field.DefaultAppearanceString = tp2;
            tp.DrawTextField(0f, 0f, urx - llx, ury - lly);
            tp.BeginVariableText();
            tp.SaveState();
            tp.Rectangle(3f, 3f, urx - llx - 6f, ury - lly - 6f);
            tp.Clip();
            tp.NewPath();
            tp.BeginText();
            tp.SetFontAndSize(font, fontSize);
            tp.ResetRGBColorFill();
            tp.SetTextMatrix(4, 5);
            System.util.StringTokenizer tokenizer = new System.util.StringTokenizer(text, "\n");
            float yPos = ury - lly;
            while (tokenizer.HasMoreTokens()) {
            yPos -= fontSize * 1.2f;
            tp.ShowTextAligned(PdfContentByte.ALIGN_LEFT, tokenizer.NextToken(), 3, yPos, 0);
            }
            tp.EndText();
            tp.RestoreState();
            tp.EndVariableText();
            field.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, tp);
        }