Wkhtmltopdf: help with Ubuntu 16.04

Created on 9 Oct 2019  路  3Comments  路  Source: wkhtmltopdf/wkhtmltopdf

Hi

I'd be very grateful for any help with this. I'm trying to get this running on WSL Ubuntu 16.04 x86_64.
This is all completely new to me. I understand about the XDG_RUNTIME_DIR problem (tho don't know how to fix it) but the rest I haven't a clue about. Why is it failing to get screen resources when there's no screen involved? Do I need the relevant version of Qt running or something.

Thanks for any help. Apologies if there's other info I should have provided and haven't

Here's the output:

mike@Zoostorm:/mnt/c/Users/Mike/OneDrive/Documents/Scans$ wkhtmltopdf Scans\ 6-25-081019-23_08.html Scans\ 6-25-081019-23_08.pdf
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-mike'
failed to get the current screen resources
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
Loading page (1/2)
QXcbConnection: XCB error: 170 (Unknown), sequence: 170, resource id: 90, major code: 146 (Unknown), minor code: 20
Printing pages (2/2)
QPainter::begin(): Returned false
Done
mike@Zoostorm:/mnt/c/Users/Mike/OneDrive/Documents/Scans$

InstallationIssue

Most helpful comment

try add this to you bashrc
export QT_QPA_PLATFORM='offscreen'

All 3 comments

try add this to you bashrc
export QT_QPA_PLATFORM='offscreen'

@jesoonluo, thanks, it worked for me (Ubuntu 18.04)

Looks like you're using the distro-provided package instead of the one from the downloads page -- it's going to require xvfb running.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

prasadsurase picture prasadsurase  路  4Comments

alankarglobant picture alankarglobant  路  4Comments

lanlan-yang picture lanlan-yang  路  4Comments

dhughesbc picture dhughesbc  路  4Comments

Dingo64 picture Dingo64  路  3Comments