Home Devices

Issues and exception when exporting to Tiff

Hi,

I'm updating an application from Delphi 2006/ReportBuilder 7 to Delphi 11 and I'm currently testing with ReportBuilder 21.5.

One of the functionality needed is the ability to export reports to Tiff. I tried 2 separate methods using ppTIFFDevice and ppWICDevice.

With ppTIFFDevice I got the export to work properly but I needed to include LibTiffDelphi and the only version I could find online was part of an unrelated github repository. If this is the preferred method could you please point me to the right place to download LibTiffDelphi?

With ppWICDevice I get an "Invalid pointer operation" exception when calling Report.Print. The file is created but it remains in use until the application is closed and there is a big memory leak. I have tried everything and believe this might be a bug since I'm using such a simple test case.

Also, with either method is it possible to set options like SinglePage and compression method without using the PrintToDevices method?

Here is the basic program I'm using to test:

uses
ppReport, ppTypes, ppTIFFDevice { or ppWICDevice };

procedure TForm1.FormShow(Sender: TObject);
var
Report : TppReport;
begin
Report := TppReport.Create(nil);
try
Report.DeviceType := dtTIFF;
Report.AllowPrintToFile := True;
Report.Print;
finally
FreeAndNil(Report);
end;
end;
Thank you for your help



Comments

  • Hi Mauricel,

    I highly suggest testing with the latest version of ReportBuilder as it will have all new features and bug fixes (RB 22.02).

    See the following article for more information on exporting to TIFF format. Included is example code as well as a download link for the LibTiffDelphi library.

    https://rbwiki.digital-metaphors.com/output/image/tiff-image-export/
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hi,

    Thank you for your help! I have downloaded LibTiffDelphi from the provided link and it works well. I will stick with this solution.

    I have updated to 22.02 and tested with ppWICDevice but I'm unfortunately still getting the same "Invalid pointer exception" error.

  • edited July 2023
    Hi Maurice,

    I created a patch for RB 22.02 that resolves the TppWICDevice issue. TppWICDevice is great solution for exporting reports to TIFF, by default exporting all pages to a single TIFF file

    RB developers with an active license can email support@ and request the patch.


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
Sign In or Register to comment.