Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.