Explorar o código

PDFTools(iOS) - Fixed 17886 【form】iOS添加的form框,用pro Mac或者adobe打开,form丢失(附件文档)

chenyu hai 1 ano
pai
achega
e840378d4f

+ 12 - 0
Annotation-Ctrl-Demo/Annotation-Ctrl-Demo/CPDFViewController.m

@@ -175,6 +175,18 @@
 }
 
 - (void)enterViewerMode {
+    
+    if (self.pdfListView.isEdited) {
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            [self.pdfListView commitEditing];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [self.pdfListView endOfEditing];
+            });
+        });
+    } else {
+        [self.pdfListView endOfEditing];
+    }
+    
     self.pdfListView.toolModel = CToolModelViewer;
     self.navigationTitle = NSLocalizedString(@"Viewer", nil);
     [self.titleButton setTitle:self.navigationTitle forState:UIControlStateNormal];

+ 11 - 0
compdfkit-tools/compdfkit-tools/Common/Controls/PDFViewController/CPDFViewBaseController.m

@@ -155,6 +155,17 @@
 - (void)enterPDFShare  {
     [self.popMenu hideMenu];
     
+    if (self.pdfListView.isEdited) {
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            [self.pdfListView commitEditing];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [self.pdfListView endOfEditing];
+            });
+        });
+    } else {
+        [self.pdfListView endOfEditing];
+    }
+    
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         if(self.pdfListView.document.isModified) {
             [self.pdfListView.document writeToURL:self.pdfListView.document.documentURL];