SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Mark Baker
     @Mark_Baker

Technical Team Lead at Inviqa
  (formerly Ibuildings UK)

Coordinator of Open Source libraries:
     PHPExcel,
     PHPWord,
     PHPPowerPoint,
     PHPVisio,
     PHPProject
PHPOffice
                https://github.com/PHPOffice/

Set of PHP Libraries for creating, reading and writing
documents in standard office suite file formats

                  PHPExcel
                  PHPWord
                  PHPPowerPoint
                  PHPProject
                  PHPVisio

Licensed under LGPL (GNU LESSER GENERAL PUBLIC LICENSE)
PHP Spreadsheet Engine
Major Features
       Document Metadata (author, date created, etc.)
       Cell and content Styles/Formatting
       Rich Text in cells
       Conditional Formatting
       Merged Cells
       Hyperlinks
       AutoFilter Ranges
       Print Options
       Freeze Panes
       Embedded Images
       Charts
       Built-in Calculation engine for evaluating Excel formulae
require_once '../Classes/PHPExcel.php';

$objReader = PHPExcel_IOFactory::createReader('Excel5');
$objPHPExcel = $objReader->load("templates/invoiceTemplate.xls");

$data = array(array('title' =>   'Excel for dummies',
                    'price' =>   17.99,
                    'quantity'   => 2
                   ),
              array('title' =>   'PHP for dummies',
                    'price' =>   15.99,
                    'quantity'   => 1
                   ),
              array('title' =>   'Inside OOP',
                    'price' =>   12.95,
                    'quantity'   => 1
                   )
             );

$objPHPExcel->getActiveSheet()->setCellValue('D1', PHPExcel_Shared_Date::PHPToExcel(time()));

$baseRow = 5;
foreach($data as $r => $dataRow) {
    $row = $baseRow + $r;
    $objPHPExcel->getActiveSheet()->insertNewRowBefore($row,1);

   $objPHPExcel->getActiveSheet()->setCellValue('A'.$row,   $r+1)
                                 ->setCellValue('B'.$row,   $dataRow['title'])
                                 ->setCellValue('C'.$row,   $dataRow['price'])
                                 ->setCellValue('D'.$row,   $dataRow['quantity'])
                                 ->setCellValue('E'.$row,   '=C'.$row.'*D'.$row);
}
$objPHPExcel->getActiveSheet()->removeRow($baseRow-1,1);

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__));
File Formats
                                                                                  Reading   Writing
BIFF (BIFF5 - BIFF 8)
MS Excel 95 and above (.xls .xlt)
                                                                                             
OfficeOpenXML
MS Excel 2007 and above (Excel 2003 with Compatibility Pack) (.xlsx .xlsm .xltx              
.xltm)
SpreadsheetML
MS Excel 2003 and above (.xml)
                                                                                    
OASIS / Open Document Format
Open/Libre Office Calc (.ods .ots)
                                                                                    
Gnumeric (.gnumeric)                                                                
SYLK
MS Multiplan Symbolic Link (.slk)
                                                                                    
HTML                                                                                         
CSV                                                                                          
PDF                                                                                           
PHP Word Processing Engine
Major Features
       Insert and format document sections
       Insert and format Text elements
       Insert Text breaks
       Insert Page breaks
       Insert and format Images and binary OLE-Objects
       Insert and format watermarks
       Insert Header / Footer
       Insert and format Tables
       Insert native Titles and Table-of-contents
       Insert and format List elements
       Insert and format hyperlinks
       Template system
File Formats

                                                                        Reading   Writing
OfficeOpenXML
MS Word 2007 and above (MS Word 2003 with Compatibility Pack) (.docx)
                                                                                    
OASIS / Open Document Format
Open/Libre Office Writer (.odt)
                                                                                    
Rich-Text Format
.rtf
                                                                                    
require_once '../src/PHPWord.php';

// New Word Document
$PHPWord = new PHPWord();

// New portrait section
$section = $PHPWord->createSection();

// Add text elements
$section->addText('Hello World!');
$section->addTextBreak(2);

$section->addText('I am inline styled.', array('name'=>'Verdana', 'color'=>'006699'));
$section->addTextBreak(2);

