wcPdfDocument - closing and opening a new document

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
Pat Verner
Earned a small fee
Earned a small fee
Posts: 16
Joined: Mon Sep 06, 2010 6:58 am

wcPdfDocument - closing and opening a new document

Post by Pat Verner »

Hi there
I am running through a database, generating pre-completed application forms for a number of clubs. When I reach a new club, I want to close the current document, and open a new one.
Although SaveAsPdf() will "close" the file and save it, the next file generated contains everything from the first club and the second club, and so on. The 5th club contains pages from 5 clubs!
I have tried adding a Close() in the loop, makes no difference...
Is there any way to clear the old data in the file before continuing with the new file?

Regards
=Pat
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wcPdfDocument - closing and opening a new document

Post by utelle »

Pat Verner wrote:I am running through a database, generating pre-completed application forms for a number of clubs. When I reach a new club, I want to close the current document, and open a new one.
Although SaveAsPdf() will "close" the file and save it, the next file generated contains everything from the first club and the second club, and so on. The 5th club contains pages from 5 clubs!
I have tried adding a Close() in the loop, makes no difference...
Instances of wxPdfDocument are not meant to be reused for generating a new separate PDF document.
Pat Verner wrote:Is there any way to clear the old data in the file before continuing with the new file?
Yes, just instantiate a new wxPdfDocument object for each club.

Regards,

Ulrich
Pat Verner
Earned a small fee
Earned a small fee
Posts: 16
Joined: Mon Sep 06, 2010 6:58 am

Re: wcPdfDocument - closing and opening a new document

Post by Pat Verner »

Thanks.
=Pat
Post Reply