|
@@ -578,6 +578,7 @@ class ComPDFKitViewer {
|
|
|
|
|
|
#formatRect(annotation) {
|
|
|
const pageIndex = annotation.page
|
|
|
+ if (!this.pagesPtr[pageIndex]?.height) return
|
|
|
const { height } = this.pagesPtr[pageIndex]
|
|
|
|
|
|
const rect = annotation.rect.split(',')
|
|
@@ -597,6 +598,7 @@ class ComPDFKitViewer {
|
|
|
#formatCoords(annotation) {
|
|
|
const formattedCoords = []
|
|
|
const pageIndex = annotation.page
|
|
|
+ if (!this.pagesPtr[pageIndex]?.height) return
|
|
|
const { height } = this.pagesPtr[pageIndex]
|
|
|
|
|
|
const coords = annotation.coords.split(',')
|
|
@@ -635,6 +637,7 @@ class ComPDFKitViewer {
|
|
|
|
|
|
#formatLinePoints(annotation) {
|
|
|
const pageIndex = annotation.page
|
|
|
+ if (!this.pagesPtr[pageIndex]?.height) return
|
|
|
const { height } = this.pagesPtr[pageIndex]
|
|
|
const linePoints = []
|
|
|
|
|
@@ -650,6 +653,7 @@ class ComPDFKitViewer {
|
|
|
|
|
|
#formatInkPointes(annotation) {
|
|
|
const pageIndex = annotation.page
|
|
|
+ if (!this.pagesPtr[pageIndex]?.height) return
|
|
|
const { height } = this.pagesPtr[pageIndex]
|
|
|
const inklist = []
|
|
|
|
|
@@ -1747,6 +1751,7 @@ class ComPDFKitViewer {
|
|
|
}
|
|
|
|
|
|
#formatRectForBackend(rect, pageIndex) {
|
|
|
+ if (!this.pagesPtr[pageIndex]?.height) return
|
|
|
const { height } = this.pagesPtr[pageIndex]
|
|
|
const { left, top: rawTop, right, bottom: rawBottom } = rect
|
|
|
const top = height - rawTop
|
|
@@ -1755,6 +1760,7 @@ class ComPDFKitViewer {
|
|
|
}
|
|
|
|
|
|
#formatLinePointsForBackend(linePoints, pageIndex) {
|
|
|
+ if (!this.pagesPtr[pageIndex]?.height) return
|
|
|
const { height } = this.pagesPtr[pageIndex]
|
|
|
const top = height - linePoints[1]
|
|
|
const bottom = height - linePoints[3]
|
|
@@ -3359,7 +3365,6 @@ class ComPDFKitViewer {
|
|
|
const annotations = this.annotations[annotation.pageIndex]
|
|
|
const index = findIndex(annot.name, annotations)
|
|
|
annot.index = index
|
|
|
- console.log(index)
|
|
|
|
|
|
annotateHandles.push({
|
|
|
operate: 'add-annot',
|