Free Support Forum -

Avery 5160 Labels Spacing Issue

Does anyone have sample code to accurately space Avery 5160 / 5162 labels using ASPose.PDF?

I’m having numerous issues with margins on the page and aligning eaching row of labels to print on the label in the same spot.

Reading other posts, I have created two additional columns in my labels for spacing. In that colum I’ve created a graph with a line of 72 high, thinking it would space the labels 1" apart. Unfortunately it doesn’t and they slowly creep onto other labels.

Additionally, printer margins automatically throw alignment off:

oPDF.PageSetup.PageWidth = 612

oPDF.PageSetup.PageHeight = 792

oPDF.PageSetup.Margin.Left = 2

oPDF.PageSetup.Margin.Right = 0

oPDF.PageSetup.Margin.Top = 25

oPDF.PageSetup.Margin.Bottom = 0

It was my understanding everything was based on 72 “units” per inch therefore a .5" margin at the top should be 37.5. If I change it to 37.5 then it appears to add this margin to that of the printer’s margin and pushes the labels down even further. The same is true for the left margin.

Any ideas?


Thank you for considering Aspose.

Sorry. I can’t exactly understand your problem. Can you please elaborate and send some example documents to me?

All you need to do is print a document on an HP Color Laser printer and a regular laser printer and you'll see the printing does not line up. Hold the two sheets of paper together and up to a light or window -- the margins are different because they're dependent on the printer's margins.

This causes a problem when printing on Avery 5160 and 5162 labels because the text tends to "creep" down the label.

I guess I have two questions:

1. ASPose.PDF sets all margins and values in dpi (72 dpi)? Therefore 1" = 72 dpi ... if I measure that each label is exactly 1" in height then my spacer cells have a line with a height of 72. Unfortunately that isn't working -- manually adjusting things I have a line height of 76 to get the label height to work just about right. What I'm trying to understand is exact positioning so I can calculate positions of labels.

2. The PageSetup.Margin.Top is set but is this value in addition to the margin the printer requires? For instance, the printer requires .5" margin, which should be 37.5 (assuming 72 dpi) If I add a PageSetup.Margin.Top = 37.5 then will the printing begin at 1" on the physical printout?


Dear Chris,

Thank you for considering Aspose.

Aspose.Pdf sets all margins in point (default left and right margins are both 90 points and default top and bottom margins are both 72 points). But you can also use inch and cm, for example, “10cm” or “5inch”.

I am not familiar with printer. In Aspose.Pdf, the value of page margin is not in addition of the printer requires. The margin value is exactly the distance between the page edge and text.

Hi Tommy,

We are testing the word and pdf products. We use a word template for the 5160 labels and then output as pdf using the pdf product. The problem is that the mailing labes are printed at the absolute bottom of the label each time. Our customers will not accept this kind of alignment. Is this caused by the Red Evaluation text pushing down the labels and can it be adjusted by setting the top margins?

Thank you,


Dear Ken,

Can you please provide an example and let us check it?

Hi Tommy,

The problem that I mentioned yesterday was solved by changing some of the attributes during printing(centre & zoom) and scale.

Now the labels line up perfectly on the 1st page but pages 2 and beyond are shifted down 1 row. We are using the words product and the 5160 mailing label template and the writing the pdf.

Where should I send the document?



Dear Ken,

I have reproduced this error and I will try to fix it soon. If you are urgent, you can add a "page break" at the end of the first page as workaround (or set each section to begin at a new page). If you don't want to attach your example next time, you can send it to

Hi Tommy,

we tried the pagebreak but it didn't work. Could you send our original word template back with your change so we can test it.

Thank you,


Dear Ken,

I have sent the documents to your hotmail mail box.