Class GradientHelper

java.lang.Object
com.openhtmltopdf.pdfboxout.GradientHelper

public class GradientHelper extends Object
  • 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 functiontype2
      encode - encoding COSArray
      Returns:
      the COSArray, which is an important parameter for setting linear gradient.