java.lang.Objectcom.aspose.words.ImageWatermarkOptions
public class ImageWatermarkOptions
Constructor Summary |
---|
ImageWatermarkOptions()
|
Property Getters/Setters Summary | ||
---|---|---|
boolean | isWashout() | |
void | isWashout(boolean value) | |
Gets or sets a boolean value which is responsible for washout effect of the watermark. The default value is True. | ||
double | getScale() | |
void | setScale(double value) | |
Gets or sets the scale factor expressed as a fraction of the image. The default value is 0 - auto. |
Constructor Detail |
---|
public ImageWatermarkOptions()
Property Getters/Setters Detail |
---|
isWashout/isWashout | |
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");
getScale/setScale | |
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");