saveAs method
Saves the document to the specified directory.
Example usage:
await controller.document.saveAs('data/your_package_name/files/xxx.pdf')
savePathSpecifies the path where the document should be saved. On Android, both file paths and URIs are supported. For example:- File path:
/data/user/0/com.compdfkit.flutter.example/cache/temp/PDF_Document.pdf - URI:
content://media/external/file/1000045118
- File path:
removeSecurityWhether to remove the document's password.fontSubSetWhether to embed the font subset when saving the PDF. This will affect how text appears in other PDF software. This is a time-consuming operation.
Implementation
Future<bool> saveAs(String savePath,
{bool removeSecurity = false, bool fontSubSet = true}) async {
try {
return await _channel.invokeMethod('save_as', {
'save_path': savePath,
'remove_security': removeSecurity,
'font_sub_set': fontSubSet
});
} on PlatformException catch (e) {
debugPrint(e.details);
return false;
} catch (e) {
return false;
}
}