DImuthuUpe / AndroidPdfViewer

Android view for displaying PDFs rendered with PdfiumAndroid
Apache License 2.0
8.17k stars 1.91k forks source link

The Pdf viewer support fold devices #1205

Open malaynagarro opened 3 months ago

malaynagarro commented 3 months ago

fun PdfViewer(
    uri: Uri,
    modifier: Modifier = Modifier,
    onError: () -> Unit
) {
    AndroidView(
        factory = {
            PDFView(it, null).apply {
                fromUri(uri).onRender { _, _, _ ->
                    fitToWidth()
                }
                    .onError { onError() }
                    .load()
            }
        },
        modifier = modifier
    )
}```

the above works fine with the normal phone but it uses to create error on Samsung fold 5 devices and Samsung high ends phone like Samsung s23 ultra