Project

General

Profile

Actions

Bug #11833

open

Wt PDF output problems with some versions of libharu 2.4.x

Added by Bruce Toll 9 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/17/2023
Due date:
% Done:

0%

Estimated time:

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

wt_test_chart.C (3.88 KB) wt_test_chart.C Bruce Toll, 07/17/2023 04:05 PM
test_haru_2_3_0.pdf (3.96 KB) test_haru_2_3_0.pdf Bruce Toll, 07/17/2023 04:05 PM
test_haru_2_4_3.pdf (3.99 KB) test_haru_2_4_3.pdf Bruce Toll, 07/17/2023 05:03 PM

No data to display

Actions

Also available in: Atom PDF