定制 programic/html2docx 二次开发

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

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

programic/html2docx

Composer 安装命令:

composer require programic/html2docx

包简介

Convert html to docx

README 文档

README

Met deze package kun je HTML converteren naar Word, ODText, RTF en PDF.

Gebruik

Om deze package te gebruiken, installeer je de package via composer.

In je composer.json:

{
  "require": {
    "programic/html2docx": "^1.0"
  }
}

In je code:

<?php

use Programic\Html2Docx\Docx;

$docx = new Docx($settings);
$docx->setContent($content);
$docx->save($location, $writerInterface='Word2007');

Settings

'base_root' => url('/'), // Required for link elements - change it to your domain.
'base_path' => base_path(), // Path from base_root to whatever url your links are relative to.

'current_style' => ['size' => '11'], // The PHPWord style on the top element
'parents' => [0 => 'body'], // Our parent is body.
'list_depth' => 0, // This is the current depth of any current list.
'context' => 'section', // Possible values - section, footer or header.
'pseudo_list' => true, // NOTE: Word lists not yet supported (TRUE is the only option at present).
'pseudo_list_indicator_font_name' => 'Wingdings', // Bullet indicator font.
'pseudo_list_indicator_font_size' => '7', // Bullet indicator size.
'pseudo_list_indicator_character' => 'l ', // Gives a circle bullet point with wingdings.
'table_allowed' => true, // Tables cannot be nested in PHPWord.
'treat_div_as_paragraph' => true, // If set to TRUE, each new div will trigger a new line in the Word document.

// This is an array (the "style sheet")
'style_sheet' => [], // check hasStyles trait for options

Writer Interface

De writerInterface geeft door naar welk formaat we de html gaan omzetten. De mogelijkheden zijn:

  1. Word2007
  2. ODText
  3. RTF
  4. PDF

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2021-05-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固