GitHunt

Android PDF-Viewer

Library for displaying PDF documents on Android. There are basic gestures for scrolling and zooming without loss of quality due to rendering fragments of pages that are visible on the screen. There are also horizontal and vertical layouts.

Preview

Preview

Preview

Integration

Add to build.gradle:

implementation("io.github.marat101:pdf-viewer:1.0.0-alpha01")

Using

@Composable
fun Example(
    modifier: Modifier = Modifier,
    uri: Uri
) {
    val state = rememberReaderLayoutState(
        minZoom = 0.3f,
        maxZoom = 10f,
        uri = uri
    )
    ReaderLayout(
        modifier = modifier
            .fillMaxSize()
            .clipToBounds(),
        layoutState = state,
    ) {}
}

Scroll to page by index

state.positionsState.scrollToPage(pageIndex)

Change layout orientation

state.positionsState.setOrientation(newOrientation)

Languages

Kotlin100.0%

Contributors

Apache License 2.0
Created January 1, 2025
Updated March 12, 2026