Bug #11833
openWt PDF output problems with some versions of libharu 2.4.x
0%
Description
There appears to be a bug in libharu versions 2.4.0 through 2.4.3 where some floating point values are written incorrectly by the HPDF_FToA() function. This can result in corrupt PDF files where only a portion of the intended content is visible.
An attached example program, wt_test_chart.C, can be used to demonstrate the issue.
Testing was done with Wt 4.10.0 with both libharu 2.3.0 and 2.4.3 builds. In both cases, the interactive chart is displayed as intended. Pressing the "Export to PDF" button, however, results in different PDF output. The libharu 2.3.0 is similar to the interactive version, while the libharu 2.4.3 version is missing several elements, including the y-axis labels, title, and legend.
I've attached PDF samples from each build: test_haru_2_3_0.pdf and test_haru_2_4_3.pdf.
I've also posted a nix flake to make it easier to reproduce the exact builds I used. See:
https://github.com/tollb/wt_haru_test
More information on the libharu issue can be found here:
https://github.com/libharu/libharu/pull/187
https://github.com/libharu/libharu/issues/258
Of course, this is not directly a Wt issue, but perhaps Wt could provide a release note and/or a warning/error if an attempt is made to build with one of the affected libharu versions.
For reference, the repology site has information on which versions of libharu are included with various Linux distributions:
https://repology.org/project/libharu/versions
NOTE 1: It is possible that this issue does not appear on all platforms. I only have access to an x86_64-linux platform.
NOTE 2: It seems that the libharu HPDF_FToA() function is also called in rendering the interactive chart via Wt::WMeasurePaintDevice::drawText. But, I don't know if it has any adverse affect.
Files
No data to display