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

Wrong slide order in pptx

Last post 07-01-2009, 1:50 PM by mshakeel.faiz. 4 replies.
Sort Posts: Previous Next
  •  02-12-2009, 12:21 AM 164800

    Wrong slide order in pptx

    Attachment: Present (inaccessible)
    Wrong slide order in pptx in Aspose.Slides for .NET v 2.9.2.0
    Sample attached.
     
  •  02-14-2009, 6:32 AM 165239 in reply to 164800

    Re: Wrong slide order in pptx

    Hello,

    How can I replicate this error? Because the following code prints the correct line numbers from 1-11

    PresentationEx pres = new PresentationEx(@"C:\source\PPTX_Test.pptx");

    for(int i=0; i<pres.Slides.Count; i++)

    {

    SlideEx sld = pres.Slides[i];

    Console.WriteLine(sld.SlideNumber);

    }


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  02-18-2009, 1:04 AM 165736 in reply to 165239

    Re: Wrong slide order in pptx

    Actually SlideNumber property is equal to slide position in array of slides. So it is impossible to replicate the error this way.
    Slides are incorrectly ordered in the array. To check it, you should have a look at slides contents, but not numbers.
    For example, when you open this presentation in PowerPoint, you'll see 2 TextBoxes on the 4th slide. But when opened with Aspose.Slides similar slide has number 6 in slides array. And slide number 4 contains 4 TextShapes as slides 1 and 2 do when opened in PowerPoint.
    Better way to deal with such a problem is to write simple app that visually paints all shapes as rectangles. So that you could list slides and see what they look like.
     
  •  07-01-2009, 11:08 AM 186431 in reply to 165736

    Re: Wrong slide order in pptx

    I have also seen this problem. I opened a template pptx containing 12 slides, amended one of the slides and then saved changes. When I open the file in PowerPoint the slides are in a random order.

    Edit: I forgot to mention that I'm writing the amendments back to a new file, I don't change the actual template presentation.

     
  •  07-01-2009, 1:50 PM 186462 in reply to 186431

    Re: Wrong slide order in pptx

    Hello,

     

    To get slide by position, use this utility function instead of accessing them directly from collection.

     

    static SlideEx GetSlideByPosition(PresentationEx pres, int position)

    {

        if (position <= 0)

            throw new Exception("Position should start from 1");

     

        if (pres.Slides.Count < position)

            throw new Exception("Position must not be greater than number of slides");

     

        SlideEx retSld = null;

     

        foreach (SlideEx sld in pres.Slides)

        {

            if (sld.SlideNumber == position)

                retSld = sld;

        }

     

        return retSld;

    }


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML