public class PdfWatermarkingUtils extends Object
| Constructor and Description |
|---|
PdfWatermarkingUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
fillTextState(com.aspose.pdf.TextState textState,
TextWatermark watermark,
Content parent)
Initializes
Aspose.Pdf.Text.TextState object
using TextWatermark values. |
static com.aspose.pdf.Operator[] |
getBackgroundColorOperators(Color color,
com.aspose.pdf.Rectangle rectangle)
Gets a collection of operators representing text background.
|
static com.aspose.pdf.Matrix |
getTransformationMatrix(ImageWatermark watermark,
double width,
double height,
PdfPage page)
Calculates transformation matrix for an image watermark.
|
static com.aspose.pdf.Matrix |
getTransformationMatrix(TextWatermark watermark,
double width,
double height,
PdfPage page)
Calculates transformation matrix for a text watermark.
|
static void |
initializeWrapperForm(com.aspose.pdf.XForm form,
com.aspose.pdf.Matrix transformationMatrix,
String innerFormName)
Initializes a form with required operators to display inner form/image applying transformation.
|
static double |
measureWidth(TextWatermark watermark,
PdfPage page) |
static String[] |
splitText(String text)
Splits a text into separate lines.
|
public static void fillTextState(com.aspose.pdf.TextState textState,
TextWatermark watermark,
Content parent)
Initializes Aspose.Pdf.Text.TextState object
using TextWatermark values.
textState - Text state object.watermark - Text watermark.parent - public static com.aspose.pdf.Operator[] getBackgroundColorOperators(Color color, com.aspose.pdf.Rectangle rectangle)
Gets a collection of operators representing text background.
color - Background color.rectangle - Text rectangle.public static com.aspose.pdf.Matrix getTransformationMatrix(ImageWatermark watermark, double width, double height, PdfPage page)
Calculates transformation matrix for an image watermark.
watermark - Watermark instance.width - Current width of the watermark object that was calculated by Aspose.Pdf.height - Current height of the watermark object that was calculated by Aspose.Pdf.page - Page where the watermark should be placed.public static com.aspose.pdf.Matrix getTransformationMatrix(TextWatermark watermark, double width, double height, PdfPage page)
Calculates transformation matrix for a text watermark.
watermark - Watermark instance.width - Current width of the watermark object that was calculated by Aspose.Pdf.height - Current height of the watermark object that was calculated by Aspose.Pdf.page - Page where the watermark should be placed.public static void initializeWrapperForm(com.aspose.pdf.XForm form,
com.aspose.pdf.Matrix transformationMatrix,
String innerFormName)
Initializes a form with required operators to display inner form/image applying transformation.
form - From to initialize.transformationMatrix - Transformation matrix.innerFormName - The name of inner XObject.public static double measureWidth(TextWatermark watermark, PdfPage page)
Copyright © 2026. All rights reserved.