Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose clipping for IPageReader.GetImage #59

Open
ghosttie opened this issue Mar 8, 2022 · 0 comments
Open

expose clipping for IPageReader.GetImage #59

ghosttie opened this issue Mar 8, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ghosttie
Copy link

ghosttie commented Mar 8, 2022

I'm writing a viewer that converts a server-side PDF to image tiles to send to the client to display.

The viewer has zoom functionality, so to avoid pixelation when zoomed in, the server passes the zoom level to DocLib.GetDocReader to get a good quality image which it then crops into tiles.

The problem that I have is that as the zoom level increases, the image that we get from IPageReader.GetImage gets bigger until System.Drawing.Bitmap can no longer handle an image that big (and it starts being a large amount of memory to allocate).

Looking at the source code for PageReader, it looks like PDFium supports clipping the image, but this isn't exposed through Docnet:

clipping.Left = 0;
clipping.Right = width;
clipping.Bottom = 0;
clipping.Top = height;

It would be great if this was exposed so I could pass in coordinates to get an area within the image rather than the whole image.

@Modest-as Modest-as added the enhancement New feature or request label Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants