Hello Milan,
I have tested the scenario & could not reproduce the problem. Please try following code snippet.
Pdf pdf = new Pdf();
//add a section
Section sec1 = pdf.getSections().add();
sec1.setIsSpaced(true);
// Enable the Landscape property
sec1.setIsLandscape(true);
//add text
Text text1 = new Text(sec1);
sec1.getParagraphs().add(text1);
Segment seg1 = new Segment(text1, "Sample text in sec1 over page 1 of pdf. \n");
text1.getSegments().add(seg1);
//Add second section.
Section sec2 = pdf.getSections().add();
sec2.setIsSpaced(true);
// Enable Landscape property for second Section
sec2.setIsLandscape(true);
//add text
Text text2 = new Text(sec2);
sec2.getParagraphs().add(text2);
Segment seg2 = new Segment(text2, "Sample text in Sc2 over page 2 of Pdf \n");
text2.getSegments().add(seg2);
pdf.save(
new FileOutputStream(new File("LandScapeSections.pdf")));
If still the problem persists plese share the code with us.
Nayyer Shahbaz
Support Developer, Aspose Sialkot Team
About Us Contact UsKeep in touch! We're on
Twitter and
Facebook