SlideShare une entreprise Scribd logo
1  sur  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/

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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Дмитрий Радыно
 

Similaire à 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
 

Plus de 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
 

Plus de 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
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Dernier (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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)
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 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
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

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