java.lang.Object
com.aspose.words.WatermarkLayout
public class WatermarkLayout
- extends java.lang.Object
Utility class containing constants.
Defines layout of the watermark relative to the watermark center.
Example:
Shows how to create and remove watermarks in the document.
Document doc = new Document();
doc.getWatermark().setText("Aspose Watermark");
TextWatermarkOptions textWatermarkOptions = new TextWatermarkOptions();
textWatermarkOptions.setFontFamily("Arial");
textWatermarkOptions.setFontSize(36f);
textWatermarkOptions.setColor(Color.BLACK);
textWatermarkOptions.setLayout(WatermarkLayout.HORIZONTAL);
textWatermarkOptions.isSemitrasparent(false);
doc.getWatermark().setText("Aspose Watermark", textWatermarkOptions);
ImageWatermarkOptions imageWatermarkOptions = new ImageWatermarkOptions();
imageWatermarkOptions.setScale(5.0);
imageWatermarkOptions.isWashout(false);
doc.getWatermark().setImage(ImageIO.read(new File(getImageDir() + "Logo.jpg")), imageWatermarkOptions);
if (doc.getWatermark().getType() == WatermarkType.TEXT)
doc.getWatermark().remove();
Field Summary |
static final int | HORIZONTAL = 0 | |
Horizontal watermark layout. Corresponds to 0 degrees of rotation.
|
static final int | DIAGONAL = 315 | |
Diagonal watermark layout. Corresponds to 315 degrees of rotation.
|
HORIZONTAL = 0 | |
public static final int HORIZONTAL |
-
Horizontal watermark layout. Corresponds to 0 degrees of rotation.
DIAGONAL = 315 | |
public static final int DIAGONAL |
-
Diagonal watermark layout. Corresponds to 315 degrees of rotation.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.