tsv2013/open-document-generator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tsv2013/open-document-generator

Composer 安装命令:

composer require tsv2013/open-document-generator

包简介

README 文档

README

PHP Composer

Open Document Generator library

Allows to create and store an ODT file. Supports:

  • headers
  • paragraphs
  • tables
  • tables of content
  • styles: text, paragraph, table cell, table column

Requirements:

  • zip library enabled in php.ini file
extension=zip

Sample usage

ODT file minimal creation code:

$fileName = dirname(__FILE__) . "/document1.odt";
$docFile = new ODFile($fileName);
$document = $docFile->document;
$document->add_heading("Test heading");
$document->add_para("Lorem ipsum");

$docFile->create();

ODS file minimal creation code:

$fileName = dirname(__FILE__) . "/document1.ods";
$docFile = new ODFile($fileName);
$document = $docFile->document;

$table = new ODTable([10, 7]);
$document->add($table);

$row = $table->create_row();
$row->add_cell_with_text("Column 1");
$row->add_cell_with_text("Column 2");
$row = $table->create_row();
$row->add_cell_with_text("val 1");
$row->add_cell_with_text("val 2");

$docFile->create();

See also

https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html

https://getcomposer.org/doc/articles/scripts.md

https://www.php.net/manual/en/function.xml-parse.php

https://www.php.net/manual/en/function.xml-parse-into-struct.php

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-22