addSignatureForPage method

Future<void> addSignatureForPage({
  1. required PdfPage page,
  2. required PdfSignatureSigner signer,
  3. required PdfSignatureBounds bounds,
  4. String fieldName = 'Signature1',
  5. String? reason,
  6. String? location,
  7. String? contactInfo,
  8. String? name,
  9. DateTime? signingTime,
  10. PdfSignatureAppearance? appearance,
  11. Widget? appearanceWidget,
  12. void drawAppearance(
    1. PdfGraphics graphics,
    2. PdfRect bounds
    )?,
  13. int? docMdpPermissionP,
  14. PdfTimestampProvider? timestampProvider,
  15. int contentsReserveSize = 16384,
  16. int byteRangeDigits = 10,
})

Implementation

Future<void> addSignatureForPage({
  required PdfPage page,
  required PdfSignatureSigner signer,
  required PdfSignatureBounds bounds,
  String fieldName = 'Signature1',
  String? reason,
  String? location,
  String? contactInfo,
  String? name,
  DateTime? signingTime,
  PdfSignatureAppearance? appearance,
  pw.Widget? appearanceWidget,
  void Function(PdfGraphics graphics, PdfRect bounds)? drawAppearance,
  int? docMdpPermissionP,
  PdfTimestampProvider? timestampProvider,
  int contentsReserveSize = 16384,
  int byteRangeDigits = 10,
}) async {
  _ensureNotDisposed();
  final pageIndex = pages.indexOf(page);
  if (pageIndex == -1) {
    throw ArgumentError('A pagina informada nao pertence ao documento.');
  }
  await addSignature(
    PdfSignatureRequest(
      pageNumber: pageIndex + 1,
      signer: signer,
      bounds: bounds,
      fieldName: fieldName,
      reason: reason,
      location: location,
      contactInfo: contactInfo,
      name: name,
      signingTime: signingTime,
      appearance: appearance,
      appearanceWidget: appearanceWidget,
      drawAppearance: drawAppearance,
      docMdpPermissionP: docMdpPermissionP,
      timestampProvider: timestampProvider,
      contentsReserveSize: contentsReserveSize,
      byteRangeDigits: byteRangeDigits,
    ),
  );
}