Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shipping Label via PDF


gillamb

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);

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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