PdfSecurityManagerSign(Byte, String, String, String, String, String, String, Int32, RectangleF, TimeStampAuthority) Method |
Sign the pdf document given as an array of bytes with the specified certificate.
Namespace: ExpertPdf.PDFSecurityAssembly: epsecurepdf (in epsecurepdf.dll) Version: 10.0
Syntaxpublic byte[] Sign(
byte[] sourcePdf,
string certificateFileName,
string certificatePassword,
string signatureName,
string reason,
string location,
string contactInfo,
int pageIndex,
RectangleF bounds,
TimeStampAuthority timeStampAuthority
)
Public Function Sign (
sourcePdf As Byte(),
certificateFileName As String,
certificatePassword As String,
signatureName As String,
reason As String,
location As String,
contactInfo As String,
pageIndex As Integer,
bounds As RectangleF,
timeStampAuthority As TimeStampAuthority
) As Byte()
Parameters
- sourcePdf Byte
- The PDF document that will be signed.
- certificateFileName String
- The full path to the existing certificate (PFX certificates only).
- certificatePassword String
- Certificate password.
- signatureName String
- The name of the signature.
- reason String
- The reason of signing.
- location String
- The location of signing.
- contactInfo String
- The signer contact info (can be an email, phone number, address, etc.
- pageIndex Int32
- Index of the page where the signature will be added.
- bounds RectangleF
- Location within the specified page of the signature.
- timeStampAuthority TimeStampAuthority
- TSA server details. Can be null.
Return Value
ByteThe signed PDF document.
Exceptions| Exception | Condition |
|---|
| SecurePdfException | The document is empty or cannot be opened, the certificate cannot be opened, the
page index is not valid or signing failed. |
RemarksSigning is only supported with .pfx certificates. A password-protected source is opened with
SourcePdfPassword.
See Also