How to generate labels?
Labels - Different types
In document generation, labels are crucial in creating organized, customizable, and user-friendly outputs. Whether you’re generating invoices, contracts, reports, or any other document type, labels allow you to add clarity and structure by tagging fields with relevant information. At PDF Generator API, labels enhance the flexibility of templates by making it easier to identify, filter, and manipulate data elements within a document. In this post, we’ll explore the various types of labels, how they function, and how you can leverage them to streamline your document creation process and add precision to every generated PDF.
Regular labels
Regular labels are the most common type, often used for general organization and identification of documents. They typically mark fields or sections within a document, making it easy to organize and retrieve specific data points.
Examples:
“Name” and “Address” labels on forms to identify user information fields.
“Invoice Number” and “Due Date” labels on invoices for essential data points.
“Product Description” and “Price” labels on order forms to clarify individual items.
Sheet labels
Sheet labels are pre-cut, often adhesive labels printed on a single sheet, commonly used for batch labelling tasks, such as labelling products, shipping packages, or cataloguing files. They come in various configurations on the sheet, like full sheets or sheets with multiple smaller labels.
Examples:
Sheet labels are pre-cut, often adhesive labels printed on a single sheet, commonly used for batch labelling tasks, such as labelling products, shipping packages, or cataloguing files.
Return address labels for mailing.
File folder labels to organize office documents.
Product labels for retail items like boxes, bottles, or jars.
Avery labels
Avery labels refer to a specific brand known for its variety of label templates, often used for both business and personal needs. They are compatible with standard printers and can be customized for different label sizes and formats, making them versatile for tasks requiring standardization and quick setup.
Examples:
Avery 5160 (30 labels per sheet): Often used for address labels.
Avery 8167 (80 labels per sheet): Commonly used for return address labels.
Generating labels using the PDF Generator API
1. Create a template
When using the PDF Generator API, you must always first create a template using our web-based drag-and-drop editor. To get more information on how to work with our editor, we have prepared a useful tutorial for you.
To create a template for label generation, you first need to set up a page layout.
You can find the page layout in the top panel of the editor under File ---> Page setup.
The "Layout" option represents the size of the labels you want to generate. When creating labels, select the "Custom" option from the drop-down menu, where you can set the desired width and height of the labels. To create a template that will contain several labels, you need to check the "Repeat the layout on page" option. Below this option, you will then see the options "Page" and "Empty labels". From the drop down menu under "Page" choose the size of the page you want your labels to be generated on and leave "Empty labels" at 0. This option only allows you to set the number of labels you want to leave empty from the beginning of the page.
You can also set the "Unit" you want to use in the template or even set the "Rotation" of the generated page.
An important thing to set when creating multiple labels on one page is the margins. There are four margin options:
1. Top - the space between the top edge of the page and the top edge of the topmost label
2. Left - the space between the left edge of the page and the left edge of the leftmost label
3. Right - horizontal space between labels
4. Bottom - vertical space between labels
When you set your desired page layout, do not forget to confirm your changes with the "Apply" button. After saving the changes, you only need to create a label that suits your needs. The label appearance needs to be created only in the first label on the page, and the other labels will be automatically generated based on your data.
Example templates
We have prepared two templates for you that you can import to your account. To import a template, you need to create a new template in your account and go to File ---> Import. You can retrieve JSON dataset from your database to populate the template or use the example JSON dataset provided below.
Price label
You can download the Price Label template from here and import to editor using the File ---> Import option.
Example JSON dataset
[
{
"product":"Wireless Mouse",
"sku":"WM-001",
"price":25.99,
"code":"012345678912"
},
{
"product":"Bluetooth Headphones",
"sku":"BH-002",
"price":59.99,
"code":"012345671234"
},
{
"product":"USB-C Charging Cable",
"sku":"CC-003",
"price":12.49,
"code":"012345676789"
},
{
"product":"Mechanical Keyboard",
"sku":"MK-004",
"price":79.99,
"code":"012345678905"
},
{
"product":"Webcam 1080p",
"sku":"WC-005",
"price":49.99,
"code":"036000291452"
},
{
"product":"External Hard Drive 1TB",
"sku":"EH-006",
"price":89.99,
"code":"042100005264"
},
{
"product":"HDMI Cable",
"sku":"HC-007",
"price":15.99,
"code":"073905123082"
},
{
"product":"Laptop Stand",
"sku":"LS-008",
"price":29.99,
"code":"012547812039"
},
{
"product":"Portable SSD 512GB",
"sku":"PSSD-009",
"price":129.99,
"code":"633033039961"
},
{
"product":"Gaming Mouse Pad",
"sku":"GMP-010",
"price":19.99,
"code":"227354409963"
}
]
Template in Preview
Avery 5160
You can download the Avery 5160 template from here and import to editor using the File ---> Import option.
Example JSON dataset
[{"name":"John Doe","address_1":"123 Main Street","address_2":"Apt 4B","city":"Springfield","state":"IL","zip_code":"62701","country":"USA"},{"name":"Jane Smith","address_1":"456 Elm Street","address_2":"Suite 123","city":"Shelbyville","state":"IL","zip_code":"62565","country":"USA"},{"name":"Acme Corporation","address_1":"789 Industrial Park","address_2":"Suite 300","city":"Capital City","state":"IL","zip_code":"62702","country":"USA"},{"name":"Emily Johnson","address_1":"321 Oak Avenue","address_2":"Apt 1","city":"Metropolis","state":"IL","zip_code":"62960","country":"USA"},{"name":"Mark Brown","address_1":"654 Pine Road","address_2":"PO Box 123","city":"Gotham","state":"IL","zip_code":"62999","country":"USA"},{"name":"Anna Green","address_1":"123 Maple Street","address_2":"Apt 100","city":"Riverdale","state":"IL","zip_code":"60546","country":"USA"},{"name":"Tech Solutions","address_1":"456 Innovation Way","address_2":"Suite 250","city":"Crystal Lake","state":"IL","zip_code":"60014","country":"USA"},{"name":"Chris Miller","address_1":"789 Birch Road","address_2":"Unit 12","city":"Elgin","state":"IL","zip_code":"60120","country":"USA"},{"name":"Jessica Harris","address_1":"101 Cedar Drive","address_2":"Apt 6","city":"Peoria","state":"IL","zip_code":"61602","country":"USA"},{"name":"Global Trade LLC","address_1":"202 Commerce Street","address_2":"Floor 2","city":"Aurora","state":"IL","zip_code":"60505","country":"USA"},{"name":"Liam Scott","address_1":"303 Walnut Lane","address_2":"Suite 56","city":"Rockford","state":"IL","zip_code":"61107","country":"USA"},{"name":"Sophia White","address_1":"404 Willow Road","address_2":"Apt 2A","city":"Decatur","state":"IL","zip_code":"62521","country":"USA"},{"name":"Innovate Ltd.","address_1":"505 Progress Drive","address_2":"Suite 500","city":"Naperville","state":"IL","zip_code":"60540","country":"USA"},{"name":"David Clark","address_1":"606 Pineview Terrace","address_2":"Unit 6","city":"Champaign","state":"IL","zip_code":"61820","country":"USA"},{"name":"Rachel Wilson","address_1":"707 Cherry Circle","address_2":"Apt 7B","city":"Wheaton","state":"IL","zip_code":"60187","country":"USA"},{"name":"Vista Enterprises","address_1":"808 Visionary Road","address_2":"Suite 800","city":"Joliet","state":"IL","zip_code":"60431","country":"USA"},{"name":"Olivia Brown","address_1":"909 Chestnut Boulevard","address_2":"Unit 9","city":"Evanston","state":"IL","zip_code":"60201","country":"USA"},{"name":"Ethan Johnson","address_1":"111 Oakridge Drive","address_2":"PO Box 456","city":"Bloomington","state":"IL","zip_code":"61701","country":"USA"},{"name":"Karen Evans","address_1":"222 Redwood Lane","address_2":"Apt 5","city":"Arlington Heights","state":"IL","zip_code":"60004","country":"USA"},{"name":"Summit Corp","address_1":"333 Heights Road","address_2":"Suite 900","city":"Skokie","state":"IL","zip_code":"60076","country":"USA"},{"name":"Megan Lee","address_1":"444 Meadow Lane","address_2":"Unit 3","city":"Bolingbrook","state":"IL","zip_code":"60440","country":"USA"},{"name":"Jacob King","address_1":"555 Prairie Road","address_2":"Apt 15","city":"Carbondale","state":"IL","zip_code":"62901","country":"USA"},{"name":"Lauren Young","address_1":"666 Hilltop Avenue","address_2":"Floor 10","city":"Urbana","state":"IL","zip_code":"61801","country":"USA"},{"name":"Henry Brooks","address_1":"777 Lakeshore Drive","address_2":"Apt 20B","city":"Quincy","state":"IL","zip_code":"62301","country":"USA"},{"name":"Isabella Martin","address_1":"888 Riverview Road","address_2":"Suite 450","city":"Belleville","state":"IL","zip_code":"62226","country":"USA"},{"name":"Nate Walker","address_1":"999 Summit Street","address_2":"PO Box 200","city":"Granite City","state":"IL","zip_code":"62040","country":"USA"},{"name":"Optima Solutions","address_1":"1234 Horizon Road","address_2":"Floor 10","city":"Moline","state":"IL","zip_code":"61265","country":"USA"},{"name":"Sandra Hill","address_1":"1357 Vine Street","address_2":"Apt 2C","city":"Danville","state":"IL","zip_code":"61832","country":"USA"},{"name":"Edward Turner","address_1":"2468 Clover Road","address_2":"Suite 321","city":"Normal","state":"IL","zip_code":"61761","country":"USA"},{"name":"Cathy Ramirez","address_1":"3579 Spruce Lane","address_2":"Suite 101","city":"Alton","state":"IL","zip_code":"62002","country":"USA"}]
Template in Preview
2. Generate the document
Once you've created the template, the only step left is to generate the PDF document. You can learn more about how to generate a document using Postman in this article.
Postman allows you to easily test all the API endpoints without developing and coding.
Conclusion
Using the PDF Generator API for creating various types of labels offers a streamlined and flexible solution for businesses needing customizable, data-driven label generation. By leveraging template-based generation, users can design multiple types of labels—shipping labels, product tags, barcode labels, and more—tailored to their specific requirements. Businesses can not only save time and reduce human error but also enhance operational efficiency by creating visually appealing, standardized labels at scale. The added flexibility of dynamic data inputs makes the API ideal for a variety of applications, from e-commerce to manufacturing, making it an essential tool for modern, automated workflows. The list of platforms that can be integrated with the PDF Generator API along with tutorials can be found here.
If you have any questions, don’t hesitate to reach out to our support or sales team, arrange a call, or try our product free for the first month.
Updated on: 26/11/2024
Thank you!