$PHPWord->addFontStyle('rStyle', array('bold'=>true, 'italic'=>true, 'size'=>16));
$PHPWord->addParagraphStyle('pStyle', array('align'=>'center', 'spaceAfter'=>100));
$section->addText('I am styled by two style definitions.', 'rStyle', 'pStyle');
$section->addText('I have only a paragraph style definition.', null, 'pStyle');

// Save File
$objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007');
$objWriter->save(str_replace('.php', '.docx', __FILE__));
PHP Presentation Library

Major Features
       Presentation meta data (author, title, description, ...)
       Add slides to presentation
       Supports different fonts and font styles
       Supports formatting, styles, fills, gradients, ...
       Supports hyperlinks
       Supports rich-text strings
       Add images to your presentation
       Set image styles
       Set printing options
File Formats
                                                                            Reading   Writing
OfficeOpenXML
MS PowerPoint 2007 and above (MS PowerPoint 2003 with Compatibility Pack)               
(.pptx)
OASIS / Open Document Format
Open/Libre Office Impress (.odp)
                                                                                        
include 'PHPPowerPoint.php';

// Create new PHPPowerPoint object
$objPHPPowerPoint = new PHPPowerPoint();
// Set properties
$objPHPPowerPoint->getProperties()->setCreator('Mark Baker')
                  ->setTitle('Office 2007 PPTX Test Document')
                  ->setSubject('Office 2007 PPTX Test Document');

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

// Create a shape (drawing)
$shape = $currentSlide->createDrawingShape();
$shape->setName('PHPPowerPoint logo')
                 ->setDescription('PHPPowerPoint logo')
                 ->setPath('./images/phppowerpoint_logo.gif')
                 ->setHeight(36)
                 ->setOffsetX(10)
                 ->setOffsetY(10);

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

// Save PowerPoint 2007 file
$objWriter = PHPPowerPoint_IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007');
$objWriter->save(str_replace('.php', '.pptx', __FILE__));
PHPProject
Planned File Formats
                               Reading   Writing
Gantt Project

MS Project Exchange
PHPVisio
Planned File Formats
                        Reading   Writing
MS Visio

Dia

GraphViz
PHPOffice
Contributions Welcome

    Code Writing
          Bug fixes
          Patches
          Extensions
          New Features
          New Readers
          New Writers
    Testing
        Unit Tests
        Testing against Office Suite programs
    Documentation
          API Document Blocks
          Library Documents
          Tutorials
          Blog Posts
    General
        Answer questions on forums and message boards
PHPOffice
https://github.com/PHPOffice/

Weitere ähnliche Inhalte

Was ist angesagt?

User Interface Development with Mulberry
User Interface Development with MulberryUser Interface Development with Mulberry
User Interface Development with Mulberrymrdanimal
 
@Agawish creating a stunning ui with oracle adf faces, using sass
@Agawish   creating a stunning ui with oracle adf faces, using sass@Agawish   creating a stunning ui with oracle adf faces, using sass
@Agawish creating a stunning ui with oracle adf faces, using sassAmr Gawish
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme SystemPeter Arato
 
Cegonsoft PHP training institute in Bnaglaore
Cegonsoft PHP training institute in BnaglaoreCegonsoft PHP training institute in Bnaglaore
Cegonsoft PHP training institute in BnaglaoreCegonsoft Fames
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeAdolfo Nasol
 

Was ist angesagt? (7)

Fapi
FapiFapi
Fapi
 
User Interface Development with Mulberry
User Interface Development with MulberryUser Interface Development with Mulberry
User Interface Development with Mulberry
 
@Agawish creating a stunning ui with oracle adf faces, using sass
@Agawish   creating a stunning ui with oracle adf faces, using sass@Agawish   creating a stunning ui with oracle adf faces, using sass
@Agawish creating a stunning ui with oracle adf faces, using sass
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme System
 
Cegonsoft PHP training institute in Bnaglaore
Cegonsoft PHP training institute in BnaglaoreCegonsoft PHP training institute in Bnaglaore
Cegonsoft PHP training institute in Bnaglaore
 
Xml
XmlXml
Xml
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 Theme
 

Ähnlich wie What is PHPOffice?

Quick beginner to Lower-Advanced guide/tutorial in PHP
Quick beginner to Lower-Advanced guide/tutorial in PHPQuick beginner to Lower-Advanced guide/tutorial in PHP
Quick beginner to Lower-Advanced guide/tutorial in PHPSanju Sony Kurian
 
