mabujo/pdf-helper 问题修复 & 功能扩展

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

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

mabujo/pdf-helper

最新稳定版本:1.0.4

Composer 安装命令:

composer require mabujo/pdf-helper

包简介

Utilities for working with ZendPdf

README 文档

README

Utilities for working with ZendPdf:

  • Text Measurement
  • Text wrapping into lines at closest length or specified characters

Sample Usage

<?php

use ZendPdf\PdfDocument;
use ZendPdf\Page;
use ZendPdf\Font;
use ZendPdf\Color\GrayScale;
use Ari\PdfHelper\Paragraph;

$pdf = new PdfDocument();

$page = new Page(Page::SIZE_A4);
$font = Font::fontWithName(Font::FONT_HELVETICA);
$gray = new GrayScale( 0.8 );

$page->setFont( $font, 8 );

$para = new Paragraph( $page, 2 /* line spacing */ );

$para->setDebug( true );
$para->setDebugLineColor( $gray );

$para->draw( $reallyLongTextUnicode, // default encoding assumes UTF-8
	20  /* x position */,
	780 /* y position */,
	240 /* paragraph width */ );

// You can customise the character encoding

$para->setStringFnByte( 'ISO-8859-1' );
$para->setStringFnMultiByte( 'UTF-16BE' );

// You can get the number of lines

$para->getLineCount();

// And the total height in points

$para->getHeight();

// ---

$pdf->pages[] = $page;

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-09-24