Jump to content

[SOLVED] fpdf problem


alin19

Recommended Posts

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',8);

 

 

$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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.