PDFTron for React Native (Android) unable to render files other than PDF with content Uri.
I am trying to render documents (.pdf, .doc, .docx etc.) using content uri with PDFTron with React Native (Android). In the documentation it is mentioned to pass uri in path (document={path}).
I am able to render .pdf files although other file types (such as .doc or .docx) are unable to render.
Does PDFTron for React Native support document rendering (*for file types other than PDF) with content uri?
Or I have to include file extension? If so, which API do I use?
Here is the Snapshot of the log and the output while trying to render .docx file
Hi Shirley, sorry for the late response. But I am able to render pdf files using the same approach.
Here’s snapshots of pdf I am able to render using similar uri.
Hi, as described in my previous message, you will need to box your link to a proper content uri with the “SCHEME_CONTENT” scheme. There is no other way. This is a proper solution, not a workaround. Alternatively, you can make a copy to the app’s sandbox, and send the local link (file://xxx.docx) to the viewer. Thanks.