johngray1965 / PdfiumAndroidKt

Pdfium Android binding with Bitmap rendering ( >= API 21 )
Other
31 stars 12 forks source link

Add Zoom and Search Features #26

Closed AhmerAfzal1 closed 1 week ago

AhmerAfzal1 commented 1 week ago

Thank you for this great project!

It would be great to enhance the functionality of the this project library by adding zoom allow users to zoom in and out on PDF pages for better readability and search Implement a search feature to let users find specific text within the PDF

johngray1965 commented 1 week ago

Hello. The library will allow you to zoom and pan. You can call renderPageBitmap with matrix that has the pan and zoom encoding in it. Handling the UI to calculate the matrix from gestures beyond the scope of this library.

I have a fair amount of code that constructs an overlay that does the pinch and zoom in my application. I've thought about adding it to this project. But it's too application specific. It's not a good general solution. This library is going to hold at the support that's current in renderPageBitmap.

Search is really a app level issue too. You can get all the text from the pdf. Search that, and use the library to map that the areas on the screen.

johngray1965 commented 1 week ago

Generally speaking, we provide a wrapper to Google's Pdfium library. We don't wrap everything. We don't really do functionality beyond what pdfium does (other than interface sugar). Requests to wrap things that are in pdfium that we don't currently wrap are fruitful. Most others are not. There are unwrapped APIs for search.

AhmerAfzal1 commented 1 week ago

Thank you for your response. While the 'renderPage' functionality is appreciated, it alone is not sufficient to meet our requirements. Features such as a mandatory search function and zooming capabilities are essential to ensure a better user experience and full functionality. These features are crucial for improving accessibility, usability, and overall efficiency of the application. I kindly request that you consider integrating these functionalities in the solution

johngray1965 commented 1 week ago

Again, this project wraps pdfium to provide an Android interface. I'm working on wrap the search functionality. There is an extensive amount of UI to implement pan and zoom. This project doesn't provide UI support (just a sample UI for how to use it). The underlying functionality is already there.

Pan and Zoom is highly application specific. I wrote this because the previous project wasn't maintained anymore. My project has 1000s of lines of for handling the pan and zoom, and its not general purpose, its very specific to my application.

And it's all layout based, where the modern UI technology is Compose.

If there APIs in Pdfium that we aren't exposing, we'll happy to do that. But that's all.

If you'd like help with what's beyond this library, we'd be happy to help on a contract basis. But its beyond the scope of this project.

johngray1965 commented 1 week ago

1.0.24 is on it's way out. It has the search apis implemented.

the library has the underlying support to do pan and zoom. Higher level support (like UI support) it beyond the scope of this project.

AhmerAfzal1 commented 1 week ago

Thank you