dart_pdf
dart_pdf copied to clipboard
How to use Signature? How to digitally sign the generated PDF.
pw.Container(
width: double.infinity,
padding: const pw.EdgeInsets.all(8),
decoration: pw.BoxDecoration(
border: pw.Border.all(
color: PdfColors.blue,
width: .5,
),
),
child: pw.Column(
crossAxisAlignment: pw.CrossAxisAlignment.start,
children: [
pw.Row(
children: [
pw.Text(
'First Name:',
style: customerDetailsTextStyle,
),
pw.SizedBox(width: 10),
pw.Text(
_fNameCtrl.text,
),
],
),
pw.SizedBox(height: 8),
pw.Row(
children: [
pw.Text(
'Surname:',
style: customerDetailsTextStyle,
),
pw.SizedBox(width: 10),
pw.Text(
_surNameCtrl.text,
),
],
),
pw.SizedBox(height: 8),
pw.Row(
children: [
pw.Text(
'Installation Address:',
style: customerDetailsTextStyle,
),
pw.SizedBox(width: 10),
pw.Text(
_addressCtrl.text,
),
],
),
pw.SizedBox(height: 8),
pw.Row(
children: [
pw.Text(
'Email:',
style: customerDetailsTextStyle,
),
pw.SizedBox(width: 10),
pw.Text(
_emailCtrl.text,
),
],
),
pw.SizedBox(height: 8),
pw.Signature(
name: 'signature',
child: pw.Text('Please sign here'),
// value: , <<<<<<<---------------------------------------------
),
],
),
)
How to use the value attribute?
Something like:
Signature(
name: 'Signature',
value: PdfSign.rsaSha1(
privateKey: privateKey,
certificates: chain,
),
child: PdfLogo(),
),
It's described here: https://pub.nfet.net/pdf_crypto/
@DavBfr This is a paid feature, Right?
Yes it is. It's for digital cryptographic signature, not for hand-signed.
Thank you @DavBfr for the prompt response. I think that I only need the hand-signed feature. How to achieve that?
Ask the user to draw with a hand sign flutter plugin and add it as an image in the pdf.