Sorry, my math was backwards (from memory), this is the real code we use: int left = labelSheet.left; int top = labelSheet.top;
for(int c=0;c<cols;c++){ for(int r=0;r<rows;r++){ g2.translate(left, top); paint(g2); g2.translate(-left, -top); top += (label.height + label.gutterY); } top = label.top; left += (label.width + label.gutterX); } Bill Ensley Bear Printing > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Bill > Ensley > Sent: Tuesday, June 28, 2005 8:47 AM > To: iText Mail Group > Subject: RE: [iText-questions] Mailing labels > > > Avery themselves have the measurements available, but > the best thing to do ( I think anyway, we use it everyday ) is > to use PdfGraphics2D and loop through the rows and cols > and translate the graphics object therefore not requiring > the knowledge of each x,y coordinate: > > int top = labelSheet.top; > int left = labelSheet.left; > for(int r=0;r<rows;r++){ > for(int c=0;c<cols;c++){ > g.translate(left, top); > doPaint(g); > top += label.height + label.gap; > } > left += label.width + label.gap > } > > This is very simple to implement if you know your label measurements. > > Bill Ensley > Bear Printing > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] Behalf Of Bruno > > Lowagie > > Sent: Tuesday, June 28, 2005 8:29 AM > > To: Jay Parashar > > Cc: 'itext-questions@lists.sourceforge.net' > > Subject: Re: [iText-questions] Mailing labels > > > > > > Jay Parashar wrote: > > > > >I wanted some helping in generating mailing labels (Avery 5260). > > Any idea, > > >code examples, how to achieve that? > > > > > Where can one find the specs of Avery Labels? > > I found sites selling the labels, describing the size of a label, > > but I didn't find the margins needed, etc... > > br, > > Bruno > > > > > > ------------------------------------------------------- > > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > > _______________________________________________ > > iText-questions mailing list > > iText-questions@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/itext-questions > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > iText-questions mailing list > iText-questions@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/itext-questions ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions