Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Quality of rendered PDF is not good
  FAQ FAQ  Forum Search   Register Register  Login Login

Quality of rendered PDF is not good

 Post Reply Post Reply
Author
Message
hansjoergp View Drop Down
Beginner
Beginner


Joined: 11 Sep 13
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote hansjoergp Quote  Post ReplyReply Direct Link To This Post Topic: Quality of rendered PDF is not good
    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
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post 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.




Back to Top
hansjoergp View Drop Down
Beginner
Beginner


Joined: 11 Sep 13
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote hansjoergp Quote  Post ReplyReply Direct Link To This Post Posted: 16 Sep 13 at 7:56AM
Thanks it works
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store