Hello,

I am generating barcodes for products stored in MySQL and I am generating a pdf file with all the barcodes on one page. I am using http://www.fpdf.org/ with the Code 128 extension.

Just for reference, this is the pattern I am trying to accomplish http://i.imgur.com/bzIlgda.jpg

Each label has a X and Y coordinate, so based on the current product, I need to calculate them.

Each product information which is on the same row has the same Y.

The example above is done with this code http://pastie.org/9325664

Doing the example manually created a pattern in the values of the YX for each label, but I can’t understand how to calculate them inside a loop.

Basically, after fetching the products from the DB, I will iterate each of them and calculate the coordinates, but I am stuck.

If the question is unclear please reply and I will try to explain the best I can.

Thank you.