EPiServer report generation
EPiServer report generationEPiServer report generation
EPiServer report generationPaul Graham
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />tutorialsruby
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3tutorialsruby
 
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/tutorialsruby
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3tutorialsruby
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's CodeWildan Maulana
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...webhostingguy
 
Intro to php
Intro to phpIntro to php
Intro to phpSp Singh
 
PHP Arrays - indexed and associative array.
PHP Arrays - indexed and associative array. PHP Arrays - indexed and associative array.
PHP Arrays - indexed and associative array. wahidullah mudaser
 
Introduction To Php For Wit2009
Introduction To Php For Wit2009Introduction To Php For Wit2009
Introduction To Php For Wit2009cwarren
 
Introducation to php for beginners
Introducation to php for beginners Introducation to php for beginners
Introducation to php for beginners musrath mohammad
 
Starting with PHP and Web devepolment
Starting with PHP and Web devepolmentStarting with PHP and Web devepolment
Starting with PHP and Web devepolmentRajib Ahmed
 
Работа с документами в JavaScript
Работа с документами в JavaScriptРабота с документами в JavaScript
Работа с документами в JavaScriptДмитрий Радыно
 

Ähnlich wie What is PHPOffice? (20)

Quick beginner to Lower-Advanced guide/tutorial in PHP
Quick beginner to Lower-Advanced guide/tutorial in PHPQuick beginner to Lower-Advanced guide/tutorial in PHP
Quick beginner to Lower-Advanced guide/tutorial in PHP
 
PHP and MySQL.ppt
PHP and MySQL.pptPHP and MySQL.ppt
PHP and MySQL.ppt
 
EPiServer report generation
EPiServer report generationEPiServer report generation
EPiServer report generation
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's Code
 
WEB DEVELOPMENT
WEB DEVELOPMENTWEB DEVELOPMENT
WEB DEVELOPMENT
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
 
Intro to php
Intro to phpIntro to php
Intro to php
 
PHP Arrays - indexed and associative array.
PHP Arrays - indexed and associative array. PHP Arrays - indexed and associative array.
PHP Arrays - indexed and associative array.
 
Php
PhpPhp
Php
 
Introduction To Php For Wit2009
Introduction To Php For Wit2009Introduction To Php For Wit2009
Introduction To Php For Wit2009
 
Introducation to php for beginners
Introducation to php for beginners Introducation to php for beginners
Introducation to php for beginners
 
Starting with PHP and Web devepolment
Starting with PHP and Web devepolmentStarting with PHP and Web devepolment
Starting with PHP and Web devepolment
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Php with my sql
Php with my sqlPhp with my sql
Php with my sql
 
Работа с документами в JavaScript
Работа с документами в JavaScriptРабота с документами в JavaScript
Работа с документами в JavaScript
 

Mehr von Mark Baker

Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsMark Baker
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsMark Baker
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsMark Baker
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to ProductionMark Baker
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to ProductionMark Baker
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to ProductionMark Baker
 
A Brief History of Elephpants
A Brief History of ElephpantsA Brief History of Elephpants
A Brief History of ElephpantsMark Baker
 
Aspects of love slideshare
Aspects of love slideshareAspects of love slideshare
Aspects of love slideshareMark Baker
 
Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?Mark Baker
 
A Brief History of ElePHPants
A Brief History of ElePHPantsA Brief History of ElePHPants
A Brief History of ElePHPantsMark Baker
 
Coding Horrors
Coding HorrorsCoding Horrors
Coding HorrorsMark Baker
 
Anonymous classes2
Anonymous classes2Anonymous classes2
Anonymous classes2Mark Baker
 
Testing the Untestable
Testing the UntestableTesting the Untestable
Testing the UntestableMark Baker
 
Anonymous Classes: Behind the Mask
Anonymous Classes: Behind the MaskAnonymous Classes: Behind the Mask
Anonymous Classes: Behind the MaskMark Baker
 
Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?Mark Baker
 
Coding Horrors
Coding HorrorsCoding Horrors
Coding HorrorsMark Baker
 
Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?Mark Baker
 
