packages.flutter icon indicating copy to clipboard operation
packages.flutter copied to clipboard

Render only area of a page to image

Open timovandeput opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. We want to display a zoomed area of a PDF page under our own pan & zoom control. Our idea is that we might be able to accomplish this by rendering the appropriate area of a PDF page to an image and show that image in a widget.

Describe the solution you'd like Rendering only a viewport of the PDF page to a target size image.

Describe alternatives you've considered Simply rendering the full image and cropping it is not acceptable, as the zoom level would create huge images that do not fit into memory and/or take too long to render.

Perhaps it would be possible to use the PDF page viewer and pass pan/zoom controls from our application to control the viewport of the viewer widget, and block the user from overriding. (Perhaps you can explain or point us to documentation on how to accomplish this using the existing code.)

Additional context (none)

timovandeput avatar Sep 24 '22 13:09 timovandeput

I meanwhile found out how to use the (internal) PdfTexture class to render a selection of a single page.

Is it possible to add this class to the public API of the library and provide some README documentation on how to use it?

timovandeput avatar Oct 28 '22 09:10 timovandeput