alin19 Posted December 17, 2008 Share Posted December 17, 2008 i have this code that generates an pdf file; if i add another cell after those 10 when i try to view my page i get a message like this: file does not begin with '%PDF-'. what is the reason for this? <?php include ('db.php'); include ('pdf/fpdf.php'); $conn=new db(); $conn->open(); class pdf extends FPDF { function header() { $this->SetFillColor(255,200,0); $this->SetTextColor(0); $this->SetDrawColor(0,0,0); $this->SetLineWidth(0.2); $this->SetFont('Times','B',; $this->Cell(7,30,'Crt',1,0,'L',1); $this->Cell(25,30,'Cod client',1,0,'L',1); $this->Cell(25,30,'Suma in cont '."\t".'la inceputulperioadei de raportare',1,0,'L',1); $this->Cell(25,15,'Stornari rezultatele lunii anterioare',1,0,'L',1); $this->Cell(25,15,'Rezultat curent relativ',1,0,'L',1); $this->Cell(25,15,'Rezultat curent efectiv la data scadentei',1,0,'L',1); $this->Cell(25,15,'Prime optiuni',1,0,'L',1); $this->Cell(25,15,'Operatiuni Financiare',1,0,'L',1); $this->Cell(25,15,'Comision',1,0,'L',1); $this->Cell(25,30,'Impozit pe tranzactii la ',1,0,'L',1); } } $pddf=new pdf('L'); $pddf->SetAutoPageBreak(true); $pddf->SetMargins(10,10,10); $pddf->SetDisplayMode('real','single'); $pddf->header(); $pddf->output(); ?> Link to comment https://forums.phpfreaks.com/topic/137358-solved-fpdf-problem/ Share on other sites More sharing options...
Mchl Posted December 17, 2008 Share Posted December 17, 2008 Probably a PHP error resulting in outputting an error message before any PDF file is output. View the resulting file in notepad (or other text editor) and see if there's an error message (and what it says) Link to comment https://forums.phpfreaks.com/topic/137358-solved-fpdf-problem/#findComment-717691 Share on other sites More sharing options...
alin19 Posted December 17, 2008 Author Share Posted December 17, 2008 solve it Link to comment https://forums.phpfreaks.com/topic/137358-solved-fpdf-problem/#findComment-717695 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.