divadiva Posted February 3, 2009 Share Posted February 3, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/143642-pdf-problem/ Share on other sites More sharing options...
gevans Posted February 3, 2009 Share Posted February 3, 2009 Try with an address without a comma, it looks to me like it's splitting the string at the comma... If that works try and find out when the string gets split Quote Link to comment https://forums.phpfreaks.com/topic/143642-pdf-problem/#findComment-753690 Share on other sites More sharing options...
gevans Posted February 3, 2009 Share Posted February 3, 2009 Also on this line; $from_addr = address5($q_row['from_addr']); what is the function address5() doing?? Can you post the code? Quote Link to comment https://forums.phpfreaks.com/topic/143642-pdf-problem/#findComment-753692 Share on other sites More sharing options...
divadiva Posted February 3, 2009 Author Share Posted February 3, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/143642-pdf-problem/#findComment-753862 Share on other sites More sharing options...
premiso Posted February 3, 2009 Share Posted February 3, 2009 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...? Quote Link to comment https://forums.phpfreaks.com/topic/143642-pdf-problem/#findComment-753879 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.