Handling errors when document loading fails

579 views
Skip to first unread message

Søren Pedersen

unread,
Jun 20, 2014, 10:23:52 AM6/20/14
to pdfnet-w...@googlegroups.com
Hi

I can not catch the errors from document loading failure. I tried the suggestion from this thread

https://groups.google.com/forum/#!msg/pdfnet-webviewer/KYsQN4KmloQ/WoeQ2WRv35oJ

I have explicitly tried the SetErrorCallback like this:

partRetriever.SetErrorCallback(function(err) {
console.log('Hello from error callback!');
});

but the error is not caught.

The server responds with a HTTP 500, since the conversion fails and I get these traces in the Chrome console:

GET http://localhost:9082/TPTRWeb_war_exploded/resource/documents/xod/B8921582F9A59AEF 500 (Internal Server Error) CoreControls.js:348
b.start CoreControls.js:348
_.extend.kj CoreControls.js:352
h.Ha.Nh CoreControls.js:427
h.ba.Nh CoreControls.js:727
exports.ReaderControl.loadDocument ReaderControl.js:1814
readerControl.loadDocument VM757:32
window.ControlUtils.byteRangeCheck.streaming ReaderControl.js:2137
$.ajax.success ControlUtils.js:147
k jquery-1.8.2.min.js:2
l.fireWith jquery-1.8.2.min.js:2
y jquery-1.8.2.min.js:2
d jquery-1.8.2.min.js:2

Uncaught Error: Wrong signature in local header: 1329865020 CoreControls.js:350
_.extend.processData CoreControls.js:350
(anonymous function) CoreControls.js:351
e.Events.trigger CoreControls.js:29
b.onreadystatechange CoreControls.js:348

I need to be able to present a decent error message to the user.

Any suggestions?

Matt Parizeau

unread,
Jun 23, 2014, 1:46:05 PM6/23/14
to pdfnet-w...@googlegroups.com
Hi,

From that error message it seems like you're using the streaming part retriever. Somewhat recently there was an error identified and fixed with the error callback for the streaming part retriever. You can download a build with the fix here: http://pdftron.com/ID-zJWLuhTffd3c/WebViewer/WebViewer_1.7.1.25192.zip

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Søren Pedersen

unread,
Jun 30, 2014, 3:32:40 AM6/30/14
to pdfnet-w...@googlegroups.com
Thank you, it works :-)
Reply all
Reply to author
Forward
0 new messages