Skip to content

[6.0.0] Width of PDF generated via "Edit Report" > "Content format" > "Send as PDF" is not visible but must be set by selecting before "Content format" > "Send as PNG" > "Screenshot width" #36948

@SupersetOdT

Description

@SupersetOdT

Bug description

For reports and alerts, no field offers to set the width of the PDF.

Image

=============================================================

Very strangely, the value of the width of the PDF can be fixed if it is previously written in "Edit Report" > "Content format" > "Send as PNG" > "Screenshot width"... , then by changing "Content format" to "Send as PDF" 🤔

Image

=============================================================

In the screenshot example above, my PDF is indeed output at a width of 2200 pxl (= 776 mm *72 dpi / 25,4 mm/inch).
(Indeed, I noticed that for a configuration set in "custom_superset_config.py" with "WEBDRIVER_WINDOW = {"pixel_density": 1,}" (which is the case in this example), all the screenshots are done at 72 dpi.)

Image

=============================================================

Moreover, given that the width of the reports must be located between 1200 and 2400 pxl * {"pixel_density": X,} and given the 72 dpi or more of the screenshots, it should be noted that in the current state, it is impossible to generate a PDF with a width corresponding to the ISO A4, A3 or A2 format. (420 mm = 1191 pxl). Only the widths of ISO A1 (594 mm = 1684 pxl) or even larger PDF formats... are possible.

The solution would be to add a field "Edit Report" > "Content format" > "Send as PDF" > "Width in mm", where we could add the width of an ISO format with a resolution higher than 72 dpi (insufficient quality for A4 -> 200 or 300 dpi would be ideal in this case).

Screenshots/recordings

No response

Superset version

6.0.0

Python version

3.11

Node version

18 or greater

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    alert-reportsNamespace | Anything related to the Alert & Reports feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions