Sign In  Sign Up Live-Chat

how to genrate aspose slide

Last post 06-20-2008, 2:11 PM by msfaiz. 17 replies.
Page 1 of 2 (18 items)   1 2 Next >
Sort Posts: Previous Next
  •  05-07-2008, 6:10 AM 125786

    how to genrate aspose slide

    hey some one tell me how to use aspose slides for my java application

     

     

     

     


    This message was posted using Aspose.Live 2 Forum
     
  •  05-07-2008, 6:53 AM 125792 in reply to 125786

    Re: how to genrate aspose slide

    Dear setuaagrawal,

    Thanks for considering Aspose.Slides for JAVA.

    You must know how to write programs in JAVA.

    Aspose.Slides for JAVA is available as a JAR file, which you add in your classpath and then import its package.

    i.e

    imports com.aspose.slides.*;

    Then you write your program, which uses Aspose.Slides' APIs, classes or methods.

    For code examples, you should see documentation, which is installed on your computer by installer or you can see it online.

    http://www.aspose.com/documentation/file-format-components/aspose.slides-for-.net-and-java/index.html

    Here is the link to Programmer's Guide for Aspose.Slides, there you will find code examples that make use of various Aspose.Slides features in JAVA as well as in other languages.

    http://www.aspose.com/documentation/file-format-components/aspose.slides-for-.net-and-java/programmers-guide.html


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  05-09-2008, 9:16 AM 126246 in reply to 125792

    Re: how to genrate aspose slide

    thanks faij
     
  •  05-09-2008, 9:24 AM 126249 in reply to 125792

    Re: how to genrate aspose slide

    Hi Faij thanks for responding .

    but i am having some problem in Body slide

    like i want create one body slide

    it starts with one header

    and in the body portion wants to put some bullet points

    and one thing whenever i am tring to put header and footer for any slidefooter i am able to put but for header its not giving any thing , its compiling the code but its not giving any thing in header portion.

     
  •  05-11-2008, 8:35 PM 126424 in reply to 126249

    Re: how to genrate aspose slide

    Header actually shows when you view your ppt file in notes view. If you want to put some code in title, then you can access the title placeholder with the following code.

     

    TextHolder thld=(TextHolder)sld.getPlaceholders().get(0);

    tld.getParagraphs().get(0).getPortions().get(0).setText(“Your title text.”);

     

    Note, for the above code to work, your slide should be body or header or title slide, which you can with the following methods

    Presentation.addTitleSlide()

    Presentation.addBodySlide() etc

     

    But if you have added the empty slide

    Presentation.addEmptySlide()

     

    Then, you need to add a textframe, and then set its formatting and text. For code example, you should see this post, which adds a title using TextFrame, the code is in C#, but you can easily convert it into JAVA, just use set and get words before the properties.

    http://www.aspose.com/community/forums/thread/122846/adding-title-with-textframe.aspx

     


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  05-13-2008, 6:54 AM 126657 in reply to 126424

    Re: how to genrate aspose slide

    thanks faiz its working fine

    can u plz tell me how to put images like company logo top left corner?

     

     

     
  •  05-13-2008, 6:57 AM 126659 in reply to 126424

    Re: how to genrate aspose slide

    and can u plz tell me how to put some bullet points on a body part of body slide

     

    thanks

    Faiz

     
  •  05-13-2008, 11:34 AM 126732 in reply to 126659

    Re: how to genrate aspose slide

    Attachment: Present (inaccessible)

    Dear setuaagrawal,

    For your ease of understanding, I have written a JAVA code, which adds a logo and textframe with bullets.

    It is easy to understand, as I have commented everyline and you should not have difficulty understanding it.

    I have also attached the code and the presentation generated by this code namely outAddingLogoAndBulletedText.ppt so that you can view it.

    Hopefully, it will be helpful for you.

    JAVA CODE:

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

    static void AddingLogoAndBulletedText() throws Exception

    {

    //Create a presentation from scratch

    Presentation pres = new Presentation();

    //Get the empty slide added by default

    Slide sld = pres.getSlideByPosition(1);

    //Add a company logo

    //First add a logo picture inside presentation

    FileInputStream logoStream=new FileInputStream("c:/logo.bmp");

    com.aspose.slides.Picture pic = new com.aspose.slides.Picture(pres, logoStream);

    int logoPicId = pres.getPictures().add(pic);

    //Now add a picture to top left corner

    //You need to pass it proper X, Y, Width and Height

    int logoX = 100;

    int logoY = 100;

    int logoWidth = 2000;

    int logoHeight = 500;

    //To add picture, you need to add PictureFrame

    //Pass it picture id, x, y, width and height

    PictureFrame pf = sld.getShapes().addPictureFrame(logoPicId, logoX, logoY, logoWidth, logoHeight);

    //We have finished adding picture, now add a TextFrame, with bullet paragraphs.

    com.aspose.slides.Rectangle rect = sld.getShapes().addRectangle(200, 1200, 3000, 1);

    //hide rectangle's lines

    rect.getLineFormat().setShowLines(false);

    //Add TextFrame inside

    TextFrame tf = rect.addTextFrame("");

    //Make the TextFrame wrap text if it exceeds its width

    tf.setWrapText(true);

    //Make the TextFrame expand rectangle shape, if text exceeds width

    tf.setFitShapeToText(true);

    //Add text inside TextFrame.

    //Note, first paragraph and its portion is added by default

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

    //Set first paragraph text

    para.getPortions().get(0).setText("This is the first portion of the first bulleted paragraph.");

    //Make the paragraph bulleted

    para.setHasBullet((short)1);

    para.setBulletType(BulletType.SYMBOL);

    para.setBulletCharacter((char)8226);

    //Make some space

    para.setBulletOffset((short)0);

    para.setTextOffset((short)150);

    //To add more paragraphs, make copy of the above paragraph and then add

    Paragraph newPara = new Paragraph(para);

    newPara.getPortions().get(0).setText("This is the first portion of the second bulleted paragraph");

    tf.getParagraphs().add(newPara);

    //Write presentation on disk

    FileOutputStream fout=new FileOutputStream("c:/outAddingLogoAndBulletedText.ppt");

    pres.write(fout);

    }


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  05-14-2008, 1:41 AM 126827 in reply to 126732

    Re: how to genrate aspose slide

    hey faiz thanks its working man
     
  •  05-16-2008, 12:06 AM 127362 in reply to 126827

    Re: how to genrate aspose slide

    Hi faiz ,

    1)

    actully now i am trying to inceaes the width of slide by this line of code but i am not able increase it

    slide2.getBackground().setWidth(slide2.getBackground().getWidth()*2);

     

    2)

    another thing i am having problem in master slide also

    means i want to create one master slide other slide will use that slide as a background.

     

    so can u plz help me.

    Thanks

     
  •  05-16-2008, 5:48 AM 127415 in reply to 127362

    Re: how to genrate aspose slide

    hi faiz

    i am also trying to change the table height but looking like like some problem it always giving same height of table.

     

    //Creating an table object and passing all parameter

    Table table = slide4.getShapes().addTable(0,900,4960,0,12,4,1,Color.lightGray);

    here in this code u can see height is 0 but it still giving one constant height

     
  •  05-17-2008, 2:20 PM 127540 in reply to 127362

    Re: how to genrate aspose slide

    For changing slide width / height, you should Presentation.setSlideSize property.

     

    Presentation pres=new Presentation();

    pres.setSlideSize(new Point(1000,4000));

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

     

    You cannot create master slides; you can only copy them from other presentations and then change the master of your slide with slide.changeMaster() method. For code example, please see this.

    http://www.aspose.com/Community/Forums/79025/ShowThread.aspx#79025


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  05-20-2008, 5:22 AM 127827 in reply to 127540

    Re: how to genrate aspose slide

    thanks faiz its working fine
     
  •  05-20-2008, 7:25 AM 127850 in reply to 127827

    Re: how to genrate aspose slide

    Hi Faiz,
    Can we do one thing,
    like can we use one of slide from our presentation as a master slide.
    i tried my hand but not getting the result i am pasting peace of code


         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);

             }
            


    plz just check  can we do by this way.

    another thing i am trying to reduce the height of table but its now getting reduce means it getting reduce to some extent but not after that even i have given height is 0 then also its giving a default height

                  //Setting table parameters
            int xPosition=1000;
            int yPosition=slide2.getBackground().getHeight()*1/6;
            int tableWidth=slide2.getBackground().getWidth()-1000;
            int tableHeight=0;//slide2.getBackground().getHeight()/10;
            int columns=18;
            int rows=3;
            float borderWidth=1;
           
       //Creating an table object and passing all parameter           
            Table table = slide2.getShapes().addTable(xPosition,slide2.getBackground().getHeight()*1/2,tableWidth,tableHeight,columns,rows,borderWidth,Color.BLACK);
        

    above peace of code i am using for the table so can u plz tell me how to reduce the table height.




    Thanks And Regards


     
  •  05-22-2008, 11:47 PM 128357 in reply to 127850

    Re: how to genrate aspose slide

    hi Faiz please can u rply me back i am waiting for ur response.
     
Page 1 of 2 (18 items)   1 2 Next >
View as RSS news feed in XML