Problem with slow printing...

forum.sourcecode (2000-2005) & (2005-2010)
Stefan Straub

Problem with slow printing...

Post by Stefan Straub » 13 Feb 2009, 10:10

 Posted by:  Stefan Straub 

Hi @all,

i've got a problem with printing.

The task is to print about 3600 pages (~3400 invoices).

So the problem is that while printing the first 300 pages goes on really
fast, printing gets slower and slower after that. At last 3600 pages
would take more than a day to print.

Data is fetched from a SQLBase - database (which later on is somewhat
bored I guess ;-)) into functional class objects (e.g. cFC_Invoice for
the invoice header, cFC_Receiver for the receiver and cFC_Positions for
the invoice positions)

The routine looks similar to this:

On SAM_ReportFetchNext

If (bPrevInvoiceDone)
Set i_oInvoice = new cFC_Invoice
Call i_oInvoice.cfClear()
Call FetchNextInvoice(i_oInvoice)
! -- The same is done once per invoice for the receiver and the

! -- If the positionlist is filled get next position into local

If (i_oPositions.cfHasMore())
Set oPosition = new cFC_Position
Call oPosition.cfClear()
Set oPosition = i_oPositions.cfGetNext()

and so on...

The problem seems to be that memory isn't actually released after one
invoice is done. Even though the objects are initialised as OBJ_Null.

Has anyone got any ideas?

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: Problem with slow printing...

Post by Jeff Luther » 16 Feb 2009, 19:23

 Posted by:  Jeff Luther 

Sounds like you are trying to print a single 3600-page report, Stefan. My
first suggestion would be to treat each report/invoice as a separate item,
and code your printing so it does not begin the next report until the form
receives a SAM_ReportFinish for the current invoice. That way RB has a
chance to complete its cycle of start/init/next/finish before beginning

- Jeff/Unify Corp.

Stefan Straub

Re: Problem with slow printing...

Post by Stefan Straub » 17 Feb 2009, 10:18

 Posted by:  Stefan Straub 

Thanks for your respoinse Jeff,

but that would be no possible solution, 'cause we need a 3600 pages
PDF-File (using PDF-Creator) for printing and enveloping. One
pdf/invoice won't work with the enveloping-machine. And waiting one day
until all is printed is not really fun...

Lumir Paul

Re: Problem with slow printing...

Post by Lumir Paul » 17 Feb 2009, 13:47

 Posted by:  Lumir Paul 

Hi Stefan,

I am sure that the problem is not in CTD,
but in PDF-Creator.
I use PDF-Creator very often to create invoices and
I observed the same phenomenon (printing gets
slower and slower).
I decided to separate PDF print into more runs with
approximately 500 invoices in one run. Max. number
depends mainly on whether the invoice contains
images (BMP,JPG for logo,signature etc.)
With images occurs the deceleration much earlier.
Additional problem is only that after every run, it is
necessary to rename the resulting PDF file if it is
already closed. For this I use a trick that I described
on "", 10.9.2008
In the manner described I finally reached a very quick
creation of PDF invoices.

Hope it will help you, have a nice day.

Lumír Paul

Stefan Straub

Re: Problem with slow printing...

Post by Stefan Straub » 17 Feb 2009, 14:29

 Posted by:  Stefan Straub 

The problem can't be PDFCreator alone I guess, cause printing on our
80pages/minute printers isn't really faster. And the problem is that the
PDF's can't be splitted AND sometimes invoices must be printed directly
on a printer. Strange problem I know...

Posts: 2206
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: Problem with slow printing...

Post by FRBhote » 18 Feb 2009, 06:40

 Posted by:  F R Bhote 

Try printing to file with a generic printer - that should show up the
difference if any...

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests