sadpandajoe commented on code in PR #43762:
URL: https://github.com/apache/superset/pull/43762#discussion_r3938742983


##########
superset/config.py:
##########
@@ -1352,6 +1352,59 @@ def sync_theme_logo_href(
 )
 SCREENSHOT_TILED_VIEWPORT_HEIGHT = 2000  # Height of each tile in pixels
 
+# ---------------------------------------------------------------------------
+# Browser-print PDF configuration (DASHBOARD_REPORTS_BROWSER_PRINT_PDF)
+# ---------------------------------------------------------------------------
+# These keys are only read when the feature flag is enabled.  All have
+# safe defaults so existing deployments are unaffected by the flag.
+
+# Global default font-size tier for browser-print PDFs.
+# Accepted values: 'small' (default), 'medium', 'large'.
+# Can be overridden per-report in the Alerts & Reports modal.
+BROWSER_PRINT_PDF_FONT_SIZE: str | None = None  # None = 'small'
+
+# Global default column layout.
+# Accepted values: '1col' (default), '2col'.
+# '2col' places charts that originally occupied ≤ 50% of the row side-by-side.
+# Table charts are always kept full-width regardless of this setting.
+BROWSER_PRINT_PDF_LAYOUT: str | None = None  # None = '1col'
+
+# Global default page orientation.
+# Accepted values: None/'portrait', 'landscape', 'auto'.
+#   portrait  — A4 portrait (210×297 mm) throughout.
+#   landscape — A4 landscape (297×210 mm) throughout.
+#   auto      — Mixed-orientation: portrait by default; pages containing a
+#               table wider than the portrait page width switch to landscape.
+#               Uses CSS @page named pages with prefer_css_page_size=True.
+BROWSER_PRINT_PDF_ORIENTATION: str | None = None  # None = portrait
+
+# Playwright viewport width used when rendering the dashboard for PDF capture.
+# The rendered content is scaled to A4 paper width (794 CSS px) by page.pdf().
+# Use the authored dashboard width for best results (1600 px is the default).
+BROWSER_PRINT_PDF_VIEWPORT_WIDTH: int = 1600
+
+# Set to False to disable the per-page header and footer band entirely.
+BROWSER_PRINT_PDF_HEADER_FOOTER: bool = True
+
+# Global default header slot content.
+# Keys: "left", "center", "right".
+# Supported tokens: {title} (dashboard title, HTML-escaped), {date} (Chromium 
date).
+# Can be overridden per-report in the Alerts & Reports modal.
+# Each slot is capped at 200 px; long strings are truncated with an ellipsis.
+BROWSER_PRINT_PDF_HEADER_CONTENT: dict[str, str] = {
+    "left": "{title}",
+    "center": "",
+    "right": "Apache Superset | {date}",
+}
+
+# Global default footer slot content.
+# Keys: "left", "center". The right slot ("Page N of M") is always fixed.
+# Can be overridden per-report in the Alerts & Reports modal.

Review Comment:
   Enabling this feature adds a footer labeled `Confidential` and other 
operator-visible PDF defaults, but the shipped documentation only shows the two 
feature flags; it does not describe these new configuration knobs or the 
default footer. Operators can enable it and unintentionally send 
branded/confidential report content. Could we document the browser-print 
settings (including how to disable or override the header/footer) and add the 
rollout flag to the feature-flag catalog?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to