Package com.aspose.slides

Examples of com.aspose.slides.Presentation


public class AsposeAddSlides
{
  public static void main(String[] args) throws Exception
  {
    //Instantiate a PresentationEx object that represents a PPTX file
    Presentation pres = new Presentation("data/presentation.pptx");
   
      //Add the title slide
      ISlide slide = pres.getSlides().addEmptySlide(pres.getLayoutSlides().get_Item(0));
   
    //Save the presentation
    pres.save("data/SlidesAdded_Aspose.pptx", SaveFormat.Pptx);
   
    System.out.println("Slide Added and Saved.");
  }
View Full Code Here


public class AsposeAddLayoutSlides
{
  public static void main(String[] args) throws Exception
  {
    //Instantiate Presentation class that represents the presentation file
    Presentation pres = new Presentation();

    //Instantiate SlideCollection calss
    ISlideCollection slds = pres.getSlides();

    for (int i = 0; i < pres.getLayoutSlides().size(); i++)
    {
        //Add an empty slide to the Slides collection
        slds.addEmptySlide(pres.getLayoutSlides().get_Item(i));

    }
    //Do some work on the newly added slide

    //Save the PPTX file to the Disk
        pres.save("data/LayoutSlidesAdded_Aspose.pptx", SaveFormat.Pptx);

        //Printing the status
        System.out.println("Slides added successfully!");
  }
View Full Code Here

public class AsposeMoveSlides
{
  public static void main(String[] args)
  {
    //Instantiate a Presentation object that represents a PPT file
    Presentation pres = new Presentation("data/presentation.ppt");
       
    //Accessing a slide using its slide position
    ISlide slide = pres.getSlides().get_Item(0);
   
    //Change the position of the selected slide
    slide.setSlideNumber(2);

    //Writing the presentation as a PPT file
    pres.save("data/Aspose_ReOrdered_Slides.ppt", SaveFormat.Ppt);
    System.out.println("Slides ReOrdered Successfuly.");
  }
View Full Code Here

public class AsposeHyperlink
{
  public static void main(String[] args)
  {
    // Instantiate Presentation class that represents PPTX
    Presentation pres = new Presentation();

    // Access first slide
    ISlide slide = pres.getSlides().get_Item(0);

    // Add an AutoShape of Rectangle Type
    IShape pptxShape = slide.getShapes().addAutoShape(ShapeType.Rectangle,
        150, 150, 150, 50);

    // Cast the shape to AutoShape
    IAutoShape pptxAutoShape = (IAutoShape) pptxShape;

    // Access ITextFrame associated with the AutoShape
    pptxAutoShape.addTextFrame("");

    ITextFrame ITextFrame = pptxAutoShape.getTextFrame();

    // Add some text to the frame
    ITextFrame.getParagraphs().get_Item(0).getPortions().get_Item(0)
        .setText("Aspose.Slides");

    // Set Hyperlink for the portion text
    IHyperlinkManager HypMan = ITextFrame.getParagraphs().get_Item(0)
        .getPortions().get_Item(0).getPortionFormat()
        .getHyperlinkManager();
    HypMan.setExternalHyperlinkClick("http://www.aspose.com");

    // Save the PPTX to Disk
    pres.save("data/Aspose_Hyperlink.pptx", SaveFormat.Pptx);
  }
View Full Code Here

TOP

Related Classes of com.aspose.slides.Presentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.