GetDirection
Returns the direction of the watermark in the document.
Syntax
expression.GetDirection();
expression - A variable that represents a ApiWatermarkSettings class.
Parameters
This method doesn't have any parameters.
Returns
Example
Retrieve the rotation direction of a watermark and display it in a document.
// How do I read the diagonal angle at which a watermark text is displayed in a document?
// Verify the orientation of a watermark by reading its direction setting in a document.
let doc = Api.GetDocument();
let watermarkSettings = doc.GetWatermarkSettings();
watermarkSettings.SetType("text");
watermarkSettings.SetText("Example");
let textPr = watermarkSettings.GetTextPr();
textPr.SetFontFamily("Calibri");
textPr.SetFontSize(-1);
textPr.SetDoubleStrikeout(true);
textPr.SetItalic(true);
textPr.SetBold(true);
textPr.SetUnderline(true);
textPr.SetColor(Api.RGB(0, 255, 0));
watermarkSettings.SetTextPr(textPr);
watermarkSettings.SetOpacity(127);
watermarkSettings.SetDirection("clockwise45");
doc.SetWatermarkSettings(watermarkSettings);
let watermarkSettings2 = doc.GetWatermarkSettings();
let paragraph = Api.CreateParagraph();
paragraph.AddText("Watermark Direction = " + watermarkSettings2.GetDirection());
doc.Push(paragraph);