PDF export - headless chrome - localhost - fails

PDF Export - Headless Chrome Localhost Doc

I think the preview mode for Chrome-headless mentioned here is now the default.

The bug mentioned in the comments has been fixed: Chromium

But I’m seeing the same failure now without specifying to use the new preview mode.

image

I think the issue may be this: Support Chrome 111+ by fluidsonic · Pull Request #85 · kklisura/chrome-devtools-java-client · GitHub

Chrome Version 133.0.6943.60 (Official Build) (64-bit)

The xwiki server is on Windows. I used the args for Chrome: --headless --remote-debugging-port=9222 --disable-gpu --remote-allow-origins=http://localhost:9222

@mflorea ?

If I’m right that the error is in kklisura code, there is a fork available. Nothing has been merged in 7 months in the project itself.

Hi, I take it that you can’t or don’t want to use the headless Chrome Docker image so you want to run the headless Chrome yourself. In this case I’d recommend replicating the setup / configuration used by the Docker image because that’s what we use in our automated tests and so that’s what we know to be working:

I haven’t tried with the latest version of Chrome, but be aware that Chrome updates can come with behavior changes regarding print / paged media which conflict with paged.js the library we’re using to polyfill the paged media specs that are not fully implemented by all browsers. Best is to try to use the version of Chrome we’re using in our automated PDF export tests.

Hope this helps,
Marius

1 Like

Haven’t gotten to this yet, but I hope to soon. Thanks so much!