GetItalic
Gets the italic property from the current text properties.
Inherited from ApiRichTextPr.GetItalic.
Syntax
expression.GetItalic();
expression - A variable that represents an ApiRichRun class.
Parameters
This method doesn't have any parameters.
Returns
boolean | null | undefined
Example
Check if text is italicized in a PDF.
// How do I determine whether text is slanted in a PDF?
// Retrieve the italic state of formatted text in a PDF.
let doc = Api.GetDocument();
let freeTextAnnot = Api.CreateFreeTextAnnot([160, 50, 360, 135]);
let page = doc.GetPage(0);
page.AddObject(freeTextAnnot);
freeTextAnnot.SetIntent("freeTextCallout");
freeTextAnnot.SetCallout([{x: 161, y: 51}, {x: 249, y: 125}, {x: 261, y: 125}]);
freeTextAnnot.SetRectDiff([100, 64, 0.5, 0.5]);
let richContent = freeTextAnnot.GetContent();
let para = richContent.GetElement(0);
let run = para.GetElement(0);
run.AddText("Some example text");
let textPr = run.GetTextPr();
console.log(`The italic property is: ${textPr.GetItalic()}`);