public static function convert_with_custom_size($dataDir = null)
 {
     # Instantiate a Presentation object that represents a PPTX file
     $pres = new Presentation($dataDir . "Aspose.pptx");
     # Instantiate the TiffOptions class
     $opts = new TiffOptions();
     # Setting compression type
     $tiff_compression_types = new TiffCompressionTypes();
     $opts->setCompressionType($tiff_compression_types->Default);
     # Compression Types
     #Default - Specifies the default compression scheme (LZW).
     #None - Specifies no compression.
     #CCITT3
     #CCITT4
     #LZW
     #RLE
     # Depth – depends on the compression type and cannot be set manually.
     # Resolution unit – is always equal to “2” (dots per inch)
     #Setting image DPI
     $opts->setDpiX(200);
     $opts->setDpiY(100);
     # Set Image Size
     $opts->setImageSize(new Dimension(1728, 1078));
     # Save the presentation to TIFF with specified image size
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Aspose-Custom-Size.tiff", $save_format->Tiff, $opts);
     print "Document has been converted, please check the output file.";
 }
 public static function run($dataDir = null)
 {
     # Create an instance of Presentation class
     $pres = new Presentation();
     # Get the first slide
     $slide = $pres->getSlides()->get_Item(0);
     # Add an AutoShape of Rectangle type
     $shapeType = new ShapeType();
     $shp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 150, 50);
     # Add TextFrame to the Rectangle
     $shp->addTextFrame("Aspose TextBox");
     # Disable shape fill in case we want to get shadow of text
     $fillType = new FillType();
     $shp->getFillFormat()->setFillType($fillType->NoFill);
     # Add outer shadow and set all necessary parameters
     $shp->getEffectFormat()->enableOuterShadowEffect();
     $shadow = $shp->getEffectFormat()->getOuterShadowEffect();
     $shadow->setBlurRadius(4.0);
     $shadow->setDirection(45);
     $shadow->setDistance(3);
     $rectangleAlignment = new RectangleAlignment();
     $color = new Color();
     $shadow->setRectangleAlign($rectangleAlignment->TopLeft);
     $shadow->getShadowColor()->setColor($color->black);
     # Write the presentation as a PPTX file
     $save_format = new SaveFormat();
     $pres->save($dataDir . "OutShadow.pptx", $save_format->Pptx);
     print "Applied shadow effects on text, please check the output file." . PHP_EOL;
 }
 public static function add_arrow_line($dataDir = null)
 {
     # Create an instance of Presentation class
     $pres = new Presentation();
     # Get the first slide
     $sld = $pres->getSlides()->get_Item(0);
     # Add an autoshape of type line
     $shapeType = new ShapeType();
     $shp = $sld->getShapes()->addAutoShape($shapeType->Line, 50, 150, 300, 0);
     # Apply some formatting on the line
     $lineStyle = new LineStyle();
     $shp->getLineFormat()->setStyle($lineStyle->ThickBetweenThin);
     $shp->getLineFormat()->setWidth(10);
     $lineDashStyle = new LineDashStyle();
     $shp->getLineFormat()->setDashStyle($lineDashStyle->DashDot);
     $lineArrowheadLength = new LineArrowheadLength();
     $lineArrowheadStyle = new LineArrowheadStyle();
     $fillType = new FillType();
     $color = new Color();
     $presetColor = new PresetColor();
     $shp->getLineFormat()->setBeginArrowheadLength($lineArrowheadLength->Short);
     $shp->getLineFormat()->setBeginArrowheadStyle($lineArrowheadStyle->Oval);
     $shp->getLineFormat()->setEndArrowheadLength($lineArrowheadLength->Long);
     $shp->getLineFormat()->setEndArrowheadStyle($lineArrowheadStyle->Triangle);
     $shp->getLineFormat()->getFillFormat()->setFillType($fillType->Solid);
     $shp->getLineFormat()->getFillFormat()->getSolidFillColor()->setColor(new Color($presetColor->Maroon));
     # Write the presentation as a PPTX file
     $save_format = new SaveFormat();
     $pres->save($dataDir . "ArrowShape.pptx", $save_format->Pptx);
     print "Added arrow shape line to slide, please check the output file." . PHP_EOL;
 }
