LinuxCommandLibrary

prince

TLDR

Convert HTML to PDF

$ prince [input.html] -o [output.pdf]
copy
Apply CSS stylesheet
$ prince -s [style.css] [input.html] -o [output.pdf]
copy
Convert from URL
$ prince [https://example.com] -o [page.pdf]
copy
Multiple inputs
$ prince [page1.html] [page2.html] -o [combined.pdf]
copy

SYNOPSIS

prince [options] files... [-o output.pdf]

DESCRIPTION

Prince is a commercial HTML/CSS to PDF converter with excellent standards compliance. It produces high-quality PDFs suitable for print production.

PARAMETERS

-o, --output file

Output PDF file.
-s, --style file
Additional CSS file.
--javascript
Enable JavaScript.
--media type
CSS media type.
--page-size size
Page dimensions.
--page-margin margin
Page margins.
--encrypt
Encrypt PDF.

EXAMPLES

$ # Basic conversion
prince document.html -o document.pdf

# With custom styles
prince -s print.css report.html -o report.pdf

# From URL
prince https://example.com/page -o page.pdf

# Multiple files combined
prince cover.html content.html appendix.html -o book.pdf

# With JavaScript
prince --javascript dynamic.html -o output.pdf

# Custom page size
prince --page-size="A4" document.html -o a4.pdf
copy

CAVEATS

Commercial license required for production use. Free for non-commercial. Excellent CSS Paged Media support.

HISTORY

Prince was developed by YesLogic starting in 2003 as a high-quality HTML to PDF converter for publishing.

SEE ALSO

Copied to clipboard