Jump to content

Pdf problem?


divadiva

Recommended Posts

Experts,

 

I have a pdf form.It doesnot display one field (from_address full data) right.It just displays part of it.

 

Actuall address:Room XYZ Beverly Hills 100-107 Lockdown Road,california
PDF is displaying:Room XYZ Beverly Hills 100-107 Lockdown Road(Its truncating california for some reason)

 

Here is the code:


$pdf=new PDF();
$pdf->AliasNbPages(); 
$pdf->AddPage();
$tmp=new PDF();
$tmp->AddPage();

// contact
$from_addr = address5($q_row['from_addr']);
$pdf->Ln();
$pdf->SetFillColor(213,234,249);

$pdf->SetFont($ft,'B',$fs);
$pdf->Cell(20,$lh,'Contact:',0,0,'L',1);
$pdf->SetFont($ft,'',$fs);

//from address
$pdf->Cell(70,$lh,$from_addr[0],0,0,'L',1);
$pdf->SetFont($ft,'B',$fs);



//from address2 
$pdf->Cell(70,$lh,$from_addr[1],0,0,'L',1);
$pdf->SetFont($ft,'B',$fs);


//from address2

if($from_addr[2]) {
$pdf->Cell(20,$lh,'',0,0,'L',1);
$pdf->Cell(70,$lh,$from_addr[2],0,1,'L',1);
}
//from address 3
if($from_addr[3]) {
$pdf->Cell(20,$lh,'',0,0,'L',1);
$pdf->Cell(70,$lh,$from_addr[3],0,1,'L',1);
}
//from address 4
if($from_addr[4]) {                                                 //from_address doesnt display right?
$pdf->Cell(20,$lh,'',0,0,'L',1);
$pdf->Cell(70,$lh,$from_addr[4],0,1,'L',1);
}


 

My guess is something is wrong with the length .

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/143642-pdf-problem/
Share on other sites

Experts ,

 

I am here again with my weird problem.

All I want is to add a linebreak(sort of) from the data coming from mysql.

 

So far I have :

$pdf->SetFont(7,'Arial',3.5);//canot chnage this because it is a standard format.
$pdf->Cell(70,$lh,nl2br($from_addr[0]),'0',0,'L',1); Tried line break(nl2br)

I get this :
Room XYZ Beverly Hills 100-107 Lockdown Road

Where as I want
Room XYZ Beverly Hills 100-107 Lockdown Road,california ( California is truncated)


Ultimately I want my output like:
Room XYZ Beverly Hills 100-107 Lockdown Road
,california(there should be a new line)



 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/143642-pdf-problem/#findComment-753862
Share on other sites

How is the data stored/retrieved? Does it have the line break character with it?

 

Is this done by MySQL, or?

 

If it is done in MySQL, do you see the code like how you want it, or on one line? Please elaborate on that, I also do not know if this PDF class actually interprets HTML...?

Link to comment
https://forums.phpfreaks.com/topic/143642-pdf-problem/#findComment-753879
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.