Add print CSS¶
This guide shows you how to add custom CSS to the generated PDF.
Create a stylesheet¶
Create print.css:
Convert with the stylesheet¶
Run:
The custom CSS is appended after the built-in print styles.
You should see:
Open the PDF and check that the heading uses the custom color.
Tip
Use print-focused CSS here. Browser-only interactive styles will not affect the generated PDF.
For layout problems, keep the generated HTML with Debug rendering.