TimestampServer constructor

TimestampServer(
  1. Uri uri, {
  2. String? userName,
  3. String? password,
  4. Duration? timeOut,
})

Initialize a new instance of the TimestampServer class with timestamp server url.

//Creates a new PDF document
PdfDocument document = PdfDocument();
//Adds a new page
PdfPage page = document.pages.add();
//Creates a digital signature and sets signature information
PdfSignatureField field = PdfSignatureField(page, 'signature',
    bounds: Rect.fromLTWH(0, 0, 200, 100),
    signature: PdfSignature(
        //Creates a certificate instance from the PFX file with a private key
        certificate: PdfCertificate(
            File('D:/PDF.pfx').readAsBytesSync(), 'syncfusion'),
        contactInfo: 'johndoe@owned.us',
        locationInfo: 'Honolulu, Hawaii',
        reason: 'I am author of this document.',
        //Create a new PDF time stamp server
        timestampServer:
            TimestampServer(Uri.parse('http://syncfusion.digistamp.com'))));
//Add a signature field to the form
document.form.fields.add(field);
//Save and dispose the PDF document
File('Output.pdf').writeAsBytes(await document.save());
document.dispose();

Implementation

TimestampServer(this.uri, {this.userName, this.password, this.timeOut});