Ho to increases the image quality in pdfium.

697 views
Skip to first unread message

Mohan Selvaraj

unread,
Dec 19, 2017, 1:44:47 AM12/19/17
to pdfium

Hi All,

I have generated the entire PDF page as a image.But the image is slightly blurry ,So can you please provide any solution for increasing the sharpness for the bitmap image. 

Thanks,

Mohan Selvaraj

unread,
Dec 19, 2017, 1:56:12 PM12/19/17
to pdfium
HI ALL,

I have extracted the pdf page as an image by using the below code snippet,but on changing the size of the bitmap the text content in the image is not sharp ,it i s blurry
Can you suggest a solution for improving the quality of the rendered image.


var data = bitmapImage.LockBits(new Rectangle(0, 0, Width, Height), ImageLockMode.ReadWrite, bitmapImage.PixelFormat);
                    int bytes = Math.Abs(data.Stride) * bitmapImage.Height;
                    var createdpages = PdfiumViewer.FPDFBitmap_CreateEx(Width, Height, 4, data.Scan0, bitmapImage.Width * 4);
                    uint background = (flags & PdfiumNative.PdfRenderFlags.Transparent) == 0 ? 0xFFFFFFFF : 0x00FFFFFF;
                    PdfiumViewer.FPDFBitmap_FillRect(createdpages, 0, 0, Width, Height, background);
                    PdfiumViewer.FPDF_RenderPageBitmap(createdpages, pages, 0, 0, Width, Height, 0, 0);


Kindly provide a solution for rendering the image with shapness.

Regards,
Mohan S 
 

Lei Zhang

unread,
Dec 20, 2017, 10:58:23 PM12/20/17
to Mohan Selvaraj, pdfium
How much are you scaling by? Can you provide a sample PDF and the
output? Are you building your own PDFium or using someone else's
prebuilt library? What version is it?
> --
> You received this message because you are subscribed to the Google Groups
> "pdfium" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pdfium+un...@googlegroups.com.
> To post to this group, send email to pdf...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pdfium/535926cb-9d92-4453-8341-bb32437d3385%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages