Hi,
We have a hybrid app and we are using WebViewer to load the XOD document in Mobile.
The process is like:
1. Get the XOD file from server
2. Save the file in Application Data Directory (e.g. file:///data/user/0/<bundle_id>/files/form.xod).
3. Refer the path in initialDoc for displaying in Mobile
But for some reason, I am getting an error as 'XOD load error'. Please check the attachment for error details.
XOD doesn't have any issue because I am able to use the same XOD locally and it worked. I also tried saving the file in Application data directory and Application cache directory but no luck.
Sample Code:
var fileTransfer = new window.FileTransfer();
var uri = encodeURI(<server_url>);
var path = window.cordova.file.applicationStorageDirectory + 'form.xod' ;
fileTransfer.download(
uri,
path,
function(entry) {
var myWebViewer = new window.PDFTron.WebViewer({
path: 'vendor/webviewer/lib',
type: 'html5,html5Mobile',
mobileRedirect: false,
initialDoc: entry.toURL(),
documentType: 'xod',
documentId: 'form',
config: '../www/vendor/webviewer/lib/templateConfig.js',
enableAnnotations: false,
streaming: true,
showToolbarControl: false
}, viewerElement);
}
);
Please advice me.