-2
I am trying to generate a PDF file using FPDF and a class "Code 128 barcodes" (found in fpdf.org > scripts > Code 128 barcodes).
The method Code128()
is inside the archive Code128.php in class class PDF_Code128 extends FPDF
However, when I try to use my code I get error in the page that this method is already being used and I cannot generate PDF.
Follow my code until then:
require("../fpdf/fpdf.php");
require("../fpdf/code128.php");
$pdf=new PDF_Code128();
$pdf->AddPage("L", array(54,86));
$pdf->AddFont('Univers','','univers.php');
$pdf->SetAutoPageBreak(false);
$pdf->Image("../img/modeloArquivo.png", 0, 0, 86, 54);
$nome='Teste';
$pdf->SetFont('Univers', '', '6');
$pdf->SetXY(28.8,17);
$pdf->Write(6, $nome);
$local='Teste';
$pdf->SetFont('Univers', '', '6');
$pdf->SetXY(28.8,23);
$pdf->Write(6, $local);
Check the require of your file and the classes, it seems that the Pdf_code128 class extends the FPDF class and may be calling some method twice.
– Leticia Rosa