writers.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .. _writersreaders:
  2. Writers
  3. =======
  4. ODPresentation
  5. --------------
  6. The name of the writer is ``ODPresentation``.
  7. .. code-block:: php
  8. $oWriter = IOFactory::createWriter($oPhpPresentation, 'PowerPoint2007');
  9. $oWriter->save(__DIR__ . '/sample.pptx');
  10. PowerPoint2007
  11. --------------
  12. The name of the writer is ``PowerPoint2007``.
  13. .. code-block:: php
  14. $oWriter = IOFactory::createWriter($oPhpPresentation, 'PowerPoint2007');
  15. $oWriter->save(__DIR__ . '/sample.pptx');
  16. You can change the ZIP Adapter for the writer. By default, the ZIP Adapter is ZipArchiveAdapter.
  17. .. code-block:: php
  18. use PhpOffice\Common\Adapter\Zip\PclZipAdapter;
  19. use PhpOffice\Common\Adapter\Zip\ZipArchiveAdapter;
  20. $oWriter = IOFactory::createWriter($oPhpPresentation, 'PowerPoint2007');
  21. $oWriter->setZipAdapter(PclZipAdapter);
  22. $oWriter->save(__DIR__ . '/sample.pptx');
  23. Serialized
  24. ----------
  25. The name of the writer is ``Serialized``.
  26. .. code-block:: php
  27. $oWriter = IOFactory::createWriter($oPhpPresentation, 'Serialized');
  28. $oWriter->save(__DIR__ . '/sample.phppt');
  29. You can change the ZIP Adapter for the writer. By default, the ZIP Adapter is ZipArchiveAdapter.
  30. .. code-block:: php
  31. use PhpOffice\Common\Adapter\Zip\PclZipAdapter;
  32. use PhpOffice\Common\Adapter\Zip\ZipArchiveAdapter;
  33. $oWriter = IOFactory::createWriter($oPhpPresentation, 'Serialized');
  34. $oWriter->setZipAdapter(PclZipAdapter);
  35. $oWriter->save(__DIR__ . '/sample.phppt');