Print Page | Close Window

Error on CapturePageEx

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=177
Printed Date: 07 May 26 at 6:51PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Error on CapturePageEx
Posted By: ExEE
Subject: Error on CapturePageEx
Date Posted: 10 Nov 05 at 11:30PM

Hello.  I'm using QuickPDF 5.11 on VB6 and am cropping a one-page document and imposing it onto a second document of the same size as the crop.  But for some reason, the CapturePageEx command generates an overflow error.  Here is my code.  Any ideas? 
--------------------------------------------------------------
    Dim DocID, CrpID, CapID As Integer
    Dim w, h, wCr, hCr As Integer
   
    Set QP = New iSED.QuickPDF
    QP.UnlockKey "<key>"
   
    QP.LoadFromFile "C:\WINDOWS\Desktop\Giraffe.pdf"
    DocID = QP.SelectedDocument
    QP.SelectPage 1
    QP.SetMeasurementUnits 2
    QP.SetOrigin 1
    w = QP.PageWidth
    h = QP.PageHeight
    wCr = w / 2
    hCr = h / 2
    QP.SetCropBox w / 4, h / 4, wCr, hCr
   
    QP.NewDocument
    CrpID = QP.SelectedDocument     'Target document of imposition
    QP.SelectPage 1
    QP.SetMeasurementUnits 2
    QP.SetOrigin 1
    QP.SetPageDimensions wCr, hCr
    QP.MergeDocument DocID
                                    '<--- Verified Pg Count = 2 and SelectedPage = 1
    CapID = QP.CapturePageEx(2, 1)  '<--- Overflow Error 
    QP.SelectPage 1
    QP.DrawCapturedPage CapID, w / 4, h / 4, wCr, hCr
   
    QP.SaveToFile "C:\WINDOWS\Desktop\Cropped.pdf"
   
    QP = Nothing




Replies:
Posted By: PhilG
Date Posted: 11 Nov 05 at 5:54PM
I'm still not sure why this error happens, but I found that it goes away if I save and reload the document before CapturePageEx.  I shouldn't have to do that, though. 


Posted By: Ingo
Date Posted: 13 Nov 05 at 3:01PM
Originally posted by PhilG PhilG wrote:

I'm still not sure why this error happens, but I found that it goes away if I save and reload the document


Hi!
I've made the same experiences. Save and reload and few errors will dissapear... Not a solution but a workaround ;-)
Seems that sometimes the temporary created pdf looks inside a bit different as a saved file.


-------------
Cheers,
Ingo




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