Wiki source code of PDF Generator Configuration
Last modified by Eleni Cojocariu-testing account on 2026/08/21 17:04
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | When [[configuring PDF export>>documentation.xs.admin.exports.configure-pdf-export.WebHome]], the "Generator" setting chooses the tool that produces the PDF: | ||
| 2 | |||
| 3 | {{image reference="generator-dropdown.png" size="medium" alt="The Generator setting of the PDF Export administration section, expanded on its three choices"/}} | ||
| 4 | |||
| 5 | |=The tool used as a PDF Generator|=Description|=Image | ||
| 6 | |"User Browser"|The default setting. The PDF is generated client-side, by the print function of the user's own web browser, so it requires no external service such as Docker or a remote headless Chrome. The drawback is that the final PDF varies with the browser each user runs, and with its version.|{{image reference="user-browser-generator.png" size="large" alt="The User Browser generator selected, with no further setting to fill in"/}} | ||
| 7 | |"[[Chrome Docker Container>>extensions:Extension.PDF Export Application.WebHome||anchor="HChromeDockerContainer"]]"|The PDF is generated server-side, by a headless Chrome web browser running inside a Docker container on the same server as XWiki. The application handles the container itself:((( | ||
| 8 | * pulling the Docker image if it is not found locally, | ||
| 9 | * creating and starting the container if no existing container is available, | ||
| 10 | * stopping the container when XWiki shuts down, if XWiki is the one that created it. | ||
| 11 | )))|{{image reference="chrome-docker-container-generator.png" size="large" alt="The settings of the Chrome Docker Container generator"/}} | ||
| 12 | |"[[Remote Chrome>>extensions:Extension.PDF Export Application.WebHome||anchor="HRemoteChrome"]]"|The PDF is generated server-side, by a Chrome web browser running on another host. Use it to keep the export server-side without relying on Docker, or without granting XWiki access to Docker.|{{image reference="remote-chrome-generator.png" size="large" alt="The settings of the Remote Chrome generator"/}} | ||
| 13 | |||
| 14 | Selecting one of the two server-side generators reveals its own settings: | ||
| 15 | |||
| 16 | |=Setting|=Generator|=Default|=Description | ||
| 17 | |"Chrome Docker Image"|"Chrome Docker Container"|a pinned ##femtopixel/google-chrome-headless## tag|The Docker image used to create the container running the headless Chrome. The default names an exact Chrome version rather than ##latest##, because a Chrome upgrade changes the layout of the PDFs it produces. | ||
| 18 | |"Chrome Docker Container Name"|"Chrome Docker Container"|##headless-chrome-pdf-printer##|The name of the container running the headless Chrome. Set it to the name of a container you manage yourself to have XWiki reuse it instead of creating one. | ||
| 19 | |"Docker Network"|"Chrome Docker Container"|##bridge##|The name or id of the Docker network the Chrome container is added to. Set it when XWiki itself runs inside a Docker container, so that the two containers can reach each other. | ||
| 20 | |"Chrome Host"|"Remote Chrome"|empty, and required|The host running the headless Chrome, specified either by its name or by its IP address. | ||
| 21 | |"Chrome Remote Debugging Port"|both|##9222##|The port number used for communicating with the headless Chrome. | ||
| 22 | |"XWiki URI"|both|##host.xwiki.internal##|The base URI the headless Chrome uses to reach this instance, in particular the print preview Page. The host is required; the scheme (##HTTP## or ##HTTPS##) and the port are optional and fall back to the ones of the URL that triggered the export. This setting replaces the deprecated XWiki Host configuration (##export.pdf.xwikiHost##). |