Below is the Java code :
DocumentBuilder w_Bldr = new DocumentBuilder();
The below code is in for loop.
Even if w_Bldr.getPageSetup().setOrientation(Orientation.LANDSCAPE); is specified outside loop the print is still the same for both the modes.
w_Bldr.getPageSetup().setOrientation(Orientation.LANDSCAPE);
// if landscape
w_Bldr.getPageSetup().setOrientation(Orientation.PORTRAIT);
// if portrait
w_Bldr.getParagraphFormat().setKeepWithNext(true);
w_Bldr.getParagraphFormat().setKeepTogether(true);
w_Bldr.getRowFormat().setAllowBreakAcrossPages(false);
w_Bldr.getRowFormat().setAllowAutoFit(false);
w_Bldr.writeln();
Jars used : Aspose.Words.jdk15.jar aspose-cells-2.5.1.jar
How can this be fixed so that the difference should be noticeable?
Tried setting the pageWidth.
w_Bldr.getPageSetup().setPageWidth(200);
But no difference.
Page orientation is defined per section in MS Word documents. So to change page orientation section break must be inserted. For example see the following code that produces document with two section, one with portrait page orientation and another with landscape orientation: