SAPIWS_Sample.SAPIWSWrapper.PDFAttachSignature C# (CSharp) Méthode

PDFAttachSignature() public méthode

public PDFAttachSignature ( string PDFFile, byte Signature, bool isDisplayErrorsGUI ) : bool
PDFFile string
Signature byte
isDisplayErrorsGUI bool
Résultat bool
        public bool PDFAttachSignature(string PDFFile, byte[] Signature, bool isDisplayErrorsGUI)
        {
            if (Signature == null) return false;
            try
            {
                FileStream f = File.OpenWrite(PDFFile);
                f.Position = f.Length;  //seek to the end of file
                f.Write(Signature, 0, Signature.Length); //write the signature content
                f.Close();
            }
            catch (Exception ex)
            {
                if (isDisplayErrorsGUI)
                    MessageBox.Show("Error Attaching the signature\n\nException:\n" + ex.Message, "Error");
                return false;
            }

            return true;
        }