Skip to content

Conversation

@miseke-ffw
Copy link

No description provided.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing to this project. This is your first pull request and we are so glad to have you onboard. We will review the request and get back to you soon. We love your contributions! Join our Discord community here to discuss this PR or ask questions.

@afreakyelf
Copy link
Owner

afreakyelf commented Jan 18, 2025

Hi, Can you please resolve the conflicts caused due to merging old PRs. Appreicate the changes you made.

@boy12hoody
Copy link

there has been issues with small fonts being barely seen due to low pdf quality. Can we see this PR merge anytime soon if it helps with that issue? @afreakyelf

@afreakyelf
Copy link
Owner

Hi @miseke-ffw, can you please resolve the conflicts. Thank you!

lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current,
statusCallBack: PdfRendererView.StatusCallBack? = null
statusCallBack: PdfRendererView.StatusCallBack? = null,
scrolledToTop: (Boolean) -> Unit = {},

This comment was marked as outdated.

statusCallBack: PdfRendererView.StatusCallBack? = null
statusCallBack: PdfRendererView.StatusCallBack? = null,
scrolledToTop: (Boolean) -> Unit = {},
onPageRendered: (page: Int) -> Unit = {},
Copy link
Contributor

@vitoksmile vitoksmile May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make lambdas as null by default

   scrolledToTop: ((Boolean) -> Unit)? = null,
   onPageRendered: ((page: Int) -> Unit)? = null,

import android.net.Uri
import java.io.File

sealed class PdfSource {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need class here? use sealed interface intead

@rschattauer
Copy link

Hi, I have taken over this pull request and added render quality and a simple (but not perfect) scroll to top functionality.

@rschattauer
Copy link

@afreakyelf , @vitoksmile , please re-review this, thank you very much! :)

pageMargin,
enableLoadingForPages
enableLoadingForPages,
renderQuality
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add comma, so we avoid 2 lines changes in next PRs

renderQuality,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


if (cached != null && currentBoundPage == position) {
if (DEBUG_LOGS_ENABLED) Log.d("PdfViewAdapter", "✅ Loaded page $position from cache")
val aspectRatio = cached.width.toFloat() / cached.height.toFloat()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can height be zero somehow?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrapped runCatching for safety

@mariooooo
Copy link

Can we see this pr merge soon?

@vitoksmile
Copy link
Contributor

vitoksmile commented Aug 29, 2025

@afreakyelf can we expect to merge it soon?
the RenderQuality sounds as a good improvement

I was experiencing issue with this as I had a PDF with small text size and grey color and with default bitmap size (screen width) the text wasn't readable
I had to make a fork and multiply it by 2, now with RenderQuality it's more customizable

if you prefer more customizations, we can extend this to

sealed interface RenderQuality {

    val qualityMultiplier: Float

    data object Normal : RenderQuality {
        override val qualityMultiplier: Float = 1f
    }

    data object High : RenderQuality {
        override val qualityMultiplier: Float = 2f
    }

    data object Ultra : RenderQuality {
        override val qualityMultiplier: Float = 3f
    }

    data class Custom(
        override val qualityMultiplier: Float,
    ) : RenderQuality
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants