Dmitry-Borodin / pdfview-android

Small Android library to show PDF files
Apache License 2.0
295 stars 48 forks source link

PDF missing text #9

Closed ChadhaAashish closed 4 years ago

ChadhaAashish commented 4 years ago

@Throws(IOException::class) fun getTempFile(context: Context,tempFileNam : String): File? { val imageFile = File(context.externalCacheDir, tempFileNam) imageFile.parentFile.mkdirs() return imageFile }

fun fromTemPFile(temFileName: String): PDFView { mfile = FileUtils.getTempFile(context, "Aggrement")

    val decodedBytes: ByteArray = Base64.decode(temFileName, Base64.DEFAULT)
    val os: OutputStream = FileOutputStream(mfile)
    os.write(decodedBytes)
    os.close()

    return this
}

I have written these two functions to show pdf it is working fine in android 8 and above but in android 7 it is loading pdf without text

Dmitry-Borodin commented 4 years ago

Can you reproduce it in a sample app coming with lib? My guess that your file have some tags that android7's renderer doesn't support. It may be android's bug. If it does work with sample pdf but doesn't work with yours - the easiest way will be to update your file to supported one. But it's just a guess.

ChadhaAashish commented 4 years ago

Hi , My back end team is using pdflatex to generate the pdf. Can that be an issue ??

Dmitry-Borodin commented 4 years ago

I don't know.