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

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

public DrawSignatureAppearences ( PdfFormField field, float llx, float lly, float urx, float ury ) : void
field PdfFormField
llx float
lly float
urx float
ury float
Результат void
        public void DrawSignatureAppearences(PdfFormField field, float llx, float lly, float urx, float ury)
        {
            PdfAppearance tp = PdfAppearance.CreateAppearance(writer, urx - llx, ury - lly);
            tp.SetGrayFill(1.0f);
            tp.Rectangle(0, 0, urx - llx, ury - lly);
            tp.Fill();
            tp.SetGrayStroke(0);
            tp.SetLineWidth(1);
            tp.Rectangle(0.5f, 0.5f, urx - llx - 0.5f, ury - lly - 0.5f);
            tp.ClosePathStroke();
            tp.SaveState();
            tp.Rectangle(1, 1, urx - llx - 2, ury - lly - 2);
            tp.Clip();
            tp.NewPath();
            tp.RestoreState();
            field.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, tp);
        }

Usage Example

Пример #1
0
        /**
         * Adds an empty signature.
         * @param name   the name of the signature
         * @param page   the page number
         * @param llx    lower left x coordinate of the signature's position
         * @param lly    lower left y coordinate of the signature's position
         * @param urx    upper right x coordinate of the signature's position
         * @param ury    upper right y coordinate of the signature's position
         * @return   a signature form field
         * @since    2.1.4
         */
        public PdfFormField AddSignature(String name, int page, float llx, float lly, float urx, float ury)
        {
            PdfAcroForm  acroForm  = stamper.AcroForm;
            PdfFormField signature = PdfFormField.CreateSignature(stamper);

            acroForm.SetSignatureParams(signature, name, llx, lly, urx, ury);
            acroForm.DrawSignatureAppearences(signature, llx, lly, urx, ury);
            AddAnnotation(signature, page);
            return(signature);
        }