Print Page | Close Window

DrawCapturedPage - How many times?

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: General Discussion
Forum Description: Discussion board for Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2275
Printed Date: 23 Nov 24 at 4:21AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DrawCapturedPage - How many times?
Posted By: Proset
Subject: DrawCapturedPage - How many times?
Date Posted: 24 May 12 at 3:33PM
Hi
I'm want to CapturePage - once, then draw captured page(by ID) onto other pages. The code looks like this:
... some code...
CaptureID=qp.CapturePage(PageNo);

.... some code...

result= qp.DrawCapturedPage(CaptureID, 0, new_h, new_w, new_h);

....some code ...
qp.NewPage();
result= qp.DrawCapturedPage(CaptureID, 0, new_h, new_w, new_h);

All works ok Captured page is drawn on all pages. But when I'm call

qp.DeletePages(CurrentFilePagePointer,1) - for example

DrawCapturedPage with used CAptureID don't work anymore - despite of result is ok( ==1) but no content is drawn on page.
But if I'm use any "unused" CaptureID - for other captured page that page is drawn ok. So it's looks like qp.DeletePages destroy used capturedpage?

How I'm can workaround this odds feature? Now I'm forced to create a document with doubled amount of pages, capture all pages and use "unused" captureID when I'm need to.
But this method lead to very heave memory consumption and not affordable for some large files.

Any ideas?

I'm trying this on Q813-Q815 no mean. I'm use ActiveX version on C#











Replies:
Posted By: AndrewC
Date Posted: 28 May 12 at 6:21AM

I haven't had a chance to look at the code but I am guessing for optimisation purposes that captured pages are stored in the page tree and by calling DeletePages it reorganises the pages in this tree and invalidates the CapturePageID.  

1 option is to only call DeletePages at the end of your processing.  Another option is to split the document into smaller 1 or 2 page documents and process them later.  You can always recapture the page when required.

We would need to know more about your files and what you are trying to do.

Memory is cheap.  Using the 64bit version might make life easier for you as well.


Posted By: Proset
Date Posted: 28 May 12 at 7:41AM



Posted By: Proset
Date Posted: 28 May 12 at 8:06AM
Thank you I'm see that behavour is a library feature.
The code do something for imposition, some additional elements created from content that have been drawn on newpage, then rendering to images, but after I'm should to delete this page to create right one.
So in my mind library should'nt delete or invalidate captureId while document in memory. The qp.Newpage function dont destroy or invalidate CaptureId for example.

But about memory
I'm working with files with size about 20-30Mb to 180-300Mb or more. Software do the imposition of many files. When I'm load file the code eat memory as specified in manual, thats ok. But when I'm remove document from memory(qp.RemoveDocument), computer memory don't releases. After some 100Mb files the computer have no memory.

How to cope with this problem?


 



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