Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF rendering failed with same url, that was successfully loaded previously #72

Closed
sunit09 opened this issue Mar 15, 2018 · 3 comments
Closed

Comments

@sunit09
Copy link

sunit09 commented Mar 15, 2018

I am opening pdf from a listview item click. After first installation, its working fine for 2 or 3 times with different pdf rendering. after that onSuccess is triggred, but pdf rendering failed, even for the same url that was successfully loaded previously. Max pdf size 300KB.

Please find the log below:
W/System.err: java.io.IOException: file not in PDF format or corrupted D/gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 4096 W/System.err: at android.graphics.pdf.PdfRenderer.nativeCreate(Native Method) W/System.err: at android.graphics.pdf.PdfRenderer.<init>(PdfRenderer.java:166) W/System.err: at es.voghdev.pdfviewpager.library.adapter.BasePDFPagerAdapter.init(BasePDFPagerAdapter.java:75) W/System.err: at es.voghdev.pdfviewpager.library.adapter.BasePDFPagerAdapter.<init>(BasePDFPagerAdapter.java:57)

@voghDev
Copy link
Owner

voghDev commented Aug 28, 2018

True, my bad. Already had this issue fixed in my version of the code, and haven't released yet. Thanks for opening the issue @sunit09. Will release the fix ASAP

@voghDev
Copy link
Owner

voghDev commented Aug 28, 2018

Fixed in v1.0.5

implementation 'es.voghdev.pdfviewpager:library:1.0.5'

@junchenChow
Copy link

junchenChow commented Oct 18, 2018

in v1.0.5
E/System: java.io.IOException: file not in PDF format or corrupted
at android.graphics.pdf.PdfRenderer.nativeClose(Native Method)
at android.graphics.pdf.PdfRenderer.doClose(PdfRenderer.java:250)
at android.graphics.pdf.PdfRenderer.finalize(PdfRenderer.java:238)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:252)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:239)
at java.lang.Daemons$Daemon.run(Daemons.java:105)
at java.lang.Thread.run(Thread.java:764)

url:
http://huyi-oss-user.oss-cn-shanghai.aliyuncs.com/1_1026443901453451265_1034325014347726849_contract_1535437315336_imgoss1

Once this problem occurs, the PDF after normal loading can not be opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants