I'm experiencing a strange behaviour with @DonManfred's pdfrenderer library (which, by the way, is very useful so thank you for making it).
It seems to cause a crash when trying to render a specific .pdf file.
Here's what I'm doing in a nutshell: I'm downloading a .pdf file from an URL using an HttpJob. Once the job is done I use the bytestofile function to save it in the DirInternal folder. Once it's saved I use the pdfrenderer to save each page as a .png file. I then construct a string of html code that will display all images in a row and then load that html code into a webview and display it to the user.
The issue arises with one particular line of code that initializes a bitmap with a page from the pdf file, the line in question being bt.Initialize3(pdfrenderer.renderPageforPrint(cont)). The cont is a counter as this is in a for cycle based on the number of pages. This line crashes the app bypassing the crash handler. I've tried encasing it into a try catch block with no results.
The extremely strange thing is that this behavior only happens with one specific pdf file, and it can be reproduced without fail. I've attached a small project that displays the behaviour as well as the two pdf files the project downloads in case it's something to do with that specific file (which it probably is but exactly what eludes me).
Any help is appreciated.
Oh and I'm using a phone running android 5.0.1.
It seems to cause a crash when trying to render a specific .pdf file.
Here's what I'm doing in a nutshell: I'm downloading a .pdf file from an URL using an HttpJob. Once the job is done I use the bytestofile function to save it in the DirInternal folder. Once it's saved I use the pdfrenderer to save each page as a .png file. I then construct a string of html code that will display all images in a row and then load that html code into a webview and display it to the user.
The issue arises with one particular line of code that initializes a bitmap with a page from the pdf file, the line in question being bt.Initialize3(pdfrenderer.renderPageforPrint(cont)). The cont is a counter as this is in a for cycle based on the number of pages. This line crashes the app bypassing the crash handler. I've tried encasing it into a try catch block with no results.
The extremely strange thing is that this behavior only happens with one specific pdf file, and it can be reproduced without fail. I've attached a small project that displays the behaviour as well as the two pdf files the project downloads in case it's something to do with that specific file (which it probably is but exactly what eludes me).
Any help is appreciated.
Oh and I'm using a phone running android 5.0.1.
Attachments
Last edited: