Hi Sardor,
I’ve spent a lot of time trying to sort this out today. I reckon that this problem is related to the problem that I have reported in this ticket: https://groups.google.com/g/pdfnet-webviewer/c/o9ItOwYfbZg/m/6pLXMODrAwAJ
I believe that something has changed in being able to set the streaming parameter when calling loadDocument.
Previously my code to load a local file was: self.webViewerInstance.loadDocument(objectUrl, { filename: fileName, streaming: false }); (as per https://groups.google.com/g/pdfnet-webviewer/c/Mo1DVAAWb2I/m/Yr3CpaclBwAJ).
However, today I found the following in the typescript definitions for the loadDocument method:
- @param [options.xodOptions.streaming] - A boolean indicating whether to use http or streaming PartRetriever, it is recommended to keep streaming false for better performance. https://www.pdftron.com/documentation/web/guides/streaming-option.
So it seems that the parameter now needs to be passed as part of an xodOptions object. So I’ve updated my code to load a local file to the following:
private localXodOptions = { streaming: true, startOffline: true };
private serverXodOptions = { streaming: false, startOffline: false };
…
self.webViewerInstance.loadDocument(objectUrl, { filename: fileName, xodOptions: self.localXodOptions });
However that doesn’t actually help. I still get the same error and the same problem with extra characters being added to the objectUrl.
My code to load local files has been working for a long time, so something seems to have changed on the WebViewer side. I really need to get this sorted out. Any assistance or direction that you can provide would be appreciated. I’m happy to do a remote screen sharing session if that helps. I have done that in the past with Justin and it helped us to resolve an issue that was hard to track down via email.
Kind regards,
David