Package org.apache.poi.xslf.usermodel

Examples of org.apache.poi.xslf.usermodel.XSLFSlide


    @SuppressWarnings("deprecation")
    public void test51187() throws Exception {
       XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("51187.pptx");
      
       assertEquals(1, ss.getSlides().length);
       XSLFSlide slide = ss.getSlides()[0];
      
       // Check the relations on it
       // Note - rId3 is a self reference
       PackagePart slidePart = ss._getXSLFSlideShow().getSlidePart(
             ss._getXSLFSlideShow().getSlideReferences().getSldIdArray(0)
View Full Code Here


    public void testTIKA705() {
       XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("with_japanese.pptx");
      
       // Should have one slide
       assertEquals(1, ss.getSlides().length);
       XSLFSlide slide = ss.getSlides()[0];
      
       // Check the relations from this
       List<POIXMLDocumentPart> rels = slide.getRelations();
      
       // Should have 6 relations:
       //   1 external hyperlink (skipped from list)
       //   4 internal hyperlinks
       //   1 slide layout
View Full Code Here

    @SuppressWarnings("deprecation")
    public void bug51187() throws Exception {
       XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("51187.pptx");
      
       assertEquals(1, ss.getSlides().length);
       XSLFSlide slide = ss.getSlides()[0];
      
       // Check the relations on it
       // Note - rId3 is a self reference
       PackagePart slidePart = ss._getXSLFSlideShow().getSlidePart(
             ss._getXSLFSlideShow().getSlideReferences().getSldIdArray(0)
View Full Code Here

    public void tika705() {
       XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("with_japanese.pptx");
      
       // Should have one slide
       assertEquals(1, ss.getSlides().length);
       XSLFSlide slide = ss.getSlides()[0];
      
       // Check the relations from this
       List<POIXMLDocumentPart> rels = slide.getRelations();
      
       // Should have 6 relations:
       //   1 external hyperlink (skipped from list)
       //   4 internal hyperlinks
       //   1 slide layout
View Full Code Here

     */
    @Test
    @Ignore
    public void bug54916() throws Exception {
        XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("OverlappingRelations.pptx");
        XSLFSlide slide;
       
        // Should find 4 slides
        assertEquals(4, ss.getSlides().length);
       
        // Check the text, to see we got them in order
View Full Code Here

    public void bug54542() throws Exception {
        XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("54542_cropped_bitmap.pptx");
       
        Dimension pgsize = ss.getPageSize();
       
        XSLFSlide slide = ss.getSlides()[0];
       
        // render it
        double zoom = 1;
        AffineTransform at = new AffineTransform();
        at.setToScale(zoom, zoom);
       
        BufferedImage imgActual = new BufferedImage((int)Math.ceil(pgsize.width*zoom), (int)Math.ceil(pgsize.height*zoom), BufferedImage.TYPE_3BYTE_BGR);
        Graphics2D graphics = imgActual.createGraphics();
        graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
        graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
        graphics.setTransform(at);               
        graphics.setPaint(Color.white);
        graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));
        slide.draw(graphics);            
       
        ImageIO.write(imgActual, "PNG", new File("bug54542.png"));
    }
View Full Code Here

    public void test51187() throws Exception {
       XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("51187.pptx");
      
       assertEquals(1, ss.getSlides().length);
       XSLFSlide slide = ss.getSlides()[0];
      
       // Check the relations on it
       // Note - rId3 is a self reference
       PackagePart slidePart = ss._getXSLFSlideShow().getSlidePart(
             ss._getXSLFSlideShow().getSlideReferences().getSldIdArray(0)
View Full Code Here

  public static void main(String[] args) throws Exception
  {
    XMLSlideShow ppt = new XMLSlideShow(new FileInputStream("data/presentation.pptx"));

      //append a new slide to the end
      XSLFSlide blankSlide = ppt.createSlide();
     
    //save changes in a file
    FileOutputStream out = new FileOutputStream("data/EditedPPT_Apache.pptx");
    ppt.write(out);
    out.close();
View Full Code Here

public class ApacheFormatting
{
  public static void main(String[] args) throws Exception
  {
    XMLSlideShow ppt = new XMLSlideShow();
      XSLFSlide slide = ppt.createSlide();

      XSLFTextBox shape = slide.createTextBox();
      XSLFTextParagraph p = shape.addNewTextParagraph();

      XSLFTextRun r1 = p.addNewTextRun();
      r1.setText("The");
      r1.setFontColor(Color.blue);
View Full Code Here

      XSLFSlideMaster defaultMaster = ppt.getSlideMasters()[0];

      // title slide
      XSLFSlideLayout titleLayout = defaultMaster.getLayout(SlideLayout.TITLE);
      // fill the placeholders
      XSLFSlide slide1 = ppt.createSlide(titleLayout);

      // title and content
      XSLFSlideLayout titleBodyLayout = defaultMaster.getLayout(SlideLayout.TITLE_AND_CONTENT);
      XSLFSlide slide2 = ppt.createSlide(titleBodyLayout);

      FileOutputStream out = new FileOutputStream("data/Apache_Layouts.pptx");
    ppt.write(out);
    out.close();
   
View Full Code Here

TOP

Related Classes of org.apache.poi.xslf.usermodel.XSLFSlide

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.