Current location: Hot Scripts Forums » Programming Languages » PHP » PDF Layout


PDF Layout

Reply
  #1 (permalink)  
Old 01-13-12, 06:29 PM
kcorbishley kcorbishley is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 49
Thanks: 2
Thanked 0 Times in 0 Posts
PDF Layout

Hi everyone,
I hope this is in the right section. I need some help with PDF generation, I have ran into trouble with the layout.

Here is the code...
PHP Code:

                    // appends ref number and creation date to title

                    
$last_table[0][0] = ucfirst(strtolower($title));
                    
$last_table[0][1] = $ref_id;
                    
$last_table[1][0] = "Date";
                    
$last_table[1][1] = $creation;
                    
                    
                    if(
strlen($cust_forename) > && strlen($cust_surname) > 0){
                        
$cust_detals[0][0] = 'Full name ';
                        
$cust_detals[0][1] = $cust_forename ' ' $cust_surname;
                    }else{
                        
$cust_detals[0][0] = 'Full name ';
                        
$cust_detals[0][1] = 'Store order';
                    }
                    
                    if(
strlen($cust_company) > 0){
                        
$cust_detals[1][0] = 'Company ';
                        
$cust_detals[1][1] = $cust_company;
                    }else{
                        
$cust_detals[1][0] = 'Company';
                        
$cust_detals[1][1] = ' ';
                    }
                    
                    if(
strlen($cust_email) > 0){
                        
$cust_detals[2][0] = 'Address';
                        
$cust_detals[2][1] =  $cust_addr1 ', ' $cust_addr2;
                    }else{
                        
$cust_detals[2][0] = 'Address ';
                        
$cust_detals[2][1] = ' ';
                    }
                    
                    if(
strlen($cust_city) > && strlen($cust_county) > && strlen($cust_postcode) > ){
                        
$cust_detals[3][0] = '';
                        
$cust_detals[3][1] = $cust_city ', ' $cust_county ', ' $cust_postcode;
                    }else{
                        
$cust_detals[3][0] = ' ';
                        
$cust_detals[3][1] = ' ';
                    }
                    
                    if(
strlen($cust_telarea) > && strlen($cust_tel) > 0){
                        
$cust_detals[4][0] = 'Tel';
                        
$cust_detals[4][1] = $cust_telarea $cust_tel;
                    }else{
                        
$cust_detals[4][0] = 'Tel';
                        
$cust_detals[4][1] = ' ';
                    }
                    
                    
// Inserts customers details in pdf
                    
$pdf->Ln(5);
                    if(
is_array($cust_detals)){
                        
$pdf->no_header_table($cust_detals1060);
                    
$pdf->Ln(5);
                        
$pdf->Ln(5);
                        
$pdf->no_header_table($last_table1030);
                    } 
This is what it creates (the blank fields contain data, hope you get the picture from the code)...
current.png

If possible I would like it look like this...new.png
I dont mind if there is a column (cells would have to be hidden) between the customer details and ref&date table, kinda makin it one table. That is just an idea of how I think it could work, kinda creating it as one whole table.
I also need it so that the column widths are seperate and easily changed. At the moment in the customer details table the column width are joined, so this part of the code...
PHP Code:

$pdf->Ln(5);

                    if(
is_array($cust_detals)){
                        
$pdf->no_header_table($cust_detals1060); 
...link the colums, if I change the 60 to 30 both colums change. I need make the widths seperate.

I really hope someone can help, I have spent about a week trying differen solutions and searchin online to get ideas but my mind is blank. I am probably just approaching it in the wrong way or over thinking the method of doing it.


Thanks to all in advance, hopefully someone can improve this code for me.



Regards,
KCorbishley

Last edited by kcorbishley; 01-13-12 at 06:33 PM.
Reply With Quote
  #2 (permalink)  
Old 01-16-12, 08:37 AM
alxkls alxkls is offline
Newbie Coder
 
Join Date: Nov 2011
Posts: 98
Thanks: 0
Thanked 9 Times in 9 Posts
Reply With Quote
  #3 (permalink)  
Old 01-17-12, 02:47 AM
kcorbishley kcorbishley is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 49
Thanks: 2
Thanked 0 Times in 0 Posts
Thanks

Thanks for your input. This is what Im using but just cant get my head around this bit which is unfortunate.
Thaks for the input, much appreciatd.

KCorbishley
Reply With Quote
  #4 (permalink)  
Old 03-13-12, 04:04 PM
Frement Frement is offline
Newbie Coder
 
Join Date: Jul 2010
Posts: 19
Thanks: 0
Thanked 1 Time in 1 Post
I would have appreciated an example code, which would reproduce the problem, and be fully functional.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The United States Of China job0107 The Lounge 7 06-24-11 09:22 PM
PDF Generation using PDFLIB raji20 PHP 0 11-29-06 01:17 AM


All times are GMT -5. The time now is 09:00 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.