GitHub user dosubot[bot] added a comment to the discussion: Deck.gl map change 
style directly on dashboard

<!-- Answer -->
To increase the PDF screenshot quality in Superset, you can adjust several 
configuration options:

1. **Image Quality Settings**: Modify the `quality` parameter in the `Image` 
interface to specify the quality of the image in the PDF export. Setting the 
quality to a higher value will improve the image clarity.

   ```typescript
   interface Image {
     type: string;
     quality: number; // Adjusts the quality of the image in the PDF
   }
   ```

2. **Rasterized PDF Functionality**: Ensure that the rasterized PDF 
functionality is enabled, which uses high-quality image settings. The image 
type is set to 'jpeg' with the quality set to 1 (highest quality) in the 
options object passed to the `domToPdf` function.

   ```javascript
   const options = {
     margin: 10,
     filename: `${generateFileStem(description)}.pdf`,
     image: { type: 'jpeg', quality: 1 },
     html2canvas: { scale: 2 },
     excludeClassNames: ['header-controls'],
   };
   ```

3. **WebDriver Configuration**: Enhance the resolution and quality of 
screenshots by configuring WebDriver settings. Use parameters like 
`--force-device-scale-factor=2.0` and `--high-dpi-support=2.0` in 
`WEBDRIVER_OPTION_ARGS` to achieve higher DPI and scaling.

4. **Wait Times**: Adjust `SCREENSHOT_LOCATE_WAIT` and `SCREENSHOT_LOAD_WAIT` 
settings to ensure that the page is fully loaded before capturing the 
screenshot. This helps in capturing accurate and high-quality images for PDF 
exports.

By configuring these settings, you can improve the quality of PDF screenshots 
in Superset 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset-frontend/src/types/dom-to-pdf.d.ts)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/src/utils/downloadAsPdf.ts)</sup><sup>[[3]](https://github.com/apache/superset/blob/master/superset/commands/report/execute.py)</sup><sup>[[4]](https://github.com/apache/superset/blob/master/superset/config.py)</sup>.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*

---
<sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/8756be73-d6c7-4975-871e-daf1bf08164d?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/8756be73-d6c7-4975-871e-daf1bf08164d?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/8756be73-d6c7-4975-871e-daf1bf08164d?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/8756be73-d6c7-4975-871e-daf1bf08164d?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/8756be73-d6c7-4975-871e-daf1bf08164d?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/8756be73-d6c7-4975-871e-daf1bf08164d?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/8756be73-d6c7-4975-871e-daf1bf08164d?feedback_type=other)</sup>


GitHub link: 
https://github.com/apache/superset/discussions/32149#discussioncomment-13130870

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


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

Reply via email to