Use Chromium for PDF exports

By default, self-hosted SeekTable uses a built-in wkhtmltopdf to turn your reports into PDF files. This engine is a great choice for standard HTML tables and simple charts, and it is efficient in terms of server RAM usage. Even if you need to export a PDF with hundreds of pages, wkhtmltopdf is capable to handle the task.

While Wkhtmltopdf is sufficient for exporting tabular reports to PDF, it is based on a legacy version of the WebKit engine. Consequently, it does not support many modern HTML5/CSS3 features, such as Flexbox, Grid layouts, or ES2015 syntax. This is not an issue for HTML tables, it is crucial for dashboards that can use custom HTML layouts or visuals based on third-party JavaScript libraries.

For cases like that, SeekTable supports an alternative PDF engine Gotenberg based on Chromium. Gotenberg is distributed as a standalone Docker image that can be deployed alongside SeekTable or on a different host. This architecture also allows you to upgrade Gotenberg independently (to get Chromium fixes / latest version).

Configure Gotenberg on the same host

To deploy the Gotenberg Docker container and use it for all SeekTable PDF exports, follow the steps below:

  1. Edit docker-compose.yml file (usually located at /opt/seektable)
  2. Add a new "gotenberg" service:
      gotenberg:
        image: gotenberg/gotenberg:8
  3. Edit docker-compose.pivotdataservice.env file
  4. Add this line:
    PivotDataService_PivotDataService__Export__GotenbergService__ServiceUrl=http://gotenberg:3000
  5. If you want to use Gotenberg (Chromium) only for dashboard PDF exports (keep using wkhtmltopdf for report PDF exports):
    PivotDataService_PivotDataService__Export__GotenbergService__UseOnlyForPdfApi=true
  6. Don't forget to re-create SeekTable docker containers (docker compose stop + docker compose up) to apply changes.

Configure external Gotenberg API

Gotenberg API may be hosted separately (and used by multiple apps). To use external Gotenberg API:

  1. Edit docker-compose.pivotdataservice.env file
  2. Add these lines:
    PivotDataService_PivotDataService__Export__GotenbergService__ServiceUrl=http://gotenberg_api_host:3000
    PivotDataService_PivotDataService__Export__GotenbergService__InlineUrlResources=true
    PivotDataService_PivotDataService__Export__GotenbergService__BasicAuthUsername=username
    PivotDataService_PivotDataService__Export__GotenbergService__BasicAuthPassword=password
    
  3. Don't forget to re-create SeekTable docker containers (docker compose stop + docker compose up) to apply changes.