PDF Printing
To configure or troubleshoot, please select the link below.
Configuration
Environment Variables
The printer pod is configured by environment variables. Normally, no manual configuration is required. With administrator discretion, the following environment variables are available.
Name | Default | Description |
---|---|---|
PRINTER_DEBUG | false | Set true to enable debug logging. |
PRINT_REPORT_CONCURRENCY | 5 | Maximum concurrent print requests. |
PRINT_WIDGET_DPI | 300 | Widget image resolution. |
- Using a text editor of your choice, edit the config file based on the SevOne Data Insight
version as shown in the table in section
find config file to
set the following environment variable and then, save it.
Important: If the config file does not exist, please create one and add the following to it.
For SDI 6.8.x and below, enable debug logging
printer: env: PRINTER_DEBUG: "true"
For SDI 7.0.x and above, enable debug logging
printer = { env = { "PRINTER_DEBUG": "true" } }
- Apply the change made to the config file.
$ sevone-cli playbook up --tags apps
Debug Logging
When enabled, additional information is logged.
- Browser console messages.
- HTTP requests and responses like the Network tab in dev tools.
- Report structure info, such as sections and widgets being printed.
- Event communication between the printer and User Interface.
Report Concurrency
It is not advised to increase this setting. Though, it might make sense to decrease it in specific situations if the Page Crashed Error occurring on certain reports.
Increase report concurrency by scaling the printer pod, instead.
Scale Printer Pod
The printer pod can be scaled up to the same number of agent nodes in your cluster. Each pod replica can process an additional 5 concurrent requests.
- Using a text editor of your choice, edit the config file based on the SevOne Data Insight
version as shown in the table in section
find config file to
set the following environment variable and then, save it.
Important: If the config file does not exist, please create one and add the following to it.
For SDI 6.8.x and below, set desired number of printer replicas
printer: replicas: 3
For SDI 7.0.x and above, set desired number of printer replicas
printer = { replicas = 3 }
- Apply the change made to the config file.
$ sevone-cli playbook up --tags apps
Widget Resolution
Default resolution is high enough to produce smooth graphics for display and printing on high resolution devices.
If PDF file size becomes a problem, this setting can be used to decrease file size by reducing the resolution.
Troubleshooting
The printer pod is a service that processes all print requests, generating a PDF document, and storing it in minio. It works by running a headless Chromium browser to SevOne Data Insight User Interface. It generates a per-widget view and screen captures each widget to an image. These images are compiled into a formatted PDF document.
The print routine is CPU and memory intensive. Therefore, it was designed to be scalable. By default, it can process 5 concurrent print requests. Additional requests are queued up.
Timeout
The printer allows up to 15 minutes to print a report before timing out. If a report contains many widgets that take a significant amount of time to render, it should be split up into smaller reports.
If there is a problem during print, it is possible the report will timeout early at 30 seconds because it was unable to start the User Interface in the browser. This appears in the log as:
Timeout waiting for reportload
Page Crashed Error
The Chromium browser can sometimes report a Page Crashed Error in the printer logs. This indicates an out of memory condition that caused the browser to fail to render.
Verify the Kubernetes host has available memory for the pod. Check for any printer configuration in the config file that might increase resource utilization. For example, environment variable PRINT_REPORT_CONCURRENCY can impact memory utilization.
Scheduled Report Caching
SevOne Data Insight maintains a cache of the printed PDF files for scheduled reports. Depending on your usage of report scheduling, it is recommended to occasionally clean up the cache to free up disk space.
Execute the following command to delete files older than one week (604800 seconds).
$ sevone-cli exec graphql -- "npm run asset-sweeper -- \
--prefix=scheduledReports --age=604800"