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

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

public SetSignatureParams ( PdfFormField field, String name, float llx, float lly, float urx, float ury ) : void
field PdfFormField
name String
llx float
lly float
urx float
ury float
Результат void
        public void SetSignatureParams(PdfFormField field, String name, float llx, float lly, float urx, float ury)
        {
            field.SetWidget(new Rectangle(llx, lly, urx, ury), PdfAnnotation.HIGHLIGHT_INVERT);
            field.FieldName = name;
            field.Flags = PdfAnnotation.FLAGS_PRINT;
            field.SetPage();
            field.MKBorderColor = BaseColor.BLACK;
            field.MKBackgroundColor = BaseColor.WHITE;
        }

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);
        }