- Home /
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 (https://assetstore.unity.com/packages/tools/gui/pdf-renderer-32815) as it doesn't work on mobile. There's another asset that should work (https://assetstore.unity.com/packages/tools/gui/3d-webview-for-android-and-ios-web-browser-135383) 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!
Answer by asafsitner · Mar 14 at 03:24 PM
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!
Surprisingly, it seems like an abandoned area. I've been looking for more solutions, and most of them are very old, abandoned, or deprecated.
If you could convert the PDF into images beforehand it wouldn't be a problem... Seems like more research is required!
Your answer
Follow this Question
Related Questions
iOS can't open local file with Application.OpenURL() 1 Answer
Open a PDF on Android and iOS 2 Answers
PDF Generation in Unity for Android and iOS 0 Answers
big terrain performance && mobile 1 Answer
C++ windows DLL and Android? 1 Answer