Convert HTML/XML to PDF LINUX/Ubuntu Command Line
The easiest way to convert HTML/XML (wtih CSS Style, JavaScript) to PDF in LINUX/Ubuntu through Command Line by following this method will work 100%.


5 Steps to convert HTML/XML to PDF in Linux/Ubuntu Through Terminal Command Line
- Download Prince Apps for your Linux Distro. Here you will see many options. Choose deb/tar.gz/rpm etc for your device.
- After download completion, install from Ubuntu Software Center or manually.
- After installing complete, open Terminal by Ctrl + Alt + T.
- Convert Downloaded HTML page to PDF: Keep HTML file in Home directory. Assume, your file name is
index.html
, then run the following command.
prince index.html
It will converted a PDF file withindex.pdf
in your home directory. If you want to rename (assumehello.pdf
instead ofindex.pdf
) automatically from terminal, then run the following command.
prince index.html -o hello.pdf
- Convert Webpage to PDF: If you want to convert directly webpage (suppose
http://www.google.com
) then run the following command.
prince http://www.google.com -o google.pdf
- To get more option run
prince --help
from terminal. - To know more please visit official doc of Prince.