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

public SignPDFFile ( string FileToSign, string UserName, string Password, int X, int Y, int Width, int Height, int Page, bool isVisible ) : bool
FileToSign string
UserName string
Password string
X int
Y int
Width int
Height int
Page int
isVisible bool
Результат bool
        private void btnSign_Click(object sender, EventArgs e)
        {
            SAPIWSWrapper SapiWS = new SAPIWSWrapper();

            if (this.txtPDFFile.Text.Trim().Length < 3)
            {
                MessageBox.Show("Please select PDF file to Sign", "Error");
                this.txtPDFFile.Focus();
                return;
            }

            if (this.txtUsername.Text.Trim().Length < 1)
            {
                MessageBox.Show("Please Define UserName", "Error");
                this.txtUsername.Focus();
                return;
            }

            if (this.txtPassword.Text.Trim().Length < 1)
            {
                MessageBox.Show("Please define CoSign password", "Error");
                this.txtPassword.Focus();
                return;
            }

            bool res = SapiWS.SignPDFFile(txtPDFFile.Text, txtUsername.Text, txtPassword.Text, (int)nudX.Value, (int)nudY.Value,
                (int)nudWidth.Value, (int)nudHeight.Value, (int)nudPage.Value, true);

            if (!res)
                MessageBox.Show("Signing Failed", "SAPI WS Demo");
            else
                MessageBox.Show("Signature was applied successfully", "SAPI WS Demo");
        }
Пример #2
0
        private void btnSign_Click(object sender, EventArgs e)
        {
            SAPIWSWrapper SapiWS = new SAPIWSWrapper();

            if (this.txtPDFFile.Text.Trim().Length < 3)
            {
                MessageBox.Show("Please select PDF file to Sign", "Error");
                this.txtPDFFile.Focus();
                return;
            }

            if (this.txtUsername.Text.Trim().Length < 1)
            {
                MessageBox.Show("Please Define UserName", "Error");
                this.txtUsername.Focus();
                return;
            }

            if (this.txtPassword.Text.Trim().Length < 1)
            {
                MessageBox.Show("Please define CoSign password", "Error");
                this.txtPassword.Focus();
                return;
            }

            bool res = SapiWS.SignPDFFile(DSAtextBox.Text,
                                          txtPDFFile.Text,
                                          txtUsername.Text,
                                          txtPassword.Text,
                                          txtPdfPass.Text,
                                          txtGrSigName.Text,
                                          (int)nudX.Value,
                                          (int)nudY.Value,
                                          (int)nudWidth.Value,
                                          (int)nudHeight.Value,
                                          (int)nudPage.Value,
                                          chkIsVisible.Checked,
                                          (int)GMTOffsetNum.Value,
                                          (int)AppearanceMaskNum.Value);

            if (!res)
            {
                MessageBox.Show("Signing Failed", "SAPI WS Demo");
            }
            else
            {
                MessageBox.Show("Signature was applied successfully", "SAPI WS Demo");
            }
        }