Beispiel #4
0
 public static function run($dataDir = null)
 {
     # Create an instance of Presentation class
     $pres = new Presentation();
     # Get the first slide
     $slide = $pres->getSlides()->get_Item(0);
     # Add an AutoShape of Rectangle type
     $shapeType = new ShapeType();
     $fillType = new FillType();
     $ashp = $slide->getShapes()->addAutoShape($shapeType->Rectangle, 150, 75, 400, 300);
     $ashp->getFillFormat()->setFillType($fillType->NoFill);
     # Add TextFrame to the Rectangle
     $ashp->addTextFrame("Aspose TextBox");
     $port = $ashp->getTextFrame()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0);
     $pf = $port->getPortionFormat();
     $pf->setFontHeight(50);
     # Enable InnerShadowEffect
     $ef = $pf->getEffectFormat();
     $ef->enableInnerShadowEffect();
     # Set all necessary parameters
     $ef->getInnerShadowEffect()->setBlurRadius(8.0);
     $ef->getInnerShadowEffect()->setDirection(90);
     $ef->getInnerShadowEffect()->setDistance(6.0);
     $ef->getInnerShadowEffect()->getShadowColor()->setB(189);
     # Set ColorType as Scheme
     $colorType = new ColorType();
     $ef->getInnerShadowEffect()->getShadowColor()->setColorType($colorType->Scheme);
     # Set Scheme Color
     $schemeColor = new SchemeColor();
     $ef->getInnerShadowEffect()->getShadowColor()->setSchemeColor($schemeColor->Accent1);
     # Write the presentation as a PPTX file
     $save_format = new SaveFormat();
     $pres->save($dataDir . "WordArt.pptx", $save_format->Pptx);
     print "Done with word art, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate Presentation
     $pres = new Presentation();
     # Get the first slide
     $slide = $pres->getSlides()->get_Item(0);
     # Add an AutoShape of Rectangle type
     $shape_type = new ShapeType();
     $ashp = $slide->getShapes()->addAutoShape($shape_type->Rectangle, 150, 75, 150, 50);
     # Add ITextFrame to the Rectangle
     $ashp->addTextFrame("Hello World");
     # Change the text color to Black (which is White by default)
     $fill_type = new FillType();
     $color = new Color();
     $ashp->getTextFrame()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0)->getPortionFormat()->getFillFormat()->setFillType($fill_type->Solid);
     $ashp->getTextFrame()->getParagraphs()->get_Item(0)->getPortions()->get_Item(0)->getPortionFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLACK);
     # Change the line color of the rectangle to White
     $ashp->getShapeStyle()->getLineColor()->setColor($color->WHITE);
     # Remove any fill formatting in the shape
     $ashp->getFillFormat()->setFillType($fill_type->NoFill);
     # Save the presentation to disk
     $save_format = new SaveFormat();
     $pres->save($dataDir . "HelloWorld.pptx", $save_format->Pptx);
     print "Document has been saved, please check the output file.";
 }
 public static function run($dataDir = null)
 {
     # Create an instance of Presentation class
     $pres = new Presentation($dataDir . 'demo.pptx');
     # Get the first slide
     $slide = $pres->getSlides()->get_Item(0);
     $shape = FindShape::find_shape($slide, "Shape1");
     print "Shape: " . $shape . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate a Presentation object that represents a PPTX file
     $pres = new Presentation($dataDir . "Presentation1.ppt");
     # Saving the PPTX presentation to PPTX format
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Aspose.pptx", $save_format->Pptx);
     print "Document has been converted, please check the output file.";
 }
 public static function convert_to_pdf_notes($dataDir = null)
 {
     # Instantiate a Presentation object that represents a PPTX file
     $pres = new Presentation($dataDir . "Aspose.pptx");
     # Saving the presentation
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Notes.pdf", $save_format->pdf);
     print "Document has been converted, please check the output file.";
 }
 public static function get_slide_by_id($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation($dataDir . 'Aspose.pptx');
     # Getting Slide ID
     $id = $pres->getSlides()->get_Item(0)->getSlideId();
     # Accessing Slide by ID
     $slide = $pres->getSlideById($id);
     print "Slide: " . $slide . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     $pres = new Presentation();
     # Get the first slide
     $sld = $pres->getSlides()->get_Item(0);
     # Define columns with widths and rows with heights
     $dbl_cols = [50, 50, 50];
     $dbl_rows = [50, 30, 30, 30];
     # Add table shape to slide
     $tbl = $sld->getShapes()->addTable(100, 50, $dbl_cols, $dbl_rows);
     $fill_type = new FillType();
     $color = new Color();
     # Set border format for each cell
     $row = 0;
     while ($row < java_values($tbl->getRows()->size())) {
         $cell = 0;
         while ($cell < $tbl->getRows()->get_Item($row)->size()) {
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->getFillFormat()->setFillType($fill_type->Solid);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->getFillFormat()->getSolidFillColor()->setColor($color->RED);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderTop()->setWidth(5);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->getFillFormat()->setFillType($fill_type->Solid);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->getFillFormat()->getSolidFillColor()->setColor($color->RED);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderBottom()->setWidth(5);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->getFillFormat()->setFillType($fill_type->Solid);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->getFillFormat()->getSolidFillColor()->setColor($color->RED);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderLeft()->setWidth(5);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->getFillFormat()->setFillType($fill_type->Solid);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->getFillFormat()->getSolidFillColor()->setColor($color->RED);
             $tbl->getRows()->get_Item($row)->get_Item($cell)->getBorderRight()->setWidth(5);
             $cell += 1;
         }
         $row += 1;
     }
     $tbl->getColumns()->get_Item(0)->get_Item(0)->getTextFrame()->setText("00");
     $tbl->getColumns()->get_Item(0)->get_Item(1)->getTextFrame()->setText("01");
     $tbl->getColumns()->get_Item(0)->get_Item(2)->getTextFrame()->setText("02");
     $tbl->getColumns()->get_Item(0)->get_Item(3)->getTextFrame()->setText("03");
     $tbl->getColumns()->get_Item(1)->get_Item(0)->getTextFrame()->setText("10");
     $tbl->getColumns()->get_Item(2)->get_Item(0)->getTextFrame()->setText("20");
     $tbl->getColumns()->get_Item(1)->get_Item(1)->getTextFrame()->setText("11");
     $tbl->getColumns()->get_Item(2)->get_Item(1)->getTextFrame()->setText("21");
     # AddClone adds a row in the end of the table
     $tbl->getRows()->addClone($tbl->getRows()->get_Item(0), false);
     # AddClone adds a column in the end of the table
     $tbl->getColumns()->addClone($tbl->getColumns()->get_Item(0), false);
     # InsertClone adds a row at specific position in a table
     $tbl->getRows()->insertClone(2, $tbl->getRows()->get_Item(0), false);
     # InsertClone adds a row at specific position in a table
     $tbl->getColumns()->insertClone(2, $tbl->getColumns()->get_Item(0), false);
     # Write the presentation as a PPTX file
     $save_format = new SaveFormat();
     $pres->save($dataDir . "CloneRowColumn.pptx", $save_format->Pptx);
     print "Cloned Row & Column from table, please check the output file.";
     PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation($dataDir . 'demo.pptx');
     # Removing the hyperlinks from presentation
     $pres->getHyperlinkQueries()->removeAllHyperlinks();
     # Saving the presentation
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Hyperlinks.pptx", $save_format->Pptx);
     print "Removed hyperlinks successfully, please check the output file." . PHP_EOL;
 }
 public static function remove_slide_by_id($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation($dataDir . 'Aspose.pptx');
     # Removing a slide using its slide index
     $pres->getSlides()->removeAt(1);
     # Saving the presentation file
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Modified.pptx", $save_format->Pptx);
     print "Removed slide by ID, please check the output file." . PHP_EOL;
 }
 public static function convert_to_html($dataDir = null)
 {
     # Instantiate a Presentation object that represents a PPTX file
     $pres = new Presentation($dataDir . "Aspose.pptx");
     $html_opt = new HtmlOptions();
     $html_formatter = new HtmlFormatter();
     $html_opt->setHtmlFormatter($html_formatter->createDocumentFormatter("", false));
     # Saving the presentation to HTML format
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Aspose.html", $save_format->Html, $html_opt);
     print "Document has been converted, please check the output file.";
 }
 public static function convert_with_custom_size($dataDir = null)
 {
     # Instantiate a Presentation object that represents a PPTX file
     $pres = new Presentation($dataDir . "Aspose.pptx");
     # Instantiate the TiffOptions class
     $opts = new XpsOptions();
     # Save MetaFiles as PNG
     $opts->SaveMetafilesAsPng = true;
     # Save the presentation to TIFF with specified image size
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Aspose-Custom-Size.xps", $save_format->Xps, $opts);
     print "Document has been converted, please check the output file.";
 }
 public static function run($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation($dataDir . 'Aspose.pptx');
     # Get the slide whose position is to be changed
     $slide = $pres->getSlides()->get_Item(0);
     # Set the new position for the slide
     $slide->setSlideNumber(2);
     # Saving the presentation
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Aspose_Position.pptx", $save_format->Pptx);
     print "Changes slide position, please check the output file." . PHP_EOL;
 }
