承接 phppdf/html-converter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

phppdf/html-converter

Composer 安装命令:

composer require phppdf/html-converter

包简介

Convert HTML and CSS into PDF documents on top of phppdf/phppdf

README 文档

README

Convert HTML and CSS into PDF documents on top of phppdf/phppdf.

Requirements

  • PHP 8.4+
  • ext-dom
  • ext-libxml

Installation

composer require phppdf/html-converter

Documentation

The documentation can be found here: https://phppdf.github.io/html-converter/

Quick start

use PhpPdf\Html\HtmlConverter;
use PhpPdf\Output\PdfMemoryOutput;
use PhpPdf\Serialization\PdfDocumentSerializer;

$html = '<h1>Hello World</h1><p>Welcome to the PDF.</p>';

$document = HtmlConverter::fromHtml($html)->build();

$output = new PdfMemoryOutput();
(new PdfDocumentSerializer($output))->writeDocument($document);

header('Content-Type: application/pdf');
echo $output->getContent();

Because HtmlConverter::fromHtml() returns a plain PdfDocumentBuilder, you can prepend or append pages, add metadata/encryption/signatures, and apply compression before serialising.

Examples

Working examples live in the examples repository: https://github.com/phppdf/examples

Development

composer install
composer phpunit
composer phpunit:coverage
composer phpcs
composer phpstan

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固