Print Page | Close Window

Range Check Error when using RenderPageToDC

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=1567
Printed Date: 06 May 25 at 12:00PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Range Check Error when using RenderPageToDC
Posted By: Jason
Subject: Range Check Error when using RenderPageToDC
Date Posted: 09 Sep 10 at 8:28PM

I am receiving a "Range Check Error" when using the RenderPageToDC function.  I am using Delphi 2007.  The issue first manifested itself to me with QuickPDF library version 7.19 but is also a problem with version 7.21.

It occurs when I try to render pages from a multipage document as well as with single page documents.  When rendering multipage documents, the range check error doesn't always occur on the same page. 
 
Any suggestions would be great.  Here is my code.
 
procedure TfrmPDFManager.GetPDFPreview(PDFFileName : String; DPI, PageNo : Integer);
var
   PDFLibrary : TQuickPDF0721;
   UnlockResult : Integer;
begin
Screen.Cursor := crHourglass;
Image1.Picture := nil;
PDFLibrary := TQuickPDF0721.Create;
try
 UnlockResult := PDFLibrary.UnlockKey(QUICKPDFLICENSEKEY);
 if UnlockResult = 1 then
    begin
    PDFLibrary.LoadFromFile(PDFFileName);
    Image1.Picture.Bitmap.Width := Round(PDFLibrary.PageWidth);
    Image1.Picture.Bitmap.Height := Round(PDFLibrary.PageHeight);
    PDFLibrary.SetOrigin(1); //--> Added this line to try to solve Range Check Error, no change.
    PDFLibrary.RenderPageToDC(DPI, PageNo, Image1.Canvas.Handle); //-->Range Check Error here
    PDFPAGES := PDFLibrary.PageCount;
    end;
 finally
 PDFLibrary.Free;
 end;
Image1.Repaint;
Screen.Cursor := crDefault;
end;



Replies:
Posted By: Rowan
Date Posted: 20 Oct 10 at 2:28PM
Hi Jason,

Would you be able to upload a sample document somewhere for us to download and also let us know what DPI you're rendering at?

I'd also recommend trying 7.22 beta 2 to see if you experience this issue:

http://www.quickpdflibrary.com/blog/2010/10/quick-pdf-library-7-22-beta-2-released-includes-delphi-xe-support/ - http://www.quickpdflibrary.com/blog/2010/10/quick-pdf-library-7-22-beta-2-released-includes-delphi-xe-support/

Cheers,
- Rowan.



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