Invalid XOD file: Zip end header data is wrong size!

40 views
Skip to first unread message

David Compton

unread,
Jul 3, 2019, 7:05:16 PM7/3/19
to PDFTron WebViewer
We get the following error when files are loaded in our application on a frequent, intermittent basis.  All files are in xod format.   Given that it is intermittent I don't think that the problem is with our file server, although I'm not ruling that out.  Sometimes the error only appears in the browser console and does not stop the document from loading.  Other times it appears as an error in the web viewer itself, which is particularly bad as the end user then has to select another document or reload the browser to get rid of the error.

Invalid XOD file: Zip end header data is wrong size!
    at Object.onError (CoreControls.js:1123)
    at CoreControls.js:1130

You can see the problem if you go to https://app.docsontap.com.au and use the trial option.  If you have the browser console open and select different documents then you should find the error appears soon enough.  The error appears to happen more often if you just refresh the browser after having already viewed a document.

I've read other posts on this issue and none of them seem to resolve the problem.  Do you have any suggestions?  I'm happy to post the code for our file server - it is just a simple http server written in node - if that helps.

Kind regards,

David

Zhijie Zhang

unread,
Jul 5, 2019, 1:43:36 PM7/5/19
to PDFTron WebViewer
Hi David,

Hope you are doing well.


WebViewer will try to fetch parts of a XOD document instead of the whole document at once for the purpose of performance. In your website, WebViewer is sending a range request with 22 bytes to https://app.docsontap.com.au/assets/files/TapHereToBeginPortrait.xod but the content-length of the response is 27792. 

This usually means your node server doesn't support HTTP range requests properly. As the FAQ suggests, one way to workaround this issue is to pass streaming: true to the WebViewer constructor function. However, this will hurt performance a bit so it'd be better if we can make the server support range requests. Please let us know if you want us to take a look at your server code.

Best Regards,
Zhijie Zhang
Software Developer
PDFTron Systems Inc.

David Compton

unread,
Jul 8, 2019, 3:24:25 PM7/8/19
to PDFTron WebViewer on behalf of Zhijie Zhang
Hi Zhijie,

Your response put me on the right track.  That file you were referring to is the initial default document that we show.  It is stored locally on the device.  All other files are served from our file server, unless the user is offline.  So I needed to start off with streaming: true, and then change it to false once we load a file from the server.  I think the problem was intermittent due to timing issues.

Thanks for your help,

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-webview...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfnet-webviewer/c790eb32-ad13-4f0c-9bee-f59a50cc088c%40googlegroups.com.


--

Zhijie Zhang

unread,
Jul 9, 2019, 1:12:12 PM7/9/19
to PDFTron WebViewer
Hi David,

Just to confirm that you managed to resolve the issue?

To load a file with streaming false you can do instance.loadDocument('file_path', { streaming: false });

Let me know if you have any other questions. Thanks!

David Compton

unread,
Jul 11, 2019, 12:27:38 PM7/11/19
to PDFTron WebViewer on behalf of Zhijie Zhang
Yes the issue seems to be resolved.  Thanks again for your help.

--
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-webview...@googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages