Sign In  Sign Up Live-Chat

how to genrate aspose slide

Last post 06-20-2008, 2:11 PM by msfaiz. 17 replies.
Page 2 of 2 (18 items)   < Previous 1 2
Sort Posts: Previous Next
  •  05-23-2008, 3:11 AM 128379 in reply to 127850

    Re: how to genrate aspose slide

    Your first code does not seem to have any problem. I have checked it with little additions to make it running.

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

    Presentation pres = new Presentation(new FileInputStream("c:\\source.ppt"));

    Slide slide2=pres.getSlideByPosition(2);

    long mstrId = slide2.getMasterId();

    pres.getSlides().remove(slide2);

    System.out.println("master id -- "+mstrId);

    Slide mstrSld = pres.getSlideById(mstrId);

    int lastSlidePos=pres.getSlides().getLastSlidePosition();

    //slide.changeMaster(mstrSld, true);

    for (int i = 1; i <= lastSlidePos; i++)

    {

    System.out.println("mstrSld -- "+mstrSld);

    System.out.println("lasslidePos -- "+lastSlidePos);

    System.out.println("i -- "+i);

    Slide normSld = pres.getSlideByPosition(i);

    normSld.changeMaster(mstrSld, true);

    }

    pres.write(new FileOutputStream("c:\\output.ppt"));

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

    Table height cannot be set after a minimum height of it has reached, this is because of font size inside table cells. For example, if font size of text inside the cell is 45, then row height cannot be decreased further after some specific height, to decrease it further, you need to set the font size to lesser than 45 say 30, 20.

    You can try it in MS-PowerPoint.

    Also, there are two other important APIs for setting height and width, they are Tables.setColumnWidth and Tables.setRowHeight.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  06-20-2008, 6:27 AM 132272 in reply to 126732

    Re: how to genrate aspose slide

    hi,

    we are using visual studio asp.net with c#. can you tell me how to add rectangles with different colors having spaces between words like

    ColumnName            Data
    ColumnName2          Data,Data,Data

    like that i should have many rows with same spacing......
    can you plese help me...

    thanks
    rmarala
     
  •  06-20-2008, 2:11 PM 132344 in reply to 132272

    Re: how to genrate aspose slide

    Attachment: Present (inaccessible)

    Dear rmarala,

     

    Thanks for considering Aspose.Slides

     

    Please see the following example. I have also attached the output presentation generated by the code, please see it. The code is commented for your ease of understanding, if you still have question, please feel free to ask.

     

    C#

    //Create a presentation

    Presentation pres = new Presentation();

     

    //Get a slide

    Slide sld = pres.GetSlideByPosition(1);

     

    //Create 4 rectangles

    Aspose.Slides.Rectangle rect1 = sld.Shapes.AddRectangle(760, 1050, 1730, 430);

    Aspose.Slides.Rectangle rect2 = sld.Shapes.AddRectangle(760, 1830, 1730, 430);

    Aspose.Slides.Rectangle rect3 = sld.Shapes.AddRectangle(3170, 1050, 1730, 430);

    Aspose.Slides.Rectangle rect4 = sld.Shapes.AddRectangle(3170, 1830, 1730, 430);

     

    //Give them background colors

    rect1.FillFormat.Type = FillType.Solid;

    rect1.FillFormat.ForeColor = Color.Aquamarine;

    rect2.FillFormat.Type = FillType.Solid;

    rect2.FillFormat.ForeColor = Color.Aquamarine;

    rect3.FillFormat.Type = FillType.Solid;

    rect3.FillFormat.ForeColor = Color.Bisque;

    rect4.FillFormat.Type = FillType.Solid;

    rect4.FillFormat.ForeColor = Color.Bisque;

     

    //Assign center aligned bold text to first two rectangles

    //1st

    TextFrame tf = rect1.AddTextFrame(" ");

    Paragraph para = tf.Paragraphs[0];

    para.Alignment = TextAlignment.Center;

    Portion port = tf.Paragraphs[0].Portions[0];

    port.Text = "Column Name";

    port.FontBold = true;

     

    //2nd

    tf = rect2.AddTextFrame(" ");

    para = tf.Paragraphs[0];

    para.Alignment = TextAlignment.Center;

    port = tf.Paragraphs[0].Portions[0];

    port.Text = "Column Name 2";

    port.FontBold = true;

     

    //Assign center aligned text to other two rectangles

    //3rd

    tf = rect3.AddTextFrame(" ");

    para = tf.Paragraphs[0];

    para.Alignment = TextAlignment.Center;

    port = tf.Paragraphs[0].Portions[0];

    port.Text = "Data";

     

    //4th

    tf = rect4.AddTextFrame(" ");

    para = tf.Paragraphs[0];

    para.Alignment = TextAlignment.Center;

    port = tf.Paragraphs[0].Portions[0];

    port.Text = "Data, Data";

     

    pres.Write("c:\\outRectangles.ppt");

     


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
Page 2 of 2 (18 items)   < Previous 1 2
View as RSS news feed in XML