public class ImageWatermarkOptions
Constructor Summary |
---|
Property Getters/Setters Summary | ||
---|---|---|
boolean | isWashout() | |
void | isWashout(booleanvalue) | |
Gets or sets a boolean value which is responsible for washout effect of the watermark. The default value is True. | ||
double | getScale() | |
void | setScale(doublevalue) | |
Gets or sets the scale factor expressed as a fraction of the image. The default value is 0 - auto. |
public boolean isWashout() / public void isWashout(boolean value)
Example:
Shows how to create a watermark from an image in the local file system.Document doc = new Document(); // Modify the image watermark's appearance with an ImageWatermarkOptions object, // then pass it while creating a watermark from an image file. ImageWatermarkOptions imageWatermarkOptions = new ImageWatermarkOptions(); imageWatermarkOptions.setScale(5.0); imageWatermarkOptions.isWashout(false); doc.getWatermark().setImage(ImageIO.read(new File(getImageDir() + "Logo.jpg")), imageWatermarkOptions); doc.save(getArtifactsDir() + "Document.ImageWatermark.docx");
public double getScale() / public void setScale(double value)
Valid values range from 0 to 65.5 inclusive.
Auto scale means that the watermark will be scaled to its max width and max height relative to the page margins.
Example:
Shows how to create a watermark from an image in the local file system.Document doc = new Document(); // Modify the image watermark's appearance with an ImageWatermarkOptions object, // then pass it while creating a watermark from an image file. ImageWatermarkOptions imageWatermarkOptions = new ImageWatermarkOptions(); imageWatermarkOptions.setScale(5.0); imageWatermarkOptions.isWashout(false); doc.getWatermark().setImage(ImageIO.read(new File(getImageDir() + "Logo.jpg")), imageWatermarkOptions); doc.save(getArtifactsDir() + "Document.ImageWatermark.docx");