@june24/expo-pdf-reader 0.1.5 → 0.1.6
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/ios/ExpoPdfReaderView.swift +21 -3
- package/package.json +1 -1
|
@@ -397,9 +397,27 @@ class ExpoPdfReaderView: ExpoView, UIGestureRecognizerDelegate {
|
|
|
397
397
|
guard let page = document.page(at: i) else { continue }
|
|
398
398
|
for annotation in page.annotations {
|
|
399
399
|
if annotation.type == "Ink" {
|
|
400
|
-
|
|
400
|
+
// Extract points from all paths in the annotation
|
|
401
|
+
var allStrokes: [[[String: Double]]] = []
|
|
401
402
|
|
|
402
|
-
|
|
403
|
+
if let paths = annotation.paths {
|
|
404
|
+
for path in paths {
|
|
405
|
+
var points: [[String: Double]] = []
|
|
406
|
+
|
|
407
|
+
// Extract points from CGPath
|
|
408
|
+
path.cgPath.applyWithBlock { element in
|
|
409
|
+
let pt = element.pointee.points[0]
|
|
410
|
+
points.append([
|
|
411
|
+
"x": Double(pt.x),
|
|
412
|
+
"y": Double(pt.y)
|
|
413
|
+
])
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if !points.isEmpty {
|
|
417
|
+
allStrokes.append(points)
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
403
421
|
|
|
404
422
|
var colorHex = "#000000"
|
|
405
423
|
let strokeColor = annotation.color
|
|
@@ -416,7 +434,7 @@ class ExpoPdfReaderView: ExpoView, UIGestureRecognizerDelegate {
|
|
|
416
434
|
"type": type,
|
|
417
435
|
"color": colorHex,
|
|
418
436
|
"page": i,
|
|
419
|
-
"points":
|
|
437
|
+
"points": allStrokes,
|
|
420
438
|
"width": annotation.border?.lineWidth ?? 10.0
|
|
421
439
|
])
|
|
422
440
|
} else if annotation.type == "FreeText" {
|
package/package.json
CHANGED