Aspose::Words::ImportFormatOptions::get_AppendDocumentWithNewPage method

ImportFormatOptions::get_AppendDocumentWithNewPage method

Gets or sets a boolean value indicating whether to change a first imported section type to the NewPage forcibly when call AppendDocument(). The default value is true.

bool Aspose::Words::ImportFormatOptions::get_AppendDocumentWithNewPage() const

Examples

Shows how to preserve original section type.

auto dstDoc = System::MakeObject<Aspose::Words::Document>();
auto srcDoc = System::MakeObject<Aspose::Words::Document>();

srcDoc->get_FirstSection()->get_PageSetup()->set_SectionStart(Aspose::Words::SectionStart::Continuous);

auto options = System::MakeObject<Aspose::Words::ImportFormatOptions>();
options->set_AppendDocumentWithNewPage(false);
dstDoc->AppendDocument(srcDoc, Aspose::Words::ImportFormatMode::KeepSourceFormatting, options);

ASSERT_EQ(Aspose::Words::SectionStart::Continuous, dstDoc->get_Sections()->idx_get(1)->get_PageSetup()->get_SectionStart());

See Also