Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
gillamb

Shipping Label via PDF

Recommended Posts

I installed the above contribution fine, but the layout is not how I would like it.

 

Does anyone know how i can change the layout, I need to :-

 

Create a gap between the lines

Make the address fill the label (not like currently squashed up in the top!)

Make the Town and County appear on separate lines

 

Below is the code that i think is controlling this, but i can't see how to change the layout.

 

Any help much appreciated!

 

$postcode = tep_output_string_protected($address['postcode']);

$zip = $postcode;

$line1= "$firstname $lastname";

$line2= "$company";

$line3="$street";

$line4="$city" . ', ' . "$state ";

$line5="$zip";

$line6="$country";

define('FPDF_FONTPATH','font/');

require('fpdf.php');

$pdf=new FPDF('L','mm',array(54, 101));

$pdf->AddPage();

$pdf->SetXY('5', '3');

$pdf->SetMargins('0','0','0');

$pdf->SetFont('Arial','Bi',15);

$pdf->Cell(40,4,'',0,1);

$pdf->SetX('15');

$pdf->Cell(0,4,'Ship to:-',0,1);

$pdf->SetX(15);

$pdf->SetFont('Arial','',12);

$pdf->SetX(15);

$pdf->SetFont('Arial','',15);

$pdf->Cell(40,4,"$line1",0,4);

if($line2 != ''){

$pdf->Cell(40,4,"$line2",0,2);

}

$pdf->Cell(40,4,"$line3",0,2);

$pdf->Cell(40,4,"$line4",0,2);

if($line5 != 'United States'){

$pdf->Cell(40,4,"$line5",0,2);

//$pdf->Cell(40,4,"$line6",0,2);

Share this post


Link to post
Share on other sites

Some of the pdf stuff is a bit counter-intuitive. For example is you are working on a A4 page then the top right hand corner of the page is roughly co-ordinate (410, 590) and the bottom left hand corner is (0, 0). Some of the functions work with absolute positioning and others just move to the next line each time. See Batch Print Center for more examples.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×