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


##########
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:
   Addressed in commit 6186bad (already pushed in the previous batch).
   
   The docs/admin_docs/configuration/alerts-reports.mdx page now has a Global 
Configuration Knobs section documenting every BROWSER_PRINT_PDF_* key with 
accepted values, defaults, and copy-paste examples — including the explicit 
warning to review BROWSER_PRINT_PDF_HEADER_CONTENT / 
BROWSER_PRINT_PDF_FOOTER_CONTENT before deploying (the "Confidential" footer 
default is called out in its own highlighted note). The 
DASHBOARD_REPORTS_BROWSER_PRINT_PDF entry in docs/static/feature-flags.json was 
also updated to describe the header/footer defaults and link to the new docs 
section. Both the flag itself and every config knob it activates are now 
documented before operators can enable the feature.



-- 
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