buona sera la prima volta che provo a creare un file pdf con php, ho scaricato la libreria
gratuita fpdf e copiata nella cartella del sito, se provo con il tutorial del programma funziona ma se cambio qualcosa non mi crea il file pdf ma una sequenza di caratte senza significato. chi mi aiuta?
ecco il codice e la sequenza di caratteri(risultato quando provo sul localhost)
<?php
require('../fpdf/fpdf.php');
class PDF extends FPDF
{
//Page header
function Header()
{
//Logo
$this->Image('../img/Pneumaticistore.jpg',10,8,33);
//Arial bold 15
$this->SetFont('Arial','B',15);
//Move to the right
$this->Cell(80);
//Title
$this->Cell(30,10,'Title',1,0,'C');
//Line break
$this->Ln(20);
}
//Page footer
function Footer()
{
//Position at 1.5 cm from bottom
$this->SetY(-15);
//Arial italic 8
$this->SetFont('Arial','I',8);
//Page number
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
//Instanciation of inherited class
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Times','',12);
for($i=1;$i<=40;$i++)
$pdf->Cell(0,10,'Printing line number '.$i,0,1);
$pdf->Output();
?>
%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream x}N@ E|K(j B"?""~ٰVָMtϵ1p;"܍LjPH0 *G Ju'hFfUd_jS_(_IBy\8/{8˴+r&(`>HyRX"*Z#'!b('%R &#%4`}XYG5"-RZW^]jbK X[5/mG]tI=nju_uq"I>_}ʌtakMI%[n:gk9d8hqN@=}O@ߧ}^Bw endstream endobj 5 0 obj <> endobj 6 0 obj <> stream x}=N1>x%LM%(l MFYx8ߛ#39z:c$(^(v pDž$bF01#k QqSaE_5sēWdQr'<qv8Ӏm+gedH j(C%1M)pD$a$W$8JCؒ!i `I_;Ħ8E )wM_ґubӗ`ut2 U8"_sX` 7 endstream endobj 1 0 obj <> endobj 7 0 obj <> endobj 8 0 obj <> endobj 9 0 obj <> endobj 2 0 obj << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI] /Font << /F1 7 0 R /F2 8 0 R /F3 9 0 R >> /XObject << >> >> endobj 10 0 obj << /Producer (FPDF 1.6) /CreationDate (D:20090307181145) >> endobj 11 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /FitH null] /PageLayout /OneColumn >> endobj xref 0 12 0000000000 65535 f 0000000905 00000 n 0000001301 00000 n 0000000009 00000 n 0000000087 00000 n 0000000487 00000 n 0000000565 00000 n 0000000998 00000 n 0000001099 00000 n 0000001197 00000 n 0000001425 00000 n 0000001501 00000 n trailer << /Size 12 /Root 11 0 R /Info 10 0 R >> startxref 1605 %%EOF