I have an applicaiton where I am createing many PDF documents in a loop. It works for many iterations (about 800+), but then fails throwing memory errors. Here is the Code:
function TForm1.WriteToPDF(pageIndex: Integer; var fileName: String) : Boolean;
var pdf : TWPPDFExport;
begin
fileName := FormatDateTime('mmddyyhhmmss', now) + '.PDF';
Result := False;
try
pdf := TWPPDFExport.Create(nil);
pdf.DLLName := IncludeTrailingPathDelimiter(ExtractFilePath(Application.exename)) + 'wPDF300A.dll';
pdf.Source := reMerge; // re Merge = TWPRickText
pdf.AutoLaunch := False;
pdf.FontMode := wpEmbedSubsetTrueType_UsedChar;
pdf.FileName := fileName;
pdf.Print;
Result := True;
finally
pdf.Free;
end;
end;
If I comment out the line "pdf.print;", the applicaiton sails throguh with no issues for thousands of iterations.
Am I implementing wrong or is there a defect in PDF.print that possibly was fixed?
I am using Delphi 2010.
WPDF tool version = 3.62
WPDF300A.dll version = 3.54.1.0
Thank you for Info