ExportPDF in TTask

edited December 2021 in FastReport VCL

Hi...

function TPrintBase.ExportPDF(FilePath, FileName: string): Boolean;

begin

  Result := FReport.Export(FReportPDFExport); // in TPrintBase create - Error: here in this line

if Result then

begin

try

ifnot FGhostscript.PDFShrink(FilePath + FileName) then// Fehler über Event

begin

        Result := False;

end;

except

      Result := False;

end;

end;

end;

....

TTask.Run(procedure

begin

            ExportPDF(Print.PDF.FilePath, Print.PDF.FileName); // Archiv

end);

....

Error:

Im Projekt XX.exe ist eine Exception der Klasse EClassNotFound mit der Meldung 'class Picture not found' aufgetreten.

....

:74f7a8b2 KERNELBASE.RaiseException + 0x62

System.Classes.ClassNotFound('Picture')

System.Classes.FindClass('Picture')

frxXMLSerializer.TfrxXMLSerializer.ReadComponentSt r($25192D50,'Picture',True)

frxPreviewPages.DoObjects($28781730,$25192D50)

frxPreviewPages.TfrxPreviewPages.GetPage(0)

....

PS: Without TTask it is ok... 😒

Thanks... :-)

Comments

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.