Thursday, February 22, 2024
 Popular · Latest · Hot · Upcoming
rated 0 times [  41] [ 0]  / answers: 1 / hits: 150012  / 2 Years ago, thu, june 9, 2022, 3:18:16

I have a HTML file that is using a style.css and has colors, ex.:

<font style="background-color: red; color: white;"> FOO </font>

How can I "export" this local file on my Ubuntu 12.04 to a PDF? (the look and color should stay the same). I tried ex.: Ctrl+P -> print to PDF, but it didn't preserve the colours. I tried htmldoc with the --color option.. but it's the same problem..

It would be great to do this via the command line.

More From » pdf


Open your html file in LibreOffice Writer and then, under File in the menu, choose export to PDF. That's it.

If you prefer the command line, take a look at Convert HTML Page To a PDF Using Open Source Tool - Linux / OS X / Windows.

The software can be installed using sudo apt-get install wkhtmltopdf.

[#30318] Friday, June 10, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 228
Total Questions: 102
Total Answers: 111

Location: Ivory Coast
Member since Sun, Mar 7, 2021
3 Years ago