Print Page | Close Window

split pages out to new file - memory issue

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


Topic: split pages out to new file - memory issue
Posted By: hobnob
Subject: split pages out to new file - memory issue
Date Posted: 23 Jul 12 at 9:58AM

I'm trying to load a large PDF file and split every page out to a new filename... but memory usage goes up and up and up for every new file until the machine crashes.

It appears it's the new output file created that causes this,   how do you release that new file from memory after save?

Here's a test to show the problem:-

int MainDocID = QP2->SelectedDocument();

for(int a=0;a<1000;a++)
{
QP2->NewDocument();
fileBW = QP2->SelectedDocument();

QP2->SelectDocument(fileBW);

QP2->CopyPageRanges(MainDocID, _L("1-1"));

QP2->DeletePages(1,1); // remove new file 1st blank page
QP2->SaveToFile(tempBW);
}





Replies:
Posted By: hobnob
Date Posted: 23 Jul 12 at 10:15AM
found the problem, needed: RemoveDocument



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