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

Free Support Forum - aspose.com

Problems with inserting SectionBreakContinuous

Attached please find a small sample app where you can see the problems when inserting section breaks.

I basically create a table with some text.
After the table I want to insert a break with type SectionBreakContinuous.
After the break I insert another document.
The section break is needed because if the inserted documents contains text with multiple columns the columns are lost
If you run the sample I cannot see the section break in word but a page break is inserted. I have no idea why.
Using Aspose.Word version 16.11.0.0

Thomas

Hi Thomas,

Thanks for your inquiry. While testing the scenario with Anfangstext_normal.docx, we have replicated your reported issue and logged a ticket WORDSNET-15249 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

Furthermore, Endetext_2Columns.docx is producing correct results, i.e. Continuous Section break after table. Please find attached document for your reference. However, if you notice any issue in the document then please share some screen shot to elaborate the issue. It will help us to understand it.

We are sorry for the inconvenience.

Best Regards,

Thanks for your answer.
I don’t agree that the Word document you added is correct.
After the table there should be a continuous section break, then a page break and then the text.
But there is a page break where the continuous section break should be.

Thomas

Hi Thomas,


Thanks for your feedback. Please find attached screen shots for your reference, original document and resultant document. We will appreciate it if you please share your output document along with sample expected document, it will help us to address your issue.

We are sorry for the inconvenience.

Best Regards,

Ok agree with you.
If you remove the pagebreak at the beginning of the document Endetext_2Columns.docx and run my sample app again you will still get a page break after the continuous section break but this is the same problem as with my ‘normal’ document.

Thomas

Hi Thomas,


Thanks for your feedback. Please note when paper size is different between two sections then continuous break is changed into page break. Please use following code snippet to accomplish the requirements.

int[] cw_px = new int[] { 54, 346, 60, 42, 74, 39, 77 };<o:p></o:p>

double[] cw_pt = null;

int intcnt = 0;

cw_pt = new double[cw_px.Length + 1];

for (intcnt = 0; intcnt <= cw_px.Length - 1; intcnt++)

{

cw_pt[intcnt] = cw_px[intcnt] * 72 / 96;

}

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

Table table = builder.StartTable();

for (int introw = 0; introw <= 1; introw++)

{

for (int intcol = 0; intcol <= cw_px.Length - 1; intcol++)

{

builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;

builder.InsertCell();

builder.CellFormat.Width = cw_pt[intcol];

if (introw == 0)

{

builder.Write(cw_pt[intcol].ToString());

}

else

{

builder.Write(cw_px[intcol].ToString());

}

}

table.AutoFit(AutoFitBehavior.FixedColumnWidths);

builder.EndRow();

}

builder.InsertCell();

builder.Write("Just some text");

builder.EndRow();

builder.EndTable();

string input = "Anfangstext_normal.docx";

Document doc1 = new Document(input);

doc1.FirstSection.PageSetup.SectionStart = SectionStart.Continuous;

doc.FirstSection.PageSetup.PaperSize = doc1.FirstSection.PageSetup.PaperSize;

builder.MoveToDocumentEnd();

builder.InsertBreak(BreakType.SectionBreakContinuous);

builder.InsertDocument(doc1, ImportFormatMode.UseDestinationStyles);

doc.Save("TestAsposeSectionbreak_174.docx");


Please feel free to contact us for any further assistance.

Best Regards,

thanks for your help, got it all sorted now.

Thomas

Hi Thomas,


Thanks for your feedback. It is good to know that you have managed to accomplish your requirements.

Please keep using our API and feel free to contact us for any further assistance.

Best Regards,