Jump to content
Der schöne Günther

FastReport 5 vs 6: PDF export

Recommended Posts

I have completely migrated a project that was built with Delphi 10.0 Seattle with Fast Report VCL 5.1.5 (and a few others, like TeeChart Pro) to Delphi 10.4 Sydney with Fast Report VCL 6.7.

 

I am having a problem with FastReport, especially the PDF export. I am generating "reports" that are just one A4 page in size, with a few images (TMetaFile). In FastReport 5/Delphi Seattle, it was more or less instant. Now, a PDF export for one page takes up to ten seconds. When I use the debugger to pause the application, the stacktrace often looks something like this:

 

:009c086c ; C:\Users\localUser\Desktop\myProject\Win32\Release\myApp.exe
:009bcde9 jpeg_write_scanlines + $9D
:009b03d6 TJPEGImage.JPEGNeeded + $E
frxExportPDF.TfrxPDFExport.AddObject(???)
frxExportPDF.TfrxPDFExport.ExportObject($4086150)
frxPreviewPages.ExportObject($4086150)
frxPreviewPages.ExportPage(0)
frxPreviewPages.DoExport
frxPreviewPages.TfrxPreviewPages.Export($38DD5D0)
frxClass.TfrxReport.Export(???)
:009c18ba @jpeg_fdct_float + $246
:009bee45 ; C:\Users\localUser\Desktop\myProject\Win32\Release\myApp.exe
:009bcde9 jpeg_write_scanlines + $9D
:009b03d6 TJPEGImage.JPEGNeeded + $E
frxExportPDF.TfrxPDFExport.AddObject(???)
frxExportPDF.TfrxPDFExport.ExportObject($4086150)
frxPreviewPages.ExportObject($4086150)
frxPreviewPages.ExportPage(0)
frxPreviewPages.DoExport
frxPreviewPages.TfrxPreviewPages.Export($38DD5D0)
frxClass.TfrxReport.Export(???)

Since I don't have the FastReport source code, I can only guess what is now suddenly taking so long. Directly printing to a printer is a bit faster, but still considerably worse than with Fast Report 5.

 

Does anyone have a clue? I am not aware of any new features that Fast Report 6 added, maybe it's possible to use an older Fast Report 5 version with 10.4? Probably not 😐

Share this post


Link to post

They have changed bitmap exports, in my opinion it scales bitmap up when not necessary, which takes time and memory (and sometimes results in Out of memory). I had a discussion and tested export ot bitmap (height = 3508) with following results:

- PrintOptimized=true, PictureDPI=300 --- Out of memory, TempBitmap.Height=10528 px
- PrintOptimized=false, PictureDPI=300 --- works, TempBitmap.Height=3509 px
- OLD_STYLE --- works, TempBitmap.Height=3508 px

  • Thanks 1

Share this post


Link to post

I don't even use bitmaps but vector images but yes, that seems to be the cause. I set PrintOptimized to false, and the speed is now tolerable. At least on one of the reports I tested. Many thanks!

 

I have been unable to find documentation, the RAD Studio installation ships with a PDF file that dates back to 2008, but I also found this blog entry where PrintOptimized is also mentioned:

 

http://web.archive.org/web/20200525054725/https://www.fast-report.com/en/blog/324/show/

 

Thanks.

Share this post


Link to post

Considering your callstack @Vandrovnik is probably right.

Another thing to check out is the (IMHO much better RichText export).

In version 5 RTF objects produced bitmaps. In version 6 it produces properly formatted text in the PDF (searchable, extractable).

That *could* also make things slower.

  • Thanks 1

Share this post


Link to post
Posted (edited)

If you are using TMetaFile in your report you can try to set AllowVectorExport to False for that component (in report editor). This way PDF export will work like version 5 generation an image.

Edited by Cristian Peța

Share this post


Link to post
Posted (edited)

Interesting. I was under the impression that the image was still exported as a JPEG image, even though AllowVectorExport was already true. Thanks, I will give it a try 😊

Edited by Der schöne Günther

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×