473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

please help with this fpdf label printing

1 New Member
Hi

I'm trying to write a label printing routine, but I'm not being too sucsessful. I'm hoping maybe someone who's used FPDF b4 can help me out?

Basically, I want to print labels from a data taken from a MySQL DB, but it doesn't output the labels properly. As soon as it gets to the bottom of the page, it kinda spans the bottom two labels across the two pages. How do I tell it to print the whole last label on the second page? I had a look at the docs, but can't seem to get anything that'll help me.

[PHP]
include_once("c lasses/fpdf.php");
define('FPDF_FO NTPATH','classe s/font/');




$pdf=new FPDF('P','mm',$ _GET['paper_size']);
$pdf->SetDisplayMode (fullpage);

$pdf->AddPage();

$pdf->SetFont('Arial ','B',12);
$pdf->SetAutoPageBre ak('on');
$pdf->SetTopMargin(0 );
$pdf->SetLeftMargin( 0);



$a = $row['name'];
$b = "Expires: ".$row['expire'];
$c = "Take ".$row['dosage'];
$d = "No ".$no." / Pages ".$pages;
$e = $_GET['l_gap']." / ".$_GET['t_gap']." / ".$_GET['width']." / ".$_GET['height'];

$width =$_GET['l_gap'];
$height =$_GET['t_gap'];


for($i=1; $i<$_GET['label_quantity ']; $i++) {
//$width = $width+$width+$ _GET['v_gap'];
$height = $Ypos+$_GET['h_gap'];

//First Column
$pdf->SetXY($width,$ height);
$pdf->MultiCell($_GE T['width'], $_GET['height']/10 ,$pdf->GetX()." / ".$pdf->GetY(). " ".$a."\n".$b."\ n".$c."\n".$d." \n".$e." #".$i , 1,'L');
$Ypos = $pdf->GetY();
//Second Column
//$pdf->SetXY($_GET['l_gap']+$_GET['width']+$_GET['v_gap'],$height);
//$pdf->MultiCell($_GE T['width'], $_GET['height']/10 ,$pdf->GetX()." / ".$pdf->GetY(). " ".$a."\n".$b."\ n".$c."\n".$d." \n".$e." #".$i , 1,'L');

}


$pdf->Output();[/PHP]

My other problem, which I don't know howto address yet, is how would I be able to print a few labels next to each other?

tia :)
Attached Files
File Type: pdf output_labels.pdf (3.9 KB, 1205 views)
Dec 22 '05 #1
2 7148
azang
3 New Member
I think you can simply adjust the space between the labels. i.e. use $pdf->Ln(5);

[link removed]
Sep 13 '07 #2
Weisbartb
36 New Member
I actually just wrote a major application using this. Its very useful but also has a lot of short comings.
Since your data is not dynamically changing in lines you probably can just use the addPage() function from fpdf after the 8th item is printed. This class is not an easy one to use.
Sep 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1680
by: john young | last post by:
when settingup a label report in access using the wizard the resulting previw and print out is not as it should be .... example is using Avery labels(or any other). 24 to page ...3col by 8 rows... only 7 rows display.... Q. 1.. how can this be overcome to display correct number of rows..... and 2.. if one edits the report/label to change...
2
1412
by: woodensails | last post by:
I have a table with multi objects among which are surname and spouse. This is part of a membership list, I would like to print membership cards for member and spouse. No problem doing separate runs, but would like to print all in one run. Suggestions please Lyn
0
1120
by: Gregg | last post by:
Hi All, I have an app that I have written that reads a text file into a SQL database, and then uses that database to generate a variety of mailing labels. All of my laser label formats work just fine, however I am having problems with my dot matrix format. I display a print preview of the labels before printing in a CrystalReportViewer....
4
3405
by: Wayne | last post by:
I have a simple database of addresses each with unique key and the user is able to create a table of selected keys and how many labels they need for each. The print program, using label counting techniques, shows, in print preview, the correct number of labels. When printed, though, the first keyed entry sometimes prints correctly with, say,...
1
1674
by: Simon Verona | last post by:
I have the requirement for address label printing within my software. I have a name and address list in a ado.net in-memory dataset - I'd like a pre-built software library which will display a number of label formats (eg Avery label formats) and then be able to mailmerge and print the labels. I'm willing to pay for a development licence for...
3
4525
by: Jlo | last post by:
Hi Gurus, I have a win forms appl in c#. I need to print out labels. What is the best way to do it. I dont want to write the labels to an RTF document and format it by using complicated Drawing functions. http://office.microsoft.com/en-us/templates/TC011832781033.aspx?CategoryID=CT101467671033 at the link does Avery mean anything?
1
1601
by: devphylosoff | last post by:
hey how to create the page which contains label, point and line which connecting this two items. and do above that user will be able to move the label moreover the line should also move with the label . sth like map with point and line from that to moveable label. any ideas ?
10
5927
by: fieldling | last post by:
I have set up a query and a report using label wizard so that I can print the address details of the current record when viewed on a form. This works fine until I actually need to print: The printer I'm using is an Epson LQ-300, printing on continuous-feed labels (Avery 4013's I think). The problem I've got is that the following text is...
25
7388
by: NDayave | last post by:
How do, I have a form that outputs addresses in a format that can be printed on to 3x7 label paper for envelopes. What I want is a way to enter blank (or " ") rows to the query result where the user specifies so no label is printed in that particular place. I am aware of the problems of inserting blank records to tables. I say this as the...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.