定制 dhutapratama/mydocx 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dhutapratama/mydocx

Composer 安装命令:

composer require dhutapratama/mydocx

包简介

MsOffice .docx templating, find and replace, merge, add an image for PHP

README 文档

README

PHP Library for merge, find some text and replace to text or image in docx document. Note that this library is never tested for OpenOffice format.

This library is downloaded from https://github.com/jupitern/docx since no update from Dec 2016. Issue are very welcome to report here.

Features

  • Find text and replace with text and image
  • Merge docx files on one file
Note : Merge document here is include new file into existing file and show as one document or existing page is not modified

Requirements

  • PHP 5.4 +

Installation

MyDocx is installed via Composer. To add a dependency to MyDocx in your project, either

Run the following to use the latest stable version

    composer require dhutapratama/mydocx

You can of course also manually edit your composer.json file

{
    "require": {
       "dhutapratama/mydocx": "v1.0.*"
    }
}

Getting started

Declaration

use Dhutapratama\MyDocx\Docx;

// Initialization
$myDocx = new Docx('/mydir/template.docx');

Replacing Header and/or Footer

$myDocx->setHeaderFooter(['text_to_find' => 'value to replace'])
  ->save();

Replacing Text

$myDocx->setText(['text_to_find' => 'value to replace'])
  ->save();

Replacing Image

$myDocx->setImage(['text_to_find' => '/your/image.png'])
  ->save();

Merge Files

$myDocx->setMerge(['/your/file1.docx', '/your/file2.docx'])
  ->save();

Replace and merge

$myDocx->setText(['text_to_find' => 'value to replace'])
  ->setImage(['text_to_find' => '/your/image.png'])
  ->setMerge(['/your/file1.docx', '/your/file2.docx'])
  ->save();

Contributing

Please report any issue or you can also help others to resolving issues by fork and requesting merge to master branch.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固