|
@@ -213,9 +213,20 @@ public class CPDFDocumentPlugin {
|
|
|
var success = false
|
|
|
|
|
|
if removeSecurity {
|
|
|
- success = self.document?.writeDecrypt(to: URL(fileURLWithPath: savePath), isSaveFontSubset: fontSubSet) ?? false
|
|
|
+ if (self.pdfViewController?.pdfListView?.isEditing() == true && self.pdfViewController?.pdfListView?.isEdited() == true) {
|
|
|
+ self.pdfViewController?.pdfListView?.commitEditing()
|
|
|
+
|
|
|
+ success = self.document?.writeDecrypt(to: URL(fileURLWithPath: savePath), isSaveFontSubset: fontSubSet) ?? false
|
|
|
+ } else {
|
|
|
+ success = self.document?.writeDecrypt(to: URL(fileURLWithPath: savePath), isSaveFontSubset: fontSubSet) ?? false
|
|
|
+ }
|
|
|
} else {
|
|
|
- success = self.document?.write(to: URL(fileURLWithPath: savePath), isSaveFontSubset: fontSubSet) ?? false
|
|
|
+ if (self.pdfViewController?.pdfListView?.isEditing() == true && self.pdfViewController?.pdfListView?.isEdited() == true) {
|
|
|
+ self.pdfViewController?.pdfListView?.commitEditing()
|
|
|
+ success = self.document?.write(to: URL(fileURLWithPath: savePath), isSaveFontSubset: fontSubSet) ?? false
|
|
|
+ } else {
|
|
|
+ success = self.document?.write(to: URL(fileURLWithPath: savePath), isSaveFontSubset: fontSubSet) ?? false
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
result(success)
|