Package com.openhtmltopdf.pdfboxout
Class GradientHelper
java.lang.Object
com.openhtmltopdf.pdfboxout.GradientHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static org.apache.pdfbox.cos.COSArray
buildType2Functions
(List<FSLinearGradient.StopPoint> stopPoints, org.apache.pdfbox.cos.COSArray domain, org.apache.pdfbox.cos.COSArray encode) This method is used for setting colours to linear gradient.private static org.apache.pdfbox.pdmodel.common.function.PDFunctionType3
buildType3Function
(List<FSLinearGradient.StopPoint> stopPoints, float distance) This method is used for setting colour lengths to linear gradient.static org.apache.pdfbox.pdmodel.graphics.shading.PDShading
createLinearGradient
(PdfBoxFastOutputDevice od, AffineTransform transform, FSLinearGradient gradient, Shape bounds) This method is used for creating linear gradient with its components.
-
Constructor Details
-
GradientHelper
public GradientHelper()
-
-
Method Details
-
createLinearGradient
public static org.apache.pdfbox.pdmodel.graphics.shading.PDShading createLinearGradient(PdfBoxFastOutputDevice od, AffineTransform transform, FSLinearGradient gradient, Shape bounds) This method is used for creating linear gradient with its components.- Returns:
- shading for rendering linear gradient in PDF
-
buildType3Function
private static org.apache.pdfbox.pdmodel.common.function.PDFunctionType3 buildType3Function(List<FSLinearGradient.StopPoint> stopPoints, float distance) This method is used for setting colour lengths to linear gradient.- Parameters:
stopPoints
- colours and lengths of linear gradient.- Returns:
- the function, which is an important parameter for setting linear gradient.
-
buildType2Functions
private static org.apache.pdfbox.cos.COSArray buildType2Functions(List<FSLinearGradient.StopPoint> stopPoints, org.apache.pdfbox.cos.COSArray domain, org.apache.pdfbox.cos.COSArray encode) This method is used for setting colours to linear gradient.- Parameters:
stopPoints
- colours to use.domain
- parameter for setting functiontype2encode
- encoding COSArray- Returns:
- the COSArray, which is an important parameter for setting linear gradient.
-