Hey guys, I want to display a pdf in my app, but I...
# compose
b
Hey guys, I want to display a pdf in my app, but I dont know how to do it. The pdf will be local, its really only the display portion that I need help with. I've searched for a library/solution that could work, but I haven't found much. I also ok with opening the pdf in another app, but I also dont know how to do that. Can anyone help me?
m
Are you talking about Compose for Android or Multiplatform?
b
multiplatform, Is this not the right channel? im new around here
m
The channel is OK but my answer differs depending on your answer. I just did that recently and had to use different solutions depending on the platform. For Android you can use PdfRenderer which comes directly with Android. For the desktop platform you can use PDFBox. For other platforms I don’t know.
b
my app is for android and ios, but thank you ill look into pdfrenderer
s
Use can check this repo to render pdf from network resource and display in android using Jetpack Compose and on ios Swift UI Repo : https://github.com/swapnil-musale/KMP-PDF-Viewer
b
Thanks ill check it out
👍 1
c
not directly applicable, but android 15 is apparently improving pdf support: https://arstechnica.com/gadgets/2024/03/android-15-gets-satellite-messaging-starts-foldable-cover-app-support/
Android's PDF support can be all over the place depending on what device you have, so Android 15 is including making some big improvements to the built-in PDF render. First it's going to end up as a module so it can be updated via the Play Store. Google says this Android 15 version is getting "advanced features such as rendering password-protected files, annotations, form editing, searching, and selection with copy."