I am trying to use the WebViewer in a new Ionic 2 project. I try to setup the viewer using the code below in the platform.ready() event.
setupWebViewer() {
var viewerElement = document.getElementById("viewer");
this.webViewer = new PDFTron.WebViewer({
type: "html5",
path: "assets/pdftron/",
initialDoc: "/assets/pdftron/GettingStarted.xod",
documentId: "GettingStarted",
enableAnnotations: true,
streaming: false,
mobileRedirect: false
}, viewerElement);
}
The viewer initializes, however I get the following error: "Invalid XOD file: Zip end header data is wrong size!". I'm just trying this out in the browser using "ionic serve". I have not tried running it on a real device as yet.
Can you advise what I need to do to get the document to load correctly.
Kind regards,
David