العمل مع OfficeMath
Contents
[
Hide
]
أصبح الآن العمل مع كائنات نوع OfficeMath أكثر ملاءمة. في Aspose.Words، يمكن للعميل بسهولة التبرير ويمكنه أيضًا إدارة ما إذا كانت المعادلة معروضة في السطر أو في سطر منفصل. وأكثر من ذلك، مع توفر MathObjectType؛ يمكن تنفيذ عناصر التحكم المفيدة باستخدام كائن المصفوفة هذا.
توضح أمثلة التعليمات البرمجية التالية كيفية الاستفادة من هذه الخصائص:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir_WorkingWithFields(); | |
Document doc = new Document(dataDir+ "MathEquations.docx"); | |
OfficeMath officeMath = (OfficeMath)doc.GetChild(NodeType.OfficeMath, 0, true); | |
// Gets/sets Office Math display format type which represents whether an equation is displayed inline with the text or displayed on its own line. | |
officeMath.DisplayType = OfficeMathDisplayType.Display; // or OfficeMathDisplayType.Inline | |
// Gets/sets Office Math justification. | |
officeMath.Justification = OfficeMathJustification.Left; // Left justification of Math Paragraph. | |
doc.Save(dataDir + "MathEquations_out.docx"); |