Giving birth to an ElePHPant
Giving birth to an ElePHPantGiving birth to an ElePHPant
Giving birth to an ElePHPantMark Baker
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsMark Baker
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsMark Baker
 

Mehr von Mark Baker (20)

Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
 
Looping the Loop with SPL Iterators
Looping the Loop with SPL IteratorsLooping the Loop with SPL Iterators
Looping the Loop with SPL Iterators
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to Production
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to Production
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to Production
 
A Brief History of Elephpants
A Brief History of ElephpantsA Brief History of Elephpants
A Brief History of Elephpants
 
Aspects of love slideshare
Aspects of love slideshareAspects of love slideshare
Aspects of love slideshare
 
Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?
 
A Brief History of ElePHPants
A Brief History of ElePHPantsA Brief History of ElePHPants
A Brief History of ElePHPants
 
Coding Horrors
Coding HorrorsCoding Horrors
Coding Horrors
 
Anonymous classes2
Anonymous classes2Anonymous classes2
Anonymous classes2
 
Testing the Untestable
Testing the UntestableTesting the Untestable
Testing the Untestable
 
Anonymous Classes: Behind the Mask
Anonymous Classes: Behind the MaskAnonymous Classes: Behind the Mask
Anonymous Classes: Behind the Mask
 
Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?
 
Coding Horrors
Coding HorrorsCoding Horrors
Coding Horrors
 
Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?Does the SPL still have any relevance in the Brave New World of PHP7?
Does the SPL still have any relevance in the Brave New World of PHP7?
 
Giving birth to an ElePHPant
Giving birth to an ElePHPantGiving birth to an ElePHPant
Giving birth to an ElePHPant
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP Generators
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP Generators
 

Kürzlich hochgeladen

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

