paliari / fpdf

FPDF 是一个 PHP 类,允许使用纯 PHP 生成 PDF 文件。FPDF 中的 F 代表 Free:您可以使用它进行任何类型的用途,并根据需要对其进行修改。http://www.fpdf.org

0.0.8 2020-10-01 22:00 UTC

This package is auto-updated.

Last update: 2024-09-29 04:43:29 UTC


README

FPDF 是一个 PHP 类,允许使用纯 PHP 生成 PDF 文件。FPDF 中的 F 代表 Free:您可以使用它进行任何类型的用途,并根据需要对其进行修改。 http://www.fpdf.org

安装

composer require paliari/fpdf

使用

<?php
require __DIR__ . '/vendor/autoload.php';


$pdf = new \Fpdf\Fpdf();
$pdf->setFont('Arial');
$pdf->addPage();
$pdf->cell(190, 10, 'Batata frita', 1);

/**
* I: send the file inline to the browser.
* D: download.
* F: save to a local file with the name.
* S: return the document as a string.
*/
$pdf->output('I');