Introduction

In pdfHTML 3.0.1 (as well as iText Core release 7.1.12) came support for the linearGradient attribute within SVG input as well as with CSS styling. In a related article we demonstrated how to use this functionality within the iText 7 Core layout engine, while here we shows how it works when using pdfHTML.

Below are two quick examples which demonstrate this functionality.



CSS Example:

Link to HTML input for this PDF: linearGradient.html

Link to resultant PDF: CSSOutput.pdf


This code yields the following resultant PDF (screenshot):



SVG Example:

Link to SVG input for this PDF: linearGradient.SVG

Link to resultant PDF: SVGOutput.pdf


This code yields the following resultant PDF (screenshot):