Print Page | Close Window

Quality of rendered PDF is not good

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2730
Printed Date: 11 May 24 at 9:15AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Quality of rendered PDF is not good
Posted By: hansjoergp
Subject: Quality of rendered PDF is not good
Date Posted: 11 Sep 13 at 9:16AM
Hello,

we use the quickpdf library to display pdfs on the screen (.net application).
For some pdfs (they are coming from a scanner) the quality is really bad (with acrobat Reader the PDF is okay). 
Which possibility we have to make the quality better?

We use this code:

Bitmap DrawPdfPage(int page, int width, int height)
        {
            var pw = pdf.PageWidth() / 72.0;
            var ph = pdf.PageHeight() / 72.0;

            int renderDpi = 72;
            renderDpi = (int)Math.Min(width / pw, height / ph); // fit both
            //renderDpi = (int)(width / pw);
            //renderDpi = (int)(height / ph);
            width = (int)(renderDpi * pw);
            height = (int)(renderDpi * ph);

            Bitmap bitmap = new Bitmap(width, height);

            if (page > 0 && page <= pdf.PageCount())
            {
                using (var g = Graphics.FromImage(bitmap))
                {
                    IntPtr dc = g.GetHdc();
                    pdf.RenderPageToDC(renderDpi, page, dc);
                    g.ReleaseHdc(dc);
                }
            }

            return bitmap;
        }

Best regards

Hansjoerg



Replies:
Posted By: AndrewC
Date Posted: 12 Sep 13 at 10:59AM
Hansjoerg,

Can you try adding the following line to you program somewhere after QP.UnlockKey.

QP.SetGDIPlusOptions(3, 1);     // Turn on image smoothing

Andrew.






Posted By: hansjoergp
Date Posted: 16 Sep 13 at 7:56AM
Thanks it works



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk