arimac/fpdf 问题修复 & 功能扩展

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

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

arimac/fpdf

Composer 安装命令:

composer require arimac/fpdf

包简介

FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

关键字:

README 文档

README

This is a fork of official mirror of the FPDF library. We changed it to support streaming chunked data. You can avoid memory exceed errors by using this library.

Official FPDF Documentation

Installation with Composer

If you're using Composer to manage dependencies, you can use

$ composer require arimac/fpdf:^1.8

or you can include the following in your composer.json file:

{
    "require": {
        "arimac/fpdf": "^1.8"
    }
}

Usage

  • To download a file as a stream
<?php
require('fpdf.php');

$pdf = new FPDF();
$pdf->StartDownload('sales_report.pdf');
for($i=0; $i<100000; $i++) {
  $pdf->AddPage();
  $pdf->SetFont('Arial','B',16);
  $pdf->Cell(40,10,'Hello World!');
}
$pdf->Close();

Now FPDF will sending the generated data to the browser without waiting to finish the loop.

  • To present a preview of a file as stream
require('fpdf.php');

$pdf = new FPDF();
$pdf->StartPreview('sales_report.pdf');
for($i=0; $i<100000; $i++) {
  $pdf->AddPage();
  $pdf->SetFont('Arial','B',16);
  $pdf->Cell(40,10,'Hello World!');
}
$pdf->Close();

Same as above method. But it opening the generated PDF file insteed of downloading.

  • To directly write to a file
require('fpdf.php');

$pdf = new FPDF();
$pdf->StartFile('sales_report.pdf');
for($i=0; $i<100000; $i++) {
  $pdf->AddPage();
  $pdf->SetFont('Arial','B',16);
  $pdf->Cell(40,10,'Hello World!');
}
$pdf->Close();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固