Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

Page orientation issue

Last post 11-12-2008, 9:17 PM by forever. 4 replies.
Sort Posts: Previous Next
  •  07-17-2008, 3:57 AM 135851

    Page orientation issue

    Hi support,

    If I have just two consecutive sections in a document, sec1 and sec2, and if I set the landscape property for both sections on "true", then the second page from the second section is portrait orientated.

    Is this expected for Aspose.Pdf for Java, or I'm doing something wrong ?

    Best regards,
    Milan

     
  •  07-17-2008, 1:38 PM 135975 in reply to 135851

    Re: Page orientation issue

    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 Us

    Keep in touch! We're on Twitter and Facebook
     
  •  07-18-2008, 2:23 AM 136027 in reply to 135975

    Re: Page orientation issue

    Hi,

    By the second page from the second section I wasn't refering to the second page in the document. Both sections contain more than one page. To be more clear, here is the code :

     Pdf pdf = new Pdf();
     Section sec1 = pdf.getSections().add();            
     sec1.setIsLandscape(true);
     String str = "This example ilustrates orientation problem.";
     for(int i=0; i < 200; ++i)
     {                
            Text text1 = new Text(sec1, str);
            sec1.getParagraphs().add(text1);
     }
                  
     Section sec2 = pdf.getSections().add();
     Text text2 = new Text(sec2, "text in section 2.");
     sec2.getParagraphs().add(text2);
     sec2.setIsLandscape(true);
     for(int i=0; i < 200; ++i)
     {                
           Text text1 = new Text(sec2, str);
           sec2.getParagraphs().add(text1);
    }
                
    FileOutputStream out = new FileOutputStream(new File("C:/Temp/OrientationIssue.pdf"));
    pdf.save(out);

    Best regards,
    Milan

     
  •  07-18-2008, 5:58 AM 136063 in reply to 136027

    Re: Page orientation issue

    Hello Milan,

    I have tested your code and have been able to re-produce the same issue. I have logged it as PDFJAVA-5556 in our defect management system. Soon we will let you update with the status. We apologies for inconvenience.


    Nayyer Shahbaz
    Support Developer, Aspose Sialkot Team
    About Us
    Contact Us

    Keep in touch! We're on Twitter and Facebook
     
  •  11-12-2008, 9:17 PM 152300 in reply to 135851

    Updated component version is available

    The issues you have found earlier (filed as 5556) have been fixed in this update.


    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
View as RSS news feed in XML