Project

General

Profile

Bug #8051

WCartesianChart bad styled pdf print

Added by Harald Elmer 5 months ago. Updated 5 months ago.

Status:
New
Priority:
High
Assignee:
-
Target version:
-
Start date:
02/10/2021
Due date:
% Done:

0%

Estimated time:

Description

I have a WCartesianChart with zoom functionality, that should be print to pdf. (See chart1.png, example in hello.cpp)

Please check the following 3 use cases:

1.) Everything is fine if no zoom is applied. Chart in pdf is well styled and the entire area is visible. (See chart1.pdf)

2.) If you apply zoom with mousewheel and do nothing else, Chart in pdf is also well styled, but still the entire area is visible. (I admit, that this might also be a desired function)

3.) If you apply zoom and enter a date in the DatePicker below, so that WCartesianChart::setFormData(const FormData& formData) is called by the client, transform-parameters are changing and in the following the pdf chart shows only a part of the data (but not exactly the zoom area), and has also a bad styled x-Axis. (See chart2.png and chart2.pdf)

Is that something, I doing wrong, or how can I get a well styled pdf, no matter if zoomed or not ?
If this is a bug, and can be fixed. How can I force WCartesianChart::setFormData to ensure, that pdf shows zoomed area, before Button is pressed and WResource::handleRequest occurs ?

regards,


Files

chart1.PNG (13.6 KB) chart1.PNG Harald Elmer, 02/10/2021 04:15 PM
chart1.pdf (460 KB) chart1.pdf Harald Elmer, 02/10/2021 04:15 PM
chart2.PNG (14.2 KB) chart2.PNG Harald Elmer, 02/10/2021 04:15 PM
chart2.pdf (460 KB) chart2.pdf Harald Elmer, 02/10/2021 04:15 PM
hello.cpp (4.94 KB) hello.cpp Harald Elmer, 02/10/2021 04:15 PM
#1

Updated by Korneel Dumon 5 months ago

In general, when you render a widget to a PDF, it's best to make a completely new widget rather than using one that is shown in the browser. If you don't do this, then the same widget is rendered in two different places, which can cause some unexpected issues.

For this specific case, all I can say is that interactive zooming is only supported for a canvas paintdevice.

Also available in: Atom PDF