You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
docnet/src/Docnet.Core/Readers/PageReader.cs
Lines 211 to 214 in 728e6c9
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.
The text was updated successfully, but these errors were encountered: