既存のPDFファイルにウォーターマークを追加する必要があります。 私はfpdfとfpdiライブラリを使用しています。FPDFエラー:一部のデータはすでに出力されていますが、PDFファイルを送信できません。
私のコードは次のとおりです。
<?php
ob_start();
require('fpdf/fpdf.php');
require 'fpdi/fpdi.php';
$pdf = new FPDI();
$pdf->setSourceFile("Rabochaya_tetrad.pdf");
$tplIdx = $pdf->importPage(1, '/MediaBox');
$pdf->addPage();
$pdf->useTemplate($tplIdx, 0, 0, 0, 0, true);
$pdf->SetFont('Arial');
$pdf->SetTextColor(0, 0, 0);
$pdf->SetXY(58, 45);
$your_dynamic_content="file watermark";
$pdf->Write(0,$your_dynamic_content);
$pdf->Output();
ob_end_flush();
?>
私はそれを実行しようとすると、私はエラーを取得:
FPDF error: Some data has already been output, can't send PDF file
私はFPDF error: Some data has already been output, can't send PDFからすべてのアドバイスを試してみましたが、それは私を助けていませんでした。
あなたはこれらの問題について考えていますか?
問題を解決しましたか? – Sefran2