We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Extra blank Page in the begining of the merged documents

I am merging documents by creating a new blank document first and then appending documents one after the other to the new document. However, I get an extra blank page at the begining of the document. How can I eliminate this extra blank page at the begining of the document?

Thanks,

Hi

Thanks for your inquiry. This occurs because blank document already contains one section. When you append your documents to the blank document the empty section appears at the beginning of document. To avoid this you can just remove first section from the newly created document. See the following code:

//Create new document

Document doc = new Document();

//Remove empty section

doc.FirstSection.Remove();

//Open another document and insert it into the newly created docuemnt

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

AppendDoc(doc, src);

//Save result

doc.Save(@"Test077\out.doc");


You can find AppendDoc method here:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/append-one-document-to-another.html


Hope this helps.

Best regards.

Thanks Alexey for your reply.

I did as you suggested and saw no changes. The inetersting fact is that if I have 3 docs merging, I get 2 blank pages at the beginning of the merged document, and if I have 5 documents merging then I will have 4 blank pages (always 1 les than total number of merged documents) at the begining of the merged document. If the problem was due to the initial creation of the blank document, then I should always get one blank document no matter how many is the number of merged documents. By the way, I checked and the merging documents have no extra blank pages themselves. Could it be a banner page inserted by Aspose automatically?

Hi

Thanks for your inquiry. Could you please provide me your code and attach sample documents (input and output) for testing? I will investigate the problem and try to help you.

Best regards.