العمل مع الحاشية السفلية والحاشية الختامية
Aspose.Words يوفر أيضا بعض الفئات والأساليب والخصائص للعمل مع الحواشي السفلية والتعليقات الختامية.
إدراج تعليق ختامي وتعيين خيارات الترقيم
إذا كنت تريد إدراج حاشية سفلية أو حاشية ختامية في مستند ورد، فيرجى استخدام طريقة InsertFootnote. تدرج هذه الطريقة حاشية سفلية أو حاشية ختامية في المستند.
EndnoteOptions و FootnoteOptions تمثل الفئات خيارات الترقيم للحاشية السفلية والحاشية الختامية.
يوضح مثال الكود التالي كيفية إدراج تعليق ختامي في المستند وتعيين خيارات الترقيم الخاصة به:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"TestFile.docx"); | |
System::SharedPtr<DocumentBuilder> builder = System::MakeObject<DocumentBuilder>(doc); | |
builder->Write(u"Some text"); | |
builder->InsertFootnote(FootnoteType::Endnote, u"Eootnote text."); | |
System::SharedPtr<EndnoteOptions> option = doc->get_EndnoteOptions(); | |
option->set_RestartRule(FootnoteNumberingRule::RestartPage); | |
option->set_Position(EndnotePosition::EndOfSection); | |
System::String outputPath = outputDataDir + u"WorkingWithFootnote.SetEndnoteOptions.docx"; | |
// Save the document to disk. | |
doc->Save(outputPath); |
تعيين عدد أعمدة تخطيط الحاشية السفلية
يمكنك تعيين عدد أعمدة تخطيط الحاشية السفلية باستخدام خاصية Columns. إذا كانت قيمة هذه الخاصية 0، يتم تنسيق منطقة الحواشي السفلية بعدد من الأعمدة بناء على عدد الأعمدة في الصفحة المعروضة.
يوضح مثال التعليمات البرمجية التالية كيفية تعيين عدد الأعمدة لتخطيط الحاشية السفلية:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"TestFile.docx"); | |
//Specify the number of columns with which the footnotes area is formatted. | |
doc->get_FootnoteOptions()->set_Columns(3); | |
System::String outputPath = outputDataDir + u"WorkingWithFootnote.SetFootNoteColumns.docx"; | |
// Save the document to disk. | |
doc->Save(outputPath); |
تعيين موضع الحاشية السفلية و EndNote
يمكن أن يكون موضع الحاشية السفلية في أسفل كل صفحة أو أسفل النص في كل صفحة. يمكن أن يكون موضع التعليق الختامي في نهاية القسم أو في نهاية المستند.
يوضح مثال الكود التالي كيفية تعيين موضع الحاشية السفلية والحاشية الختامية:
For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-C | |
System::SharedPtr<Document> doc = System::MakeObject<Document>(inputDataDir + u"TestFile.docx"); | |
//Set footnote and endnode position. | |
doc->get_FootnoteOptions()->set_Position(FootnotePosition::BeneathText); | |
doc->get_EndnoteOptions()->set_Position(EndnotePosition::EndOfSection); | |
System::String outputPath = outputDataDir + u"WorkingWithFootnote.SetFootnoteAndEndNotePosition.docx"; | |
// Save the document to disk. | |
doc->Save(outputPath); |