Free Support Forum - aspose.com

Create 1 document from multiple documents

I am trying to create 1 document from multiple files. It works but, I would like to have one document without the pagebreaks at the end of each document. Is there a way to achieve this ?

This is the code i use at the moment.

Document result = new Document();

result.RemoveAllChildren();

PrognoseDataSource rapportHeader = new PrognoseDataSource(new PrognoseTemplate());

Document DocumentHeader = rapportHeader.Render(data);

result.AppendDocument(DocumentHeader, ImportFormatMode.KeepSourceFormatting);

PrognoseDetailDataSource rapportDetail = new PrognoseDetailDataSource(new PrognoseDetailTemplate());

Document DocumentDetail = rapportDetail.Render(_exploitatie);

result.AppendDocument(DocumentDetail, ImportFormatMode.UseDestinationStyles);

PrognoseTotaalDataSource rapportTotal = new PrognoseTotaalDataSource(new PrognoseTotaalTemplate());

Document DocumentTotaal = rapportTotaal.Render(data.Bedrijfstotaal);

result.AppendDocument(DocumentTotaal, ImportFormatMode.UseDestinationStyles);

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. You should just set SectionStart to Continuous for each next document.

Please see the following code:

Document dst = new Document(@"Test080\in1.doc");

Document src = new Document(@"Test080\in2.doc");

// Set SectionStart to Continuous

src.FirstSection.PageSetup.SectionStart = SectionStart.Continuous;

dst.AppendDocument(src, ImportFormatMode.KeepSourceFormatting);

dst.Save(@"Test080\out.doc");

Best regards,