Undefined is not an object (evaluating 'this.v.N[a].ed')

33 views
Skip to first unread message

David Compton

unread,
May 24, 2017, 11:33:14 AM5/24/17
to PDFTron WebViewer
Just wondering if you would have any idea why we would be getting the following error coming through our log files:

TypeError: undefined is not an object (evaluating 'this.v.N[a].ed')
  at qf(/assets/pdftron/html5/CoreControls.js:645:225)
  at qf(/assets/pdftron/html5/CoreControls.js:1079:46)
  at Rg(/assets/pdftron/html5/CoreControls.js:976:358)
  at Yx(/assets/pdftron/html5/CoreControls.js:977:478)
  at cr(/assets/pdftron/html5/CoreControls.js:976:207)
  at sC(/assets/pdftron/html5/CoreControls.js:974:399)
  at QG(/assets/pdftron/html5/CoreControls.js:939:56)
  at ? (/build/main.js:69313:72)
  at wrapped(/build/main.js:193562:34)
  at runTask(/build/polyfills.js:3:10400)
  at invoke(/build/polyfills.js:3:16177)
  at e(/build/polyfills.js:2:30859)

The error is coming from WebViewer inside an Ionic App running on an iPad Pro with iOS 10.3.2.

Line 69313 in main.js has the following code:

viewerElement.bind('documentLoaded', function (event, data) {
if (self.webViewer.getPageCount() >= self.currentPageNo) {
self.webViewer.setCurrentPageNumber(self.currentPageNo);
}
self.annotManager = self.readerControl.docViewer.getAnnotationManager();
self.annotManager.on('annotationChanged', function (e, annotations, action) {
if (e.imported || !self.selectedNavItem) {
return;
}
var allAnnotations = self.annotManager.exportAnnotations();
self.dataService.saveAnnotations(self.selectedNavItem, allAnnotations);
});
if (self.selectedNavItem && !self.selectingNavItem) {
self.dataService.getAnnotations(self.selectedNavItem).then(function (annots) {
if (annots) {
setTimeout(function () {
self.annotManager.importAnnotations(annots.doc.xfdf);
self.annotManager.drawAnnotations(self.webViewer.getCurrentPageNumber(), null, true);
}, webViewerTimeout);
}
if (self.loading && !self.selectingNavItem) {
self.loading.dismiss();
}
});
}
// self.readerControl.$wrapper is undefined in desktop (html5) mode,
// it is only available in mobile (html5mobile) mode
if (self.readerControl.$wrapper) {
// Disable double tap when in free hand annotation mode
self.readerControl.$wrapper.off('dblclick');
self.readerControl.$wrapper.off('dbltap');
self.readerControl.$wrapper.off('doubletap');
self.readerControl.$wrapper.on('dblclick dbltap doubletap', function () {
if (self.readerControl.getToolMode() !== PDFTron.WebViewer.ToolMode.AnnotationCreateFreeHand) {
self.readerControl.onDoubleTap.call(self.readerControl, arguments[0]);
}
});
}
});


Kind regards,

David

Justin Jung

unread,
May 25, 2017, 3:02:52 PM5/25/17
to PDFTron WebViewer on behalf of David Compton
It's tricky to tell the root cause by just looking at the code.
When do you see the error message? Have you looked at the call stack to narrow down which line is causing it? Which specific line is 69313?

Justin Jung
Software Developer
PDFTron Systems Inc.

David Compton

unread,
May 25, 2017, 4:58:37 PM5/25/17
to PDFTron WebViewer on behalf of Justin Jung
Line 69313 is the first line in the code that I provided:

viewerElement.bind('documentLoaded', function (event, data) {

So that is as close as the call stack gets me to the problem.

Regards,

David

--
You received this message because you are subscribed to the Google Groups "PDFTron WebViewer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfnet-webviewer+unsubscribe@googlegroups.com.
To post to this group, send email to pdfnet-webviewer@googlegroups.com.
Visit this group at https://groups.google.com/group/pdfnet-webviewer.
For more options, visit https://groups.google.com/d/optout.

Justin Jung

unread,
May 29, 2017, 6:14:54 PM5/29/17
to PDFTron WebViewer on behalf of David Compton
The error might be thrown when you try to access a page number that is out of bounds, such as in self.annotManager.drawAnnotations.
You might want to check if self.webViewer.getCurrentPageNumber() returns correct page numbers.
If it doesn't resolve the issue, then you would have to try commenting out lines to narrow down further.
Reply all
Reply to author
Forward
0 new messages