Version 0.12.6 can convert an .mhtml file on Ubuntu but not on CentOS 7

86 views
Skip to first unread message

Steve Jorgensen

unread,
May 16, 2022, 10:52:23 PM5/16/22
to wkhtmltopdf General
I am able to convert a particular .mhtml file successfully on Ubuntu (PopOS! 21.10) using wkhtmltopdf installed from the standard repository. `wkhtmltopdf --version` says "wkhtmltopdf 0.12.6".

Trying to convert the same file on CentOS 7 using wkhtmltopdf installed from the RPM file downloaded using the v0.12.6 CentOS 7 x86_64 link on the https://wkhtmltopdf.org/downloads.html, I get
```
Loading pages (1/6)
Error: Failed loading page file:///vmshare/Dance+Hall.mhtml (sometimes it will work just to ignore this error with --load-error-handling ignore)
Exit with code 1, due to unknown error.
```

`wkhtmltopdf --version` says "wkhtmltopdf 0.12.6  (with patched qt)".

When I try again with the `--load-error-handling ignore` option, I get a warning instead of an error, but I get an empty .pdf.

Any idea what might be causing this and how to fix it?

Steve Jorgensen

unread,
May 16, 2022, 11:05:56 PM5/16/22
to wkhtmltopdf General
More info…

I had that same failure in both cases when the file extension was .doc instead of .mhtml. Maybe wkhtmltopdf uses something in the host system to determine the input file type by its extension that is different on the different systems? I looked in the /etc/mime.types files on both systems though, and "mhtml" is not a file extension there on either system.

Steve Jorgensen

unread,
May 17, 2022, 4:32:36 AM5/17/22
to wkhtmltopdf General
I tried that again using wkhtmltopdf installed from the distro package for CentOS 7 and that does work. Unfortunately, that also is built without the patched Qt, so it can't run without an X server which is why I had installed the one downloaded from wkhtmltopdf.org instead.

So I'm still stuck. I can either use the build that can't convert an .mhtml file or the one that won't run on the server where I need it to run because it's a minimal server install with no GUI.

Reply all
Reply to author
Forward
0 new messages