我正在创建一个web应用程序,并使用php FPDF脚本创建并打印出一个pdf。这也会在上传到应用程序的pdf图像上打印出来,这是没有问题的。然而,它需要为上传的pdf做同样的事情,这就是我的问题所在。如何使用fpdf将pdf打印为pdf内的图像?
我听说过imageMagick,但我不认为这是一个选择,因为它是一个软件,我不知道我应该在哪里运行它。
发布于 2014-06-02 14:38:56
您可以使用FPDI导入现有PDF文档的页面,并将其与FPDF一起放到新创建的页面上:
<?php
require_once('fpdf.php');
require_once('fpdi.php');
$pdf = new FPDI();
// load the document and get the total page count
$pageCount = $pdf->setSourceFile("the/document/you/want/to/import/a/page/from.pdf");
// import the first page
$tplIdx = $pdf->importPage(1);
// add a page
$pdf->AddPage();
// use the imported page on x=10, y=10 and a width of 90
$pdf->useTemplate($tplIdx, 10, 10, 90);
// output the PDF document
$pdf->Output();https://stackoverflow.com/questions/23944010
复制相似问题