Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #6328 Reply

    Denis

    Hi All,

    I have a question:
    I get outofmemory exception when try to open pdf file (25mb) via openURl. I think this method loads full document on device memory.

    Is it possible to open the document via stream( Input stream) or you have interface for override communication with file?

    PS. The file about 50 mb I cannot open via url,

    Thanks,
    Denis

    #6332 Reply

    Dr. Plug
    Moderator

    Hi Denis ,

    Yes, you’re right. This is an issue on our side. Sorry for your inconvenience. I will fix this issue and notify you within a day or two, at most.

    Thanks,

    Dr.Plug

    • This reply was modified 1 year, 10 months ago by  Dr. Plug.
    #6336 Reply

    Dr. Plug
    Moderator

    Hi Denis,

    Please download the latest version of the PlugPDF SDK. I fixed this issue and updated PlugPDF SDK version 2.5.33 at the below link.

    http://plugpdf.com/sdkfile/PlugPDF_Android.zip

    it cause was due heaped in memory. So, if file size is more than 5MB, our SDK write file on the cache directory.

    Thanks,

    Dr.Plug

    #6352 Reply

    Denis

    Hi,

    Thank you, will try new SDK.

    What about using input stream?
    Can I override communication with file? (I mean use custom InputStream).

    Thanks,
    Denis

    #6355 Reply

    Dr. Plug
    Moderator

    Hi Denis,

    I’ve used FixedLengthInputStream class in the HttpURLConnection class. I think that it is hard to implement. However, you can find downloaded file such as ‘new File(Context.getCacheDir(), new URL(url).getFile())’.

    Cheers,
    Dr.Plug

    • This reply was modified 1 year, 10 months ago by  admin.
    #6379 Reply

    Denis

    Hi Dr.Plug,

    I have local file, but the file is encrypted.
    And using cache directory not very good for us. Will be good to have possibility to use inputStream.

    Maybe you can create interface which will work provide stream to file?

    eg.
    public abstract interface FileInterface
    {
    public abstract long getSize(parametrs);

    public abstract InputStream getInputStream(parametrs);

    public abstract boolean available(parametrs);

    ********

    }

    Thanks,
    Denis

    #6382 Reply

    Dr. Plug
    Moderator

    Hi Denis,

    I think to you want control slightly more complex. Then, I suggest use the ‘openFile’ or the ‘openData’, after download by yourself. actually, our SDK has been download and call the ‘openFile’ in the ‘openURL’.

    Cheers,

    Dr.Plug

    #6417 Reply

    Denis

    Hi Dr.Plug,

    Thank you.
    Do you mean I can open a pdf file via openFile(String paramString1, String paramString2); or openData(byte[] paramArrayOfByte, String paramString);?

    And I cannot use input stream or our local http server. Am I right?

    Thanks,
    Denis

    #6418 Reply

    Dr. Plug
    Moderator

    Hi Denis,

    Yes, you are right. our SDK not yet support open via stream.

    Thanks.
    Dr.Plug

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: OutOfMemoryError when open large file via url
Your information: