【问题标题】:Print PDF file with variables from other file?打印带有其他文件变量的 PDF 文件?
【发布时间】:2015-09-12 08:13:02
【问题描述】:

我想知道是否可以打印 PDF 文件,并将其中的空白点替换为我从我的网站获得的变量,因此输出取决于变量的值等。

【问题讨论】:

    标签: php html pdf printing


    【解决方案1】:

    使用FPDF 做您需要的事情。

    但在这种情况下你必须知道你必须从头开始创建一个 pdf 文件并按照你想要的方式填写它。

    <?php
    require('fpdf.php');
    
    $pdf = new FPDF();
    $pdf->AddPage();    // add page to PDF
    $pdf->SetFont('Arial','B',16);    // Choose a font and size
    $pdf->Cell(40,10,'Hello World!');  // write anything to any line you want
    $pdf->Output("your_name.pdf");   // Export the file and send in to browser       
    ?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-18
      • 1970-01-01
      相关资源
      最近更新 更多