What is PHPOffice?

  • 1. Mark Baker @Mark_Baker Technical Team Lead at Inviqa (formerly Ibuildings UK) Coordinator of Open Source libraries: PHPExcel, PHPWord, PHPPowerPoint, PHPVisio, PHPProject
  • 2. PHPOffice https://github.com/PHPOffice/ Set of PHP Libraries for creating, reading and writing documents in standard office suite file formats PHPExcel PHPWord PHPPowerPoint PHPProject PHPVisio Licensed under LGPL (GNU LESSER GENERAL PUBLIC LICENSE)
  • 3. PHP Spreadsheet Engine Major Features  Document Metadata (author, date created, etc.)  Cell and content Styles/Formatting  Rich Text in cells  Conditional Formatting  Merged Cells  Hyperlinks  AutoFilter Ranges  Print Options  Freeze Panes  Embedded Images  Charts  Built-in Calculation engine for evaluating Excel formulae
  • 4. require_once '../Classes/PHPExcel.php'; $objReader = PHPExcel_IOFactory::createReader('Excel5'); $objPHPExcel = $objReader->load("templates/invoiceTemplate.xls"); $data = array(array('title' => 'Excel for dummies', 'price' => 17.99, 'quantity' => 2 ), array('title' => 'PHP for dummies', 'price' => 15.99, 'quantity' => 1 ), array('title' => 'Inside OOP', 'price' => 12.95, 'quantity' => 1 ) ); $objPHPExcel->getActiveSheet()->setCellValue('D1', PHPExcel_Shared_Date::PHPToExcel(time())); $baseRow = 5; foreach($data as $r => $dataRow) { $row = $baseRow + $r; $objPHPExcel->getActiveSheet()->insertNewRowBefore($row,1); $objPHPExcel->getActiveSheet()->setCellValue('A'.$row, $r+1) ->setCellValue('B'.$row, $dataRow['title']) ->setCellValue('C'.$row, $dataRow['price']) ->setCellValue('D'.$row, $dataRow['quantity']) ->setCellValue('E'.$row, '=C'.$row.'*D'.$row); } $objPHPExcel->getActiveSheet()->removeRow($baseRow-1,1); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save(str_replace('.php', '.xls', __FILE__));
  • 5. File Formats Reading Writing BIFF (BIFF5 - BIFF 8) MS Excel 95 and above (.xls .xlt)   OfficeOpenXML MS Excel 2007 and above (Excel 2003 with Compatibility Pack) (.xlsx .xlsm .xltx   .xltm) SpreadsheetML MS Excel 2003 and above (.xml)  OASIS / Open Document Format Open/Libre Office Calc (.ods .ots)  Gnumeric (.gnumeric)  SYLK MS Multiplan Symbolic Link (.slk)  HTML   CSV   PDF 
  • 6. PHP Word Processing Engine Major Features  Insert and format document sections  Insert and format Text elements  Insert Text breaks  Insert Page breaks  Insert and format Images and binary OLE-Objects  Insert and format watermarks  Insert Header / Footer  Insert and format Tables  Insert native Titles and Table-of-contents  Insert and format List elements  Insert and format hyperlinks  Template system
  • 7. File Formats Reading Writing OfficeOpenXML MS Word 2007 and above (MS Word 2003 with Compatibility Pack) (.docx)  OASIS / Open Document Format Open/Libre Office Writer (.odt)  Rich-Text Format .rtf 
  • 8. require_once '../src/PHPWord.php'; // New Word Document $PHPWord = new PHPWord(); // New portrait section $section = $PHPWord->createSection(); // Add text elements $section->addText('Hello World!'); $section->addTextBreak(2); $section->addText('I am inline styled.', array('name'=>'Verdana', 'color'=>'006699')); $section->addTextBreak(2); $PHPWord->addFontStyle('rStyle', array('bold'=>true, 'italic'=>true, 'size'=>16)); $PHPWord->addParagraphStyle('pStyle', array('align'=>'center', 'spaceAfter'=>100)); $section->addText('I am styled by two style definitions.', 'rStyle', 'pStyle'); $section->addText('I have only a paragraph style definition.', null, 'pStyle'); // Save File $objWriter = PHPWord_IOFactory::createWriter($PHPWord, 'Word2007'); $objWriter->save(str_replace('.php', '.docx', __FILE__));
  • 9. PHP Presentation Library Major Features  Presentation meta data (author, title, description, ...)  Add slides to presentation  Supports different fonts and font styles  Supports formatting, styles, fills, gradients, ...  Supports hyperlinks  Supports rich-text strings  Add images to your presentation  Set image styles  Set printing options
  • 10. File Formats Reading Writing OfficeOpenXML MS PowerPoint 2007 and above (MS PowerPoint 2003 with Compatibility Pack)  (.pptx) OASIS / Open Document Format Open/Libre Office Impress (.odp) 
  • 11. include 'PHPPowerPoint.php'; // Create new PHPPowerPoint object $objPHPPowerPoint = new PHPPowerPoint(); // Set properties $objPHPPowerPoint->getProperties()->setCreator('Mark Baker') ->setTitle('Office 2007 PPTX Test Document') ->setSubject('Office 2007 PPTX Test Document'); // Create slide $currentSlide = $objPHPPowerPoint->getActiveSlide(); // Create a shape (drawing) $shape = $currentSlide->createDrawingShape(); $shape->setName('PHPPowerPoint logo') ->setDescription('PHPPowerPoint logo') ->setPath('./images/phppowerpoint_logo.gif') ->setHeight(36) ->setOffsetX(10) ->setOffsetY(10); // Create a shape (text) $shape = $currentSlide->createRichTextShape() ->setHeight(300) ->setWidth(600) ->setOffsetX(170) ->setOffsetY(180); $shape->getActiveParagraph()->getAlignment()->setHorizontal( PHPPowerPoint_Style_Alignment::HORIZONTAL_CENTER ); $textRun = $shape->createTextRun('Thank you for using PHPPowerPoint!'); $textRun->getFont()->setBold(true) ->setSize(60) ->setColor( new PHPPowerPoint_Style_Color( 'FFC00000' ) ); // Save PowerPoint 2007 file $objWriter = PHPPowerPoint_IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007'); $objWriter->save(str_replace('.php', '.pptx', __FILE__));
  • 12. PHPProject Planned File Formats Reading Writing Gantt Project MS Project Exchange
  • 13. PHPVisio Planned File Formats Reading Writing MS Visio Dia GraphViz
  • 14. PHPOffice Contributions Welcome  Code Writing  Bug fixes  Patches  Extensions  New Features  New Readers  New Writers  Testing  Unit Tests  Testing against Office Suite programs  Documentation  API Document Blocks  Library Documents  Tutorials  Blog Posts  General  Answer questions on forums and message boards