Bullet type

Last post 06-23-2009, 2:06 PM by mshakeel.faiz. 3 replies.
Sort Posts: Previous Next
  •  05-26-2009, 9:58 AM 181291

    Bullet type

    hi,

    I am trying to get bullet type from the paragraph by using the following method

    getBulletType();

    but it always returns the same value of 1 (for both number and dotted bullet)

    how can i get the bullet type kindly guide me

    Thanks&Regards

    Rajasekar


    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
     
  •  05-26-2009, 10:02 AM 181294 in reply to 181291

    Re: Bullet type

    Attachment: Present (inaccessible)

    Hello,

    I have tested this code on Aspose.Slides for JAVA 1.9.0 and it returns the correct bullet type. Source presentation is also attached.

    OUTPUT:

    2

    1

    CODE:

    try {

    // Source presentation

    Presentation srcPres = new Presentation(new FileInputStream(

    "C:\\source\\source.ppt"));

    // Source slide with a single shape which is a linked pictureframe

    Slide srcSld = srcPres.getSlideByPosition(1);

    //Access first textframe and prints the bullet type

    Shape shp = srcSld.getShapes().get(0);

    TextFrame tf = shp.getTextFrame();

    Paragraph para = tf.getParagraphs().get(0);

    // print bullet type

    System.out.println(para.getBulletType());

    //Access second textframe and prints the bullet type

    shp = srcSld.getShapes().get(1);

    tf = shp.getTextFrame();

    para = tf.getParagraphs().get(1);

    // print bullet type

    System.out.println(para.getBulletType());

    } catch (Exception ex) {

    ex.printStackTrace();

    }


    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
     
  •  05-28-2009, 1:36 AM 181578 in reply to 181294

    Re: Bullet type

    Attachment: Present (inaccessible)

    hello,

    I attached the source file "numberBullet.ppt" &"dotBullet.ppt"with this mail 

    ur above code returns  the bullet type as

    1  for both files

    Thanks&Regards

    Rajasekar

     
  •  06-23-2009, 2:06 PM 185153 in reply to 181578

    Re: Bullet type

    Hello,

     

    Actually, the shapes in your provided ppts namely dotBullet.ppt and numberBullet.ppt are textholders not textframes.

     

    So this is the correct way to get the paragraph bullet type.

     

    First, I check, if shape is possibly a textholder, then I access paragraphs collection from it otherwise, I access paragraphs from textframe.

    -------------------------------------------------------------------

     

    try

    {

    Presentation srcPres = new Presentation(new FileInputStream(

    "C:/Test/numberBullet.ppt"));

     

    // Source slide with a single shape which is a linked pictureframe

     

    Slide srcSld = srcPres.getSlideByPosition(1);

     

    // Access first textframe and prints the bullet type

     

    Shape shp = srcSld.getShapes().get(1);

     

    Paragraphs paras=null;

     

    //check, if shape is possibly a textholder,

    //then access paragraphs collection from it otherwise

    //access paragraphs from textframe.

    if(shp.getPlaceholder()!=null && shp.isTextHolder())

    {

          //First type cast the placeholder into textholder and

          //then get access to paragraphs

          TextHolder thld=(TextHolder)shp.getPlaceholder();

          paras=thld.getParagraphs();

    }//if

    else

    {

          TextFrame tf=shp.getTextFrame();

          paras=tf.getParagraphs();

    }//else

     

    Paragraph para=paras.get(0);

     

    // print bullet type

     

          System.out.println(para.getBulletType());

     

     

    } catch (Exception ex) {

     

          ex.printStackTrace();

     

    }//catch


    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