Because I use react native framework and I don’t know deeply about java code, can give some example git repo to help me?
I had read code from the android native of pdftron SDK but I don’t know where the file to apply code above.
Our react native library uses streaming by default when passing in HTTP/HTTPS files into the pdf viewer.
Can you ensure the PDF is linearized as mentioned in the guide.
Are you currently encountering any issues with streaming a document using react native?
How to know it working? Because with document is must be use function mPdfViewCtrl.openUrlAsync but in my code just use Uri fileUri = ReactUtils.getUri(getContext(), path, false); mPdfDoc = openPDFUri(fileUri, "");
What different with 2 method?
Just to further clarify, streaming in this case refers to showing partial PDF content while downloading online PDFs as described here. Is this what you’re looking for? If not could you describe your use case?
In React Native you can load and view a document using the following code :
If you enter a file location as a URL this will automatically stream a file assuming your server side client is setup to handle byte ranges and your document is linearized. You do not need to modify Java code to get streaming to work by default in our React Native viewer.
As for your specific question, openUrlAsync opens URL documents and openPDFUri will open any PDF (i.e. local file path, or URL). Internally, openPDFUri will call openUrlAsync if the Uri points to a URL. You can test that this is working by viewing a large document. If streaming is working properly then you should be able to see the document in the viewer very quickly even before the entire document has finished downloading.