Hi!
Have a scenario where building multiple tables, each table being on a new page (added a builder.pagebreak statement for this) and each table can have different orientation. just a sample code here:
public void TestDiffOrientationPerTable()
{
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.PageSetup.Orientation = Aspose.Words.Orientation.Landscape;
Table table1 = builder.StartTable();
builder.InsertCell();
builder.Write("Table 1 row 1 cell 1");
builder.InsertCell();
builder.Write("This is row 1 cell 2");
builder.EndRow();
builder.InsertCell();
builder.Writeln("This is row 2 cell 1");
builder.InsertCell();
builder.Writeln("This is row 2 cell 2");
builder.EndRow();
builder.EndTable();
builder.InsertBreak(BreakType.PageBreak);
builder.PageSetup.Orientation = Aspose.Words.Orientation.Portrait;
Table table2 = builder.StartTable();
builder.InsertCell();
builder.Write("Table 2 row 1 cell 1");
builder.InsertCell();
builder.Write("This is row 1 cell 2");
builder.EndRow();
builder.InsertCell();
builder.Writeln("This is row 2 cell 1");
builder.InsertCell();
builder.Writeln("This is row 2 cell 2");
builder.EndRow();
builder.EndTable();
doc.Save(tempPath + "DiffOrientation.docx");
}
The orientation property here is getting the last set property (being on a PageSetup instance level), portrait; and not different orientations as expected.
How would we achieve that?
Regards,
Remus