Coder Social home page Coder Social logo

robbtech / phppresentation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phpoffice/phppresentation

0.0 0.0 0.0 132.23 MB

A pure PHP library for reading and writing presentations documents

Home Page: https://phpoffice.github.io/PHPPresentation

License: Other

PHP 100.00%

phppresentation's Introduction

PHPPresentation

Latest Stable Version Coverage Status Total Downloads License BountySource Join the chat at https://gitter.im/PHPOffice/PHPPresentation

Branch Master : PHPPresentation

Branch Develop : PHPPresentation

PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. Microsoft Office Open XML (OOXML or OpenXML) or OASIS Open Document Format for Office Applications (OpenDocument or ODF).

PHPPresentation is an open source project licensed under the terms of LGPL version 3. PHPPresentation is aimed to be a high quality software product by incorporating continuous integration and unit testing. You can learn more about PHPPresentation by reading the Developers' Documentation and the API Documentation.

Read more about PHPPresentation:

Features

  • Create an in-memory presentation representation
  • Set presentation meta data (author, title, description, etc)
  • Add slides from scratch or from existing one
  • Supports different fonts and font styles
  • Supports different formatting, styles, fills, gradients
  • Supports hyperlinks and rich-text strings
  • Add images with different styles (positioning, rotation, shadow)
  • Set printing options (header, footer, page margins, paper size, orientation)
  • Set transitions between slides
  • Output to different file formats: PowerPoint 2007 (.pptx), OpenDocument Presentation (.odp), Serialized Presentation)
  • ... and lots of other things!

Requirements

PHPPresentation requires the following:

Installation

Composer method

It is recommended that you install the PHPPresentation library through composer. To do so, add the following lines to your composer.json.

{
    "require": {
       "phpoffice/phppresentation": "dev-master"
    }
}

Manual download method

Alternatively, you can download the latest release from the releases page. In this case, you will have to register the autoloader. (Register autoloading is required only if you do not use composer in your project.)

require_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php';
\PhpOffice\PhpPresentation\Autoloader::register();

You will also need to download the latest PHPOffice/Common release from its releases page. And you will also have to register its autoloader, too.

require_once 'path/to/PhpOffice/Common/src/Common/Autoloader.php';
\PhpOffice\Common\Autoloader::register();

Getting started

The following is a basic usage example of the PHPPresentation library.

// with your own install
require_once 'src/PhpPresentation/Autoloader.php';
\PhpOffice\PhpPresentation\Autoloader::register();
require_once 'src/Common/Autoloader.php';
\PhpOffice\Common\Autoloader::register();

// with Composer
require_once 'vendor/autoload.php';

use PhpOffice\PhpPresentation\PhpPresentation;
use PhpOffice\PhpPresentation\IOFactory;
use PhpOffice\PhpPresentation\Style\Color;
use PhpOffice\PhpPresentation\Style\Alignment;

$objPHPPowerPoint = new PhpPresentation();

// Create slide
$currentSlide = $objPHPPowerPoint->getActiveSlide();

// Create a shape (drawing)
$shape = $currentSlide->createDrawingShape();
$shape->setName('PHPPresentation logo')
      ->setDescription('PHPPresentation logo')
      ->setPath('./resources/phppowerpoint_logo.gif')
      ->setHeight(36)
      ->setOffsetX(10)
      ->setOffsetY(10);
$shape->getShadow()->setVisible(true)
                   ->setDirection(45)
                   ->setDistance(10);

// Create a shape (text)
$shape = $currentSlide->createRichTextShape()
      ->setHeight(300)
      ->setWidth(600)
      ->setOffsetX(170)
      ->setOffsetY(180);
$shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER );
$textRun = $shape->createTextRun('Thank you for using PHPPresentation!');
$textRun->getFont()->setBold(true)
                   ->setSize(60)
                   ->setColor( new Color( 'FFE06B20' ) );

$oWriterPPTX = IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007');
$oWriterPPTX->save(__DIR__ . "/sample.pptx");
$oWriterODP = IOFactory::createWriter($objPHPPowerPoint, 'ODPresentation');
$oWriterODP->save(__DIR__ . "/sample.odp");

More examples are provided in the samples folder. You can also read the Developers' Documentation and the API Documentation for more detail.

Contributing

We welcome everyone to contribute to PHPPresentation. Below are some of the things that you can do to contribute:

phppresentation's People

Contributors

progi1984 avatar ivanlanin avatar maartenba avatar mindline-analytics avatar jrking4 avatar chriskapp avatar joshuadoss avatar vincentkool avatar pgee70 avatar danielbair avatar carusogabriel avatar bjo3rnf avatar kw-pr avatar delphiki avatar tcitworld avatar brenneisen avatar jamesggordon avatar jewrassicpark avatar sapfeer0k avatar noodlesegg avatar mvargasmoran avatar rdoepke avatar fake51 avatar jvanoostrom avatar djuki avatar andreybolonin avatar smithyj avatar ulziibuyan avatar polidog avatar karlosagudo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.