Opening PDF on Mobile (iOS/Android)

Hi everyone

I’m trying to do something that seemed pretty straightforward but now a couple days in I’m realising it’ll be harder than expected (Classic developer line, eh?)

I would like to open a PDF and turn each page into a Texture2D.

This asset doesn’t work as advertised ( as it doesn’t work on mobile. There’s another asset that should work (3D WebView for Android and iOS (Web Browser) | GUI Tools | Unity Asset Store) but I don’t have €400 for this small project to justify the cost and I don’t need a 3D Browser, just need to open a PDF. There seems to be more PDF assets on the Unity Store but reading the description closely, I’m pretty sure they create and save PDFs, but they can’t open them.

Does anyone else have any suggestions? The only thing that comes to mind is opening a PDF file in an in-app browser, taking an image of the rendered document and then creating a Texture2D object from there.

Thanks for any help you can offer!

I haven’t tried it myself, but you should take a look at this StackOverflow thread, and this one as starting points.

Hi @asafsitner,
Thanks for your reply, I appreciate it. I have read both of these posts before and my understanding is that they both recommend ‘pdfium’. It seems that not only is the code no longer being maintained, it’s specifically for Windows and not mobile.
I hadn’t realised PDFs were such complicated documents!