jord-jd/uxdm-pdf-destination 问题修复 & 功能扩展

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

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

jord-jd/uxdm-pdf-destination

最新稳定版本:v2.0.0

Composer 安装命令:

composer require jord-jd/uxdm-pdf-destination

包简介

PDF destination for the UXDM data migrator

README 文档

README

Build Status Coverage Status

The UXDM PDF destination allows you to migrate data into a PDF table.

Installation

To install the UXDM PDF destination, just run the following composer command.

composer require jord-jd/uxdm-pdf-destination

Creating

To create a new PDF destination, you must provide it with the file path of PDF file you wish to export data to. The first row of the PDF table will contain the field names.

The following example creates a PDF destination object, using a PDF file called users.pdf in the same directory.

$pdfFile = __DIR__.'/users.pdf';
$pdfDestination = new PDFDestination($pdfFile);

Custom Paper Size & Orientation

You can alter the PDF destination to output PDFs with a custom paper size and orientation. To do this, use the setPaperSize and setPaperOrientation methods of the PDF destination object, as shown below.

$destination->setPaperSize('A5');
$destination->setPaperOrientation('landscape');

HTML Prefix & Suffix

Internally, the PDF destination renders a basic HTML table into a PDF. If you wish to style the table, add a heading, or extra content, you can add a HTML prefix or HTML suffix.

An example of how to do this is shown below.

$htmlPrefix = '<h1>My Report</h1>
            <style>
                table { width: 100% }
                h1 { text-align: center; }
                th { text-transform: capitalize; text-align: center; } 
                th, td { margin: 0; border: 1px solid #000; }
            </style>';
$htmlSuffix = '<p>Created by UXDM</p>';

$destination->setHtmlPrefix($htmlPrefix);
$destination->setHtmlSuffix($htmlSuffix);

Assigning to migrator

To use the PDF destination as part of a UXDM migration, you must assign it to the migrator. This process is the same for most destinations.

$migrator = new Migrator;
$migrator->setDestination($pdfDestination);

Alternatively, you can add multiple destinations, as shown below. You can also specify the fields you wish to send to each destination by passing an array of field names as the second parameter.

$migrator = new Migrator;
$migrator->addDestination($pdfDestination, ['field1', 'field2']);
$migrator->addDestination($otherDestination, ['field3', 'field2']);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2026-02-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固