| layout | default |
|---|
The information needed for each sheet of labels is relatively basic and consists of a few values like:
- number of labels per row and column
- label size in inches (sorry)
- Left, top, right, and bottom page margins to get theouter edges of the grid aligned correctly (also inches)
- row and column spacing (also inches)
This information, as well as the user-facing name for each label template, is stored in assets/data/data.js
This is written mainly for Avery label sheets. The process should be mostly the same for other types of labels though.
- go to https://www.avery.com/templates and download a template for the label sheet you want to add support for (download both ms word format and PDF format, if available)
- open the template in the respective editing application (MS word or libreoffice, it shouldn't matter, I used libreoffice). Each cell of the table contains a box with rounded corners. Delete a few of them so you can see/click into cells of the underlying table
- Determine the following properties of the table:
- number of columns and rows that are intended for labels
- the width or height of any "extra" (i.e. not intended for labels, only spacing) rows/columns (you may need to click between labels to find these cells)
- the width and height of the label cells
- While still in the document determine what the top, left, bottom, and right page margins are using either the rulers on the top/sides of the page or your programs "document properties" or "page setup" menu
- Copy and paste an existing label template in the
assets/data/data.jsfile and change the name of the property where the configuration is stored to something that wont override anything other templates configuration. - Enter the values you found in the previous steps into this object.
At this point you are theoretically done. But your label template will still need to be tested.
- Prepare some label images to use for testing.
- This will likely require a custom size image because each label is likely to be a different size. You may be able to generate these using asset-labelmaker, but a dedicated image editor may be a better bet if you want to create your own test pattern and duplicate it a bunch of times.
- Be sure to set the width and height of your generated labels to something that makes sense for your labels. If you are unsure, multiply your label width and height values from earlier by 72 (pixels per inch) to convert them to pixels
- Be sure to generate enough test images to completely fill at least one sheet of labels.
- You may also want to ensure that the labels have some kind of marker going right up to the edge on all 4 sides. This will help you visually verify alignment later.
- use the website to generate some label sheets without borders
- validate that the labels in the generated PDF look approximately correct and save the PDF
- Use an online tool or command line command such as
pdfjam Avery6576DurableIDLabels.pdf 9zEhKPMq.pdf --outfile merged.pdf --nup "1x2" --noautoscale true --delta "0 -792pt" --papersize "{612pt, 792pt}"to take your generated label sheet and superimpose it on top of the PDF version of the template you downloaded eariler. If you got the order of the input files in the command right (or used an online tool) you should see the template overlaid on top of your generated label sheet. - Verify that the labels are correctly aligned. Be sure to check that the bottom-rightmost label is correctly aligned as slight errors in the layout/spacing/size measurements of each label can compound on themselves (this is why use of the border flag is not recommended)
- For the ultimate verification, print out the PDF that was generated by this webpage (although I guess you can also use the merged one) to verify that everything still lines up
Since I don't have the time or budget to make and test layouts for every kind of label, contributions of new layouts are much appreceated!
When you submit a pull request containing new label templates, try to include as much information about your testing as possible. This will help speed up the process of verifying and merging your changes and ideally includes:
- the PNG labels you were using as test input data (or just one if they all have identical contents)
- the .pdf and .doc that you downloaded from your label manufacturer
- the generated PDF that you downloaded from this tool
- the combined PDF you used to verify the alignment
- a clear photo of the physically printed version of your test sheet (if available)