@kishannareshpal/expo-pdf 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/ios/KJExpoPdfView.swift +19 -3
- package/package.json +1 -1
- package/release_body.txt +1 -6
package/CHANGELOG.md
CHANGED
package/ios/KJExpoPdfView.swift
CHANGED
|
@@ -208,6 +208,18 @@ class KJExpoPdfView: ExpoView {
|
|
|
208
208
|
])
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
@objc private func handleDocumentChanged() {
|
|
212
|
+
guard
|
|
213
|
+
let document = pdfView.document
|
|
214
|
+
else { return }
|
|
215
|
+
|
|
216
|
+
DispatchQueue.main.async {
|
|
217
|
+
self.onLoadComplete([
|
|
218
|
+
"pageCount": document.pageCount
|
|
219
|
+
])
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
211
223
|
private func reloadPdf() {
|
|
212
224
|
guard let document = self.loadDocument() else {
|
|
213
225
|
return
|
|
@@ -233,9 +245,6 @@ class KJExpoPdfView: ExpoView {
|
|
|
233
245
|
|
|
234
246
|
self.autoScale(resetScrollOffset: !self.isFirstLayoutComplete)
|
|
235
247
|
|
|
236
|
-
self.onLoadComplete([
|
|
237
|
-
"pageCount": document.pageCount
|
|
238
|
-
])
|
|
239
248
|
}
|
|
240
249
|
|
|
241
250
|
private func loadDocument() -> PDFDocument? {
|
|
@@ -280,6 +289,13 @@ class KJExpoPdfView: ExpoView {
|
|
|
280
289
|
name: .PDFViewPageChanged,
|
|
281
290
|
object: pdfView
|
|
282
291
|
)
|
|
292
|
+
|
|
293
|
+
NotificationCenter.default.addObserver(
|
|
294
|
+
self,
|
|
295
|
+
selector: #selector(handleDocumentChanged),
|
|
296
|
+
name: .PDFViewDocumentChanged,
|
|
297
|
+
object: pdfView
|
|
298
|
+
)
|
|
283
299
|
}
|
|
284
300
|
|
|
285
301
|
private func reportError(_ code: ErrorCode, _ message: String) {
|
package/package.json
CHANGED
package/release_body.txt
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
- fix: android 7 rendering ([0edf556](https://github.com/kishannareshpal/expo-pdf/commit/0edf556b266e26205416d1cdb1e6b86c9f924e71)) by `Kishan Jadav`
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
**Full Changelog**: https://github.com/kishannareshpal/expo-pdf/compare/v0.3.0...v0.3.1
|
|
2
|
+
**Full Changelog**: https://github.com/kishannareshpal/expo-pdf/compare/v0.3.1...v0.3.2
|