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

Error when clicking the link in the pdf file #20

Open
dorukkangal opened this issue Mar 6, 2024 · 1 comment
Open

Error when clicking the link in the pdf file #20

dorukkangal opened this issue Mar 6, 2024 · 1 comment

Comments

@dorukkangal
Copy link

dorukkangal commented Mar 6, 2024

Hello, some users encounter the following error when opening the pdf files
Used library version: 1.0.14

Function used to open pdf file:

suspend fun renderFile(pdf: File): List<PdfPage> {
    val parcelFileDescriptor = ParcelFileDescriptor.open(pdf, ParcelFileDescriptor.MODE_READ_ONLY)
    val pdfDocument = pdfiumCore.newDocument(parcelFileDescriptor)

    return renderPdf(pdfDocument).also {
        pdfPages.addAll(it)
    }
}

Error detail:

java.lang.UnsatisfiedLinkError: No implementation found for long io.legere.pdfiumandroid.PdfiumCore.nativeOpenDocument(int, java.lang.String) (tried Java_io_legere_pdfiumandroid_PdfiumCore_nativeOpenDocument and Java_io_legere_pdfiumandroid_PdfiumCore_nativeOpenDocument__ILjava_lang_String_2) - is the library loaded, e.g. System.loadLibrary?
    at io.legere.pdfiumandroid.PdfiumCore.nativeOpenDocument(SourceFile)
    at io.legere.pdfiumandroid.PdfiumCore.newDocument(SourceFile:57)
    at io.legere.pdfiumandroid.PdfiumCore.newDocument(SourceFile:45)
    at io.legere.pdfiumandroid.suspend.PdfiumCoreKt$newDocument$2.invokeSuspend(SourceFile:26)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:33)
    at kotlinx.coroutines.DispatchedTask.run(SourceFile:108)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(SourceFile:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(SourceFile:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:684)
@johngray1965
Copy link
Owner

1.0.14 is rather old. Do you see on the latest? That looks like a race condition on loading the native libraries, but I reworked it recently so everything will wait until the native libraries are loaded.

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

2 participants