Beispiel #16
0
 public static function run($dataDir = null)
 {
     # Create an instance of Presentation class
     $pres = new Presentation();
     # Setting View Properties of Presentation
     #pres.getViewProperties().getSlideViewProperties().setScale(50) # zoom value in percentages for slide view
     $pres->getViewProperties()->getNotesViewProperties()->setScale(50);
     # .Scale = 50; //zoom value in percentages for notes view
     # Save the presentation as a PPTX file
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Zoom.pptx", $save_format->Pptx);
     print "Set zoom value, please check the output file.";
 }
 public static function run($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation($dataDir . 'demo.pptx');
     $transition_type = new TransitionType();
     # Apply circle type transition on slide 1
     $pres->getSlides()->get_Item(0)->getSlideShowTransition()->setType($transition_type->Circle);
     # Apply comb type transition on slide 2
     $pres->getSlides()->get_Item(1)->getSlideShowTransition()->setType($transition_type->Comb);
     # Saving the presentation
     $save_format = new SaveFormat();
     $pres->save($dataDir . "SimpleTransition.pptx", $save_format->Pptx);
     print "Done with simple transition, please check the output file." . PHP_EOL;
 }
 public static function create_smartart_shape($dataDir = null)
 {
     # Create an instance of Presentation class
     $pres = new Presentation();
     # Get the first slide
     $slide = $pres->getSlides()->get_Item(0);
     # Add Smart Art Shape
     $smartArtLayoutType = new SmartArtLayoutType();
     $smart = $slide->getShapes()->addSmartArt(0, 0, 400, 400, $smartArtLayoutType->BasicBlockList);
     # Write the presentation as a PPTX file
     $saveFormat = new SaveFormat();
     $pres->save($dataDir . "SimpleSmartArt.pptx", $saveFormat->Pptx);
     print "Created smartart shape, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Create an instance of Presentation class
     $pres = new Presentation();
     # Adding the Media Player ActiveX control
     $controlType = new ControlType();
     $pres->getSlides()->get_Item(0)->getControls()->addControl($controlType->WindowsMediaPlayer, 100, 100, 400, 400);
     # Access the Media Player ActiveX control and set the video path
     $pres->getSlides()->get_Item(0)->getControls()->get_Item(0)->getProperties()->set_Item("URL", $dataDir . "Wildlife.mp4");
     # Write the presentation as a PPTX file
     $saveFormat = new SaveFormat();
     $pres->save($dataDir . "AddActiveX.pptx", $saveFormat->Pptx);
     print "Added ActiveX control, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Create an instance of Presentation class
     $pres = new Presentation($dataDir . 'Welcome.pptx');
     # Get the first slide
     $sld = $pres->getSlides()->get_Item(0);
     # Change the text of each placeholder
     $shp = $sld->getShapes()->get_Item(0);
     $shp->getTextFrame()->setText("This is Placeholder");
     # Write the presentation as a PPTX file
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Welcome_PH.pptx", $save_format->Pptx);
     print "Replaced text, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     $pres = new Presentation();
     # Get the first slide
     $slide = $pres->getSlides()->get_Item(0);
     $col_width = [100, 50, 30];
     $row_height = [30, 50, 30];
     $table = $slide->getShapes()->addTable(100, 100, $col_width, $row_height);
     $table->getRows()->removeAt(1, false);
     $table->getColumns()->removeAt(1, false);
     # Write the presentation as a PPTX file
     $save_format = new SaveFormat();
     $pres->save($dataDir . "RemoveRowColumn.pptx", $save_format->Pptx);
     print "Removed Row & Column from table, please check the output file." . PHP_EOL;
 }
 public static function remove_property($dataDir = null)
 {
     # Instantiate the Presentation class that represents the presentation
     $pres = new Presentation($dataDir . "HelloWorld.pptx");
     # Getting Document Properties
     $dp = $pres->getDocumentProperties();
     # Getting property name at particular index
     $property_name = $dp->getPropertyName(2);
     # Removing selected property
     $dp->remove($property_name);
     # Saving presentation
     $save_format = new SaveFormat();
     $pres->save($dataDir . "RemoveDP.pptx", $save_format->Pptx);
     print "Remove document property, please check output file.";
 }
 public static function set_page_size_for_pdf($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation();
     # Set SlideSize.Type Property
     $slideSizeType = new SlideSizeType();
     $pres->getSlideSize()->setType($slideSizeType->A4Paper);
     # Set different properties of PDF Options
     $opts = new PdfOptions();
     $opts->setSufficientResolution(600);
     # Saving the presentation
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Export.pdf", $save_format->Pdf, $opts);
     print "Set page size for pdf, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation();
     # Access first slide
     $sld = $pres->getSlides()->get_Item(0);
     # Adding a chart on slide
     $chartType = new ChartType();
     $ch = $sld->getShapes()->addChart($chartType->ClusteredColumn, 20, 20, 500, 300);
     # Setting the position of label from axis
     $ch->getAxes()->getHorizontalAxis()->setLabelOffset(500);
     # Saving the presentation
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Position.pptx", $save_format->Pptx);
     print "Set label distance, please check the output file." . PHP_EOL;
 }
 public static function create_thumbnail_of_user_defined_window($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation($dataDir . 'demo.pptx');
     # Access the first slide
     $slide = $pres->getSlides()->get_Item(0);
     # Create a full scale image
     $image = $slide->getThumbnail(1, 1);
     # Getting the image of desired window inside generated slide thumnbnail
     # BufferedImage window = image.getSubimage(windowX, windowY, windowsWidth, windowHeight);
     $window_image = $image->getSubimage(100, 100, 200, 200);
     # Save the image to disk in JPEG format
     $imageIO = new ImageIO();
     $imageIO->write($image, "jpeg", new File($dataDir . "ContentBG_tnail.jpg"));
     print "Created thumbnail of user defined window, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Create an instance of Presentation class
     $pres = new Presentation();
     # Get the first slide
     $sld = $pres->getSlides()->get_Item(0);
     # Add autoshape of rectangle type
     $shapeType = new ShapeType();
     $shp = $sld->getShapes()->addAutoShape($shapeType->Rectangle, 50, 150, 75, 150);
     # Rotate the shape to 90 degree
     $shp->setRotation(90);
     # Write the presentation as a PPTX file
     $save_format = new SaveFormat();
     $pres->save($dataDir . "RectShpRot.pptx", $save_format->Pptx);
     print "Rotated shape, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation($dataDir . "AsposeChart.pptx");
     # Access first slide
     $sld = $pres->getSlides()->get_Item(0);
     # Add chart with default data
     $chart = $sld->getShapes()->get_Item(0);
     # Setting the index of chart data sheet
     $defaultWorksheetIndex = 0;
     # Getting the chart data worksheet
     $fact = $chart->getChartData()->getChartDataWorkbook();
     # Changing chart Category Name
     $fact->getCell($defaultWorksheetIndex, 1, 0, "Modified Category 1");
     $fact->getCell($defaultWorksheetIndex, 2, 0, "Modified Category 2");
     # Take first chart series
     $series = $chart->getChartData()->getSeries()->get_Item(0);
     # Now updating series data
     $fact->getCell($defaultWorksheetIndex, 0, 1, "New_Series1");
     # modifying series name
     $series->getDataPoints()->get_Item(0)->getValue()->setData(90);
     $series->getDataPoints()->get_Item(1)->getValue()->setData(123);
     $series->getDataPoints()->get_Item(2)->getValue()->setData(44);
     # Take Second chart series
     $series = $chart->getChartData()->getSeries()->get_Item(1);
     # Now updating series data
     $fact->getCell($defaultWorksheetIndex, 0, 2, "New_Series2");
     #modifying series name
     $series->getDataPoints()->get_Item(0)->getValue()->setData(23);
     $series->getDataPoints()->get_Item(1)->getValue()->setData(67);
     $series->getDataPoints()->get_Item(2)->getValue()->setData(99);
     # Now, Adding a new series
     $chart->getChartData()->getSeries()->add($fact->getCell($defaultWorksheetIndex, 0, 3, "Series 3"), $chart->getType());
     # Take 3rd chart series
     $series = $chart->getChartData()->getSeries()->get_Item(2);
     # Now populating series data
     $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 1, 3, 20));
     $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 2, 3, 50));
     $series->getDataPoints()->addDataPointForBarSeries($fact->getCell($defaultWorksheetIndex, 3, 3, 30));
     $chartType = new ChartType();
     $chart->setType($chartType->ClusteredCylinder);
     # Saving the presentation to HTML format
     $save_format = new SaveFormat();
     $pres->save($dataDir . "AsposeChartModified.pptx", $save_format->Pptx);
     print "Updated chart, please check the output file." . PHP_EOL;
 }
 public static function add_overlap_for_chart($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation();
     # Adding chart
     $chartType = new ChartType();
     $chart = $pres->getSlides()->get_Item(0)->getShapes()->addChart($chartType->ClusteredColumn, 50, 50, 600, 400, true);
     $series = $chart->getChartData()->getSeries();
     if ($series->get_Item(0)->getOverlap() == 0) {
         # Setting series overlap
         $series->get_Item(0)->getParentSeriesGroup()->setOverlap(-30);
     }
     # Saving the presentation
     $save_format = new SaveFormat();
     $pres->save($dataDir . "Overlap.pptx", $save_format->Pptx);
     print "Added chart series overlap for charts, please check the output file." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate Presentation class that represents the presentation file
     $pres = new Presentation($dataDir . 'demo.pptx');
     # Getting last slide index
     $last_slide_position = java_values($pres->getSlides()->size());
     #Iterating through every presentation slide and generating SVG image
     $i = 0;
     while ($i < $last_slide_position) {
         # Accessing Slides
         $slide = $pres->getSlides()->get_Item($i);
         # Getting and saving the slide SVG image
         $slide->writeAsSvg(new FileOutputStream($dataDir . "SvgImage#{$i}.svg"));
         $i++;
     }
     print "Created SVG images, please check output files." . PHP_EOL;
 }
 public static function format_join_styles($dataDir = null)
 {
     # Create an instance of Presentation class
     $pres = new Presentation();
     # Get the first slide
     $sld = $pres->getSlides()->get_Item(0);
     # Add three autoshapes of rectangle type
     $shape_type = new ShapeType();
     $shp1 = $sld->getShapes()->addAutoShape($shape_type->Rectangle, 50, 100, 150, 75);
     $shp2 = $sld->getShapes()->addAutoShape($shape_type->Rectangle, 300, 100, 150, 75);
     $shp3 = $sld->getShapes()->addAutoShape($shape_type->Rectangle, 50, 250, 150, 75);
     # Set the fill color of the rectangle shape
     $fill_type = new FillType();
     $color = new Color();
     $shp1->getFillFormat()->setFillType($fill_type->Solid);
     $shp1->getFillFormat()->getSolidFillColor()->setColor($color->BLACK);
     $shp2->getFillFormat()->setFillType($fill_type->Solid);
     $shp2->getFillFormat()->getSolidFillColor()->setColor($color->BLACK);
     $shp3->getFillFormat()->setFillType($fill_type->Solid);
     $shp3->getFillFormat()->getSolidFillColor()->setColor($color->BLACK);
     # Set the line width
     $shp1->getLineFormat()->setWidth(15);
     $shp2->getLineFormat()->setWidth(15);
     $shp3->getLineFormat()->setWidth(15);
     # Set the color of the line of rectangle
     $shp1->getLineFormat()->getFillFormat()->setFillType($fill_type->Solid);
     $shp1->getLineFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE);
     $shp2->getLineFormat()->getFillFormat()->setFillType($fill_type->Solid);
     $shp2->getLineFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE);
     $shp3->getLineFormat()->getFillFormat()->setFillType($fill_type->Solid);
     $shp3->getLineFormat()->getFillFormat()->getSolidFillColor()->setColor($color->BLUE);
     # Set the Join Style
     $line_join_style = new LineJoinStyle();
     $shp1->getLineFormat()->setJoinStyle($line_join_style->Miter);
     $shp2->getLineFormat()->setJoinStyle($line_join_style->Bevel);
     $shp3->getLineFormat()->setJoinStyle($line_join_style->Round);
     # Add text to each rectangle
     $shp1->getTextFrame()->setText("This is Miter Join Style");
     $shp2->getTextFrame()->setText("This is Bevel Join Style");
     $shp3->getTextFrame()->setText("This is Round Join Style");
     # Write the presentation as a PPTX file
     $save_format = new SaveFormat();
     $pres->save($dataDir . "RectShpLnJoin.pptx", $save_format->Pptx);
     print "Formatted join styles, please check the output file." . PHP_EOL;
 }