|
@@ -38,7 +38,7 @@ class RCTCPDFView: UIView {
|
|
|
|
|
|
private func createCPDFView() {
|
|
private func createCPDFView() {
|
|
let fileManager = FileManager.default
|
|
let fileManager = FileManager.default
|
|
- let samplesFilePath = NSHomeDirectory().appending("/Documents/ReaderViewer")
|
|
|
|
|
|
+ let samplesFilePath = NSHomeDirectory().appending("/Documents/Files")
|
|
let fileName = document.lastPathComponent
|
|
let fileName = document.lastPathComponent
|
|
let docsFilePath = samplesFilePath + "/" + fileName
|
|
let docsFilePath = samplesFilePath + "/" + fileName
|
|
|
|
|
|
@@ -73,12 +73,17 @@ class RCTCPDFView: UIView {
|
|
let document = self.pdfViewController?.pdfListView?.document
|
|
let document = self.pdfViewController?.pdfListView?.document
|
|
let success = document?.write(to: document?.documentURL ?? URL(fileURLWithPath: ""), isSaveFontSubset: true) ?? false
|
|
let success = document?.write(to: document?.documentURL ?? URL(fileURLWithPath: ""), isSaveFontSubset: true) ?? false
|
|
completionHandler(success)
|
|
completionHandler(success)
|
|
|
|
+ } else {
|
|
|
|
+ completionHandler(true)
|
|
}
|
|
}
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
if self.pdfViewController?.pdfListView?.document.isModified() == true {
|
|
if self.pdfViewController?.pdfListView?.document.isModified() == true {
|
|
let document = self.pdfViewController?.pdfListView?.document
|
|
let document = self.pdfViewController?.pdfListView?.document
|
|
let success = document?.write(to: document?.documentURL ?? URL(fileURLWithPath: ""), isSaveFontSubset: true) ?? false
|
|
let success = document?.write(to: document?.documentURL ?? URL(fileURLWithPath: ""), isSaveFontSubset: true) ?? false
|
|
completionHandler(success)
|
|
completionHandler(success)
|
|
|
|
+ } else {
|
|
|
|
+ completionHandler(true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|