承接 fyre/pdf 相关项目开发

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

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

fyre/pdf

最新稳定版本:v3.0

Composer 安装命令:

composer require fyre/pdf

包简介

An PDF generation library.

README 文档

README

FyrePDF is a free, open-source PDF generation library for PHP.

Table Of Contents

Installation

Dependencies

  • Google Chrome

In Ubuntu:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

Using Composer

composer require fyre/pdf

In PHP:

use Fyre\Utility\Pdf;

Basic Usage

  • $source is a string representing the source URL or HTML file.
$pdf = new Pdf($source);

Create From HTML

Generate a Pdf from a HTML string.

$pdf = Pdf::createFromHtml($html);

Create From URL

Generate a Pdf from a URL or file path.

  • $url is a string representing the source URL or HTML file.
$pdf = Pdf::createFromUrl($url);

Methods

To Binary

Get the binary data.

$data = $pdf->toBinary();

Save

Save the pdf as a file.

  • $filePath is a string representing the file path.
$pdf->save($filePath);

Static Methods

Get Binary Path

Get the Chrome binary path.

$binaryPath = Pdf::getBinaryPath();

Get Timeout

Get the timeout.

$timeout = Pdf::getTimeout();

Set Binary Path

Set the Chrome binary path.

  • $binaryPath is a string representing the Chrome binary path.
Pdf::setBinaryPath($binaryPath);

Set Timeout

Set the timeout.

  • $timeout is a number representing the timeout.
Pdf::setTimeout($timeout);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-08