Jump to content

FPDF help


Network_ninja

Recommended Posts

I would like to create a page in pdf format and I found it possible by using fpdf, but how would I create a page that looks something like this:

 

 

1          Flathead nails  3/4"                            1,170.00KG    @        60.00          70,200.00 

2          Drip edge using plain G.I sheet          3,304.00PCS  @        80.00        264,320.00

            4" x 8" x Ga. #24 including cutting

            and bending (as per drawing).

            requirements : 472 sheets

                      1 sheet = 7 pieces

3          Wall flashing using plain G.I sheet      712.00PCS      @      70.00          49,840.00

            4" x 8" x Ga. #24 including cutting

            and bending (as per drawing)

            requirements : 89 sheets

                      1 sheet = 8 pieces 

********************* NOTHING FOLLOWS *********************

 

 

I really need something like this that shows no border because borders are already pre printed. Before posting here I googled it first And found a code that would possibly create my concern but I found some problem of the code and I need some help to make this working.

 

Existing code:

<?php
require('fpdf/fpdf.php');

$pdf = new FPDF();
$pdf->AddFont('Bookman','','Bookos.php');
$pdf->AddPage();
$pdf->SetFont('Bookman','',14);

$x=16;
$y=26;

$width=30;
$height=35;
$leftmargin=16;

$content = "content";
//$content = "This is a very long content, this must goes to the next line. "; 
for ($r=0;$r<5;$r++){
for ($c=0;$c<6;$c++){	
	$pdf->SetY($y); //set pointer back to previous values
	$pdf->SetX($x);
	$x=$pdf->GetX()+$width;
	$y=$pdf->GetY();	
	$pdf->MultiCell($width,$height,$content,1,'L');
}
$y+=$height;
$x=$leftmargin;
$pdf->SetY($y);
}

$pdf->Output();
?>

 

 

There are two problems with this code:

1.) Only the first page is working well.

2.) It will not create a newline in each cell if the content is long....

 

 

Tnx in advance to everyone..... pls.....

Link to comment
Share on other sites

  • 2 weeks later...
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.