{"id":13590228,"url":"https://github.com/PHPOffice/PHPPresentation","last_synced_at":"2025-04-08T12:33:05.845Z","repository":{"id":3568768,"uuid":"4630870","full_name":"PHPOffice/PHPPresentation","owner":"PHPOffice","description":"A pure PHP library for reading and writing presentations documents ","archived":false,"fork":false,"pushed_at":"2024-09-12T13:48:13.000Z","size":143668,"stargazers_count":1307,"open_issues_count":261,"forks_count":521,"subscribers_count":84,"default_branch":"master","last_synced_at":"2024-10-29T15:03:03.249Z","etag":null,"topics":["hacktoberfest","libreoffice-impress","mspowerpoint","odp","office","php","powerpoint","ppt","pptx","presentation"],"latest_commit_sha":null,"homepage":"https://phpoffice.github.io/PHPPresentation","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PHPOffice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-06-11T22:34:32.000Z","updated_at":"2024-10-29T13:28:05.000Z","dependencies_parsed_at":"2023-01-13T13:01:10.936Z","dependency_job_id":"65c70e5b-2356-4ddc-a5ae-ff41984f2c62","html_url":"https://github.com/PHPOffice/PHPPresentation","commit_stats":{"total_commits":791,"total_committers":62,"mean_commits":"12.758064516129032","dds":0.3223767383059418,"last_synced_commit":"1d5b988703d255703b1ce62cf787763ff4b15ace"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPOffice%2FPHPPresentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPOffice%2FPHPPresentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPOffice%2FPHPPresentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPOffice%2FPHPPresentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PHPOffice","download_url":"https://codeload.github.com/PHPOffice/PHPPresentation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247843129,"owners_count":21005409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","libreoffice-impress","mspowerpoint","odp","office","php","powerpoint","ppt","pptx","presentation"],"created_at":"2024-08-01T16:00:41.894Z","updated_at":"2025-04-08T12:33:00.815Z","avatar_url":"https://github.com/PHPOffice.png","language":"PHP","readme":"# ![PHPPresentation](https://raw.githubusercontent.com/mvargasmoran/PHPPresentation/develop/docs/images/PHPPresentationLogo.png \"PHPPresentation\")\n\n[![Latest Stable Version](https://poser.pugx.org/phpoffice/phppresentation/v/stable.png)](https://packagist.org/packages/phpoffice/phppresentation)\n[![Coverage Status](https://coveralls.io/repos/github/PHPOffice/PHPPresentation/badge.svg?branch=develop)](https://coveralls.io/github/PHPOffice/PHPPresentation?branch=develop)\n[![Total Downloads](https://poser.pugx.org/phpoffice/phppresentation/downloads.png)](https://packagist.org/packages/phpoffice/phppresentation)\n[![License](https://poser.pugx.org/phpoffice/phppresentation/license.png)](https://packagist.org/packages/phpoffice/phppresentation)\n[![BountySource](https://img.shields.io/bountysource/team/phpoffice/activity.svg)](https://www.bountysource.com/teams/phpoffice)\n[![Join the chat at https://gitter.im/PHPOffice/PHPPresentation](https://img.shields.io/badge/Gitter-join%20chat-green.svg)](https://gitter.im/PHPOffice/PHPPresentation)\n\nBranch Master : [![PHPPresentation](https://github.com/PHPOffice/PHPPresentation/actions/workflows/php.yml/badge.svg?branch=master)](https://github.com/PHPOffice/PHPPresentation/actions/workflows/php.yml)\n\nBranch Develop : [![PHPPresentation](https://github.com/PHPOffice/PHPPresentation/actions/workflows/php.yml/badge.svg?branch=develop)](https://github.com/PHPOffice/PHPPresentation/actions/workflows/php.yml)\n\nPHPPresentation 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](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML) or OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF).\n\nPHPPresentation is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPPresentation/blob/develop/COPYING.LESSER). PHPPresentation is aimed to be a high quality software product by incorporating [continuous integration](https://github.com/PHPOffice/PHPPresentation/actions/workflows/php.yml) and [unit testing](https://coveralls.io/github/PHPOffice/PHPPresentation). You can learn more about PHPPresentation by reading the [Developers' Documentation](https://phpoffice.github.io/PHPPresentation) and the [API Documentation](https://phpoffice.github.io/PHPPresentation/docs/).\n\nRead more about PHPPresentation:\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Getting started](#getting-started)\n- [Contributing](#contributing)\n- [Developers' Documentation](https://phpoffice.github.io/PHPPresentation/)\n- [API Documentation](https://phpoffice.github.io/PHPPresentation/docs/)\n\n### Features\n\n- Create an in-memory presentation representation\n- Set presentation meta data (author, title, description, etc)\n- Add slides from scratch or from existing one\n- Supports different fonts and font styles\n- Supports different formatting, styles, fills, gradients\n- Supports hyperlinks and rich-text strings\n- Add images with different styles (positioning, rotation, shadow)\n- Set printing options (header, footer, page margins, paper size, orientation)\n- Set transitions between slides\n- Output to different file formats: PowerPoint 2007 (.pptx), OpenDocument Presentation (.odp), Serialized Presentation)\n- ... and lots of other things!\n\n### Requirements\n\nPHPPresentation requires the following:\n\n- PHP 7.1+ \n- [ZIP Extension](http://php.net/manual/en/book.zip.php)\n- [XML Parser Extension](http://www.php.net/manual/en/xml.installation.php)\n- [XMLWriter Extension](http://php.net/manual/en/book.xmlwriter.php) (optional, used to write DOCX and ODT)\n- [GD Extension](http://php.net/manual/en/book.image.php)\n\n### Installation\n\n#### Composer method\n\nIt is recommended that you install the PHPPresentation library [through composer](http://getcomposer.org/). To do so, add\nthe following lines to your ``composer.json``.\n\n```json\n{\n    \"require\": {\n       \"phpoffice/phppresentation\": \"dev-master\"\n    }\n}\n```\n\n#### Manual download method\n\nAlternatively, you can download the latest release from the [releases page](https://github.com/PHPOffice/PHPPresentation/releases).\nIn this case, you will have to register the autoloader.\n(Register autoloading is required only if you do not use composer in your project.)\n\n```php\nrequire_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php';\n\\PhpOffice\\PhpPresentation\\Autoloader::register();\n```\n\nYou will also need to download the latest PHPOffice/Common release from its [releases page](https://github.com/PHPOffice/Common/releases).\nAnd you will also have to register its autoloader, too.\n\n```php\nrequire_once 'path/to/PhpOffice/Common/src/Common/Autoloader.php';\n\\PhpOffice\\Common\\Autoloader::register();\n```\n\n## Getting started\n\nThe following is a basic usage example of the PHPPresentation library.\n\n```php\n// with your own install\nrequire_once 'src/PhpPresentation/Autoloader.php';\n\\PhpOffice\\PhpPresentation\\Autoloader::register();\nrequire_once 'src/Common/Autoloader.php';\n\\PhpOffice\\Common\\Autoloader::register();\n\n// with Composer\nrequire_once 'vendor/autoload.php';\n\nuse PhpOffice\\PhpPresentation\\PhpPresentation;\nuse PhpOffice\\PhpPresentation\\IOFactory;\nuse PhpOffice\\PhpPresentation\\Style\\Color;\nuse PhpOffice\\PhpPresentation\\Style\\Alignment;\n\n$objPHPPowerPoint = new PhpPresentation();\n\n// Create slide\n$currentSlide = $objPHPPowerPoint-\u003egetActiveSlide();\n\n// Create a shape (drawing)\n$shape = $currentSlide-\u003ecreateDrawingShape();\n$shape-\u003esetName('PHPPresentation logo')\n      -\u003esetDescription('PHPPresentation logo')\n      -\u003esetPath('./resources/phppowerpoint_logo.gif')\n      -\u003esetHeight(36)\n      -\u003esetOffsetX(10)\n      -\u003esetOffsetY(10);\n$shape-\u003egetShadow()-\u003esetVisible(true)\n                   -\u003esetDirection(45)\n                   -\u003esetDistance(10);\n\n// Create a shape (text)\n$shape = $currentSlide-\u003ecreateRichTextShape()\n      -\u003esetHeight(300)\n      -\u003esetWidth(600)\n      -\u003esetOffsetX(170)\n      -\u003esetOffsetY(180);\n$shape-\u003egetActiveParagraph()-\u003egetAlignment()-\u003esetHorizontal( Alignment::HORIZONTAL_CENTER );\n$textRun = $shape-\u003ecreateTextRun('Thank you for using PHPPresentation!');\n$textRun-\u003egetFont()-\u003esetBold(true)\n                   -\u003esetSize(60)\n                   -\u003esetColor( new Color( 'FFE06B20' ) );\n\n$oWriterPPTX = IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007');\n$oWriterPPTX-\u003esave(__DIR__ . \"/sample.pptx\");\n$oWriterODP = IOFactory::createWriter($objPHPPowerPoint, 'ODPresentation');\n$oWriterODP-\u003esave(__DIR__ . \"/sample.odp\");\n```\n\nMore examples are provided in the [samples folder](samples/). You can also read the [Developers' Documentation](https://phpoffice.github.io/PHPPresentation/) and the [API Documentation](https://phpoffice.github.io/PHPPresentation/docs/) for more detail.\n\n## Contributing\n\nWe welcome everyone to contribute to PHPPresentation. Below are some of the things that you can do to contribute:\n\n- Read [our contributing guide](https://github.com/PHPOffice/PHPPresentation/blob/master/CONTRIBUTING.md)\n- [Fork us](https://github.com/PHPOffice/PHPPresentation/fork) and [request a pull](https://github.com/PHPOffice/PHPPresentation/pulls) to the [develop](https://github.com/PHPOffice/PHPPresentation/tree/develop) branch\n- Submit [bug reports or feature requests](https://github.com/PHPOffice/PHPPresentation/issues) to GitHub\n- Follow [@PHPOffice](https://twitter.com/PHPOffice) on Twitter\n","funding_links":[],"categories":["目录","Table of Contents","PHP","Office Office","php","类库"],"sub_categories":["办公 Office","Office"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPHPOffice%2FPHPPresentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPHPOffice%2FPHPPresentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPHPOffice%2FPHPPresentation/lists"}