PdfPasswordArgs class
Arguments of Pdf Password.
//Load an existing PDF document
PdfDocument document =
PdfDocument(inputBytes: File('input.pdf').readAsBytesSync())
//Subsribe the onPdfPassword event
..onPdfPassword = loadOnPdfPassword;
//Access the attachments
PdfAttachmentCollection attachmentCollection = document.attachments;
//Iterates the attachments
for (int i = 0; i < attachmentCollection.count; i++) {
//Extracts the attachment and saves it to the disk
File(attachmentCollection[i].fileName)
.writeAsBytesSync(attachmentCollection[i].data);
}
//Disposes the document
document.dispose();
void loadOnPdfPassword(PdfDocument sender, PdfPasswordArgs args) {
//Sets the value of PDF password.
args.attachmentOpenPassword = 'syncfusion';
}
Properties
- attachmentOpenPassword ↔ String?
-
A value of PDF password.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited