Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

What's the most efficient way to open an Uri? 4 years 11 months ago #14363

  • ville
  • ville's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 1
Hi, and thank you for the example!

I have an input stream obtained from a Uri like this:
final InputStream inputStream = this.application.getContentResolver().openInputStream(uri);

btu doc.Open does not seem to accept Uri nor InputStreams. What's the most efficient way to open an Uri?

Please Log in or Create an account to join the conversation.

What's the most efficient way to open an Uri? 4 years 11 months ago #14368

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
2 ways you can open from url.
1. download whole PDF file to storage, and then open file from storage.
2. anwser like: www.radaeepdf.com/forum/Android-developm...ages-to-images#14367

Please Log in or Create an account to join the conversation.

What's the most efficient way to open an Uri? 4 years 10 months ago #14381

  • ville
  • ville's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 1
Hi,

for future forum travellers: one can use PDFMemStream like this
PDFMemStream stream = new PDFMemStream(bytes);
int result = doc.OpenStream(stream, null);

Stream to byte buffer is plain ol java, google/stackoverflow that.
The following user(s) said Thank You: support

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum