Skip to content

expose clipping for IPageReader.GetImage #59

@ghosttie

Description

@ghosttie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions