This guide provides an in-depth look at what QR codes are, how they work, and their various applications, helping you understand their importance and how to utilize them effectively with PDF Generator API.
A QR code consists of black squares arranged on a white background, forming a grid. These patterns encode data that can be read by QR code scanners or smartphones with built-in cameras. The data can include URLs, text, contact information, or other types of data that direct users to digital content or actions.
![](https://wp.pdfgeneratorapi.com/wp-content/uploads/2024/08/def78a74-334a-4052-8999-8da67af392d4.webp)
Creating QR Codes with PDF Generator API
PDF Generator API simplifies the creation and integration of QR codes into your documents. Here’s how you can leverage the API to generate QR codes:
Use the API to Create QR Codes: Utilize the API’s endpoint to create QR codes. Integrate QR Codes into your PDFs: Embed the generated QR codes into your PDF documents seamlessly. This is particularly useful for creating interactive documents, such as brochures, catalogs, and reports.
Tip 1: You can drag-drop a QR code component into your template and then assign a value to it. (for example your URL)
![](https://wp.pdfgeneratorapi.com/wp-content/uploads/2024/08/download-1-1-1024x881.png)
TIP 2: You can even Insert Data Field to QR code (for example {bank_details} )
![](https://wp.pdfgeneratorapi.com/wp-content/uploads/2024/08/download-2-1024x820.png)
TIP 3: After scanning the QR Code all the data will appear on your scanner or mobile phone.
Creating a pdf with multiple QR-codes
Creating a template
Firstly you need to create a template. You can watch how create a template more in details HERE. The template contains one container component which iterates over an array Line_Items. This will provide dynamic generation of QR-codes. Insert all data fields into the template using an example JSON data. You can obtain JSON data from your database or you can use our example JSON data below.
EDITOR
![](https://wp.pdfgeneratorapi.com/wp-content/uploads/2024/08/download-3.png)
Template EXPORT
You can use this JSON file to IMPORT the template into your account.
{"name":"OR CODE TEMPLATE","tags":[],"isDraft":false,"layout":{"format":"A4","unit":"cm","orientation":"portrait","rotation":0,"margins":{"top":0.8,"left":1.2,"right":1.2,"bottom":0.8},"emptyLabels":0,"width":21,"height":29.7,"repeatLayout":null},"pages":[{"width":21,"height":29.7,"conditionalFormats":[],"backgroundImage":null,"layout":[],"components":[{"id":"","top":0,"left":9.23,"width":9.29,"height":0.5,"zindex":1540,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"{shop::name}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":16,"fontType":["bold"],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":3.17,"left":0.03,"width":9.31,"height":0.34,"zindex":1544,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"SHIP TO","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":["bold"],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":3.65,"left":0.03,"width":9.31,"height":2.22,"zindex":1545,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"{shipping_receiver_fullname}\n{shipping_receiver_company}\n{shipping_address::address1}, {shipping_address::address2}\n{shipping_address::country}, {shipping_address::city}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":["bold"],"fontColor":"#474747","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":0.61,"left":9.23,"width":2.99,"height":0.4,"zindex":1546,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"ORDER","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":["bold"],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":1.01,"left":12.25,"width":6.32,"height":0.4,"zindex":1547,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"{date}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":["bold"],"fontColor":"#474747","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":6.83,"left":0,"width":6.01,"height":6.06,"zindex":1549,"phpClassName":"Reports_Component_Composite","className":null,"cls":"compositeComponent","name":null,"preview":null,"value":"","defaultValue":null,"dataIndex":"line_items","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":1,"borderColor":"#000000","borderStyle":"solid","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[{"type":"hide","format":{"fontSize":0,"color":"","fontStyle":{"bold":false,"italic":false,"underline":false,"strikethrough":false},"fontFamily":"","backgroundColor":"#ffffff","borderWidth":0,"borderColor":"#000000","borderStyle":"none"},"condition":{"match":"expression","search":"{row_index} > 6","dataIndex":""}}],"enableArrayFunctions":false,"whitespace":2,"allowRowSplit":true,"components":[{"id":"","top":5.16,"left":0.03,"width":5.98,"height":0.74,"zindex":1550,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"{vendor}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0.2,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":[],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":4.76,"left":4.52,"width":1.48,"height":0.37,"zindex":1550,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"× {quantity}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"center","fontSize":12,"fontType":["bold"],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":4.68,"left":0,"width":4.15,"height":0.45,"zindex":1550,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"{sku}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":["bold"],"fontColor":"#474747","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":3.78,"left":0.05,"width":5.95,"height":0.85,"zindex":1550,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"{description}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":["bold"],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":0,"left":0.71,"width":4.52,"height":0.42,"zindex":1550,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"Scan to Review","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":true,"fontFamily":"opensans","fontAlign":"center","fontSize":12,"fontType":[],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":0.42,"left":1.38,"width":3.15,"height":3.15,"zindex":1550,"phpClassName":"Reports_Component_QRCode","className":null,"cls":"qrcodeComponent","name":null,"preview":null,"value":"{product_id}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0.2,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":true,"text":false,"type":"QRCODE,L","autoIncreaseStep":0,"scaleText":false,"showText":false,"quietZone":false}],"sortBy":[],"sortDir":"ASC","filterBy":[],"groupBy":[],"iterateLeftToRight":true},{"id":"","top":6.16,"left":0,"width":6.01,"height":0.4,"zindex":1550,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"ITEMS","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#ffffff","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":["bold"],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":5.89,"left":0.02,"width":18.6,"height":0.13,"zindex":1556,"phpClassName":"Reports_Component_Line","className":null,"cls":"hlineComponent","name":null,"preview":null,"value":"","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":false,"bottom":false,"left":false},"borderWidth":3,"borderColor":"#000000","borderStyle":"solid","backgroundColor":"","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false},{"id":"","top":13.15,"left":0.03,"width":18.6,"height":0.13,"zindex":1557,"phpClassName":"Reports_Component_Line","className":null,"cls":"hlineComponent","name":null,"preview":null,"value":"","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":false,"bottom":false,"left":false},"borderWidth":3,"borderColor":"#000000","borderStyle":"solid","backgroundColor":"","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false},{"id":"","top":0.61,"left":12.25,"width":6.32,"height":0.4,"zindex":1558,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"{name}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":["bold"],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":1.01,"left":9.23,"width":2.99,"height":0.4,"zindex":1559,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"ORDER DATE","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":["bold"],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"},{"id":"","top":0.1,"left":0.16,"width":6.91,"height":1.85,"zindex":1566,"phpClassName":"Reports_Component_Barcode","className":null,"cls":"barcodeComponent","name":null,"preview":null,"value":" {order_number}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"#ffffff","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"text":true,"type":"C39","autoIncreaseStep":0,"scaleText":false,"showText":true,"quietZone":false},{"id":"","top":2.3,"left":0,"width":16.72,"height":0.87,"zindex":1462,"phpClassName":"Reports_Component_CustomText","className":null,"cls":"labelComponent","name":null,"preview":null,"value":"{tags}","defaultValue":null,"dataIndex":"","borderStatus":{"top":true,"right":true,"bottom":true,"left":true},"borderWidth":0,"borderColor":"#000000","borderStyle":"none","backgroundColor":"","useFlexHeight":true,"isEditable":false,"autoShrink":false,"isPlainHTML":false,"padding":{"top":0,"right":0.2,"bottom":0,"left":0},"conditionalFormats":[],"enableArrayFunctions":false,"fontFamily":"opensans","fontAlign":"left","fontSize":12,"fontType":[],"fontColor":"#000000","lineHeight":1.15,"textDirection":"ltr","textColumns":1,"dynamicFontSize":false,"fontValign":"top"}],"margins":{"right":1.2,"bottom":0.8},"border":false}],"dataSettings":{"sortBy":[],"filterBy":[],"transform":[]},"editor":{"heightMultiplier":1},"fontSubsetting":false,"barcodeAsImage":false}
Generating a pdf using our template
Now we can use this template to generate a pdf using POSTMAN application. You can follow this guide step by step on how to Make your first API v4 call with POSTMAN
Step 1
Create JWT in your ACCOUNT > SETTINGS and use it in Authentication as Bearer Token.
Step 2
Use template ID from your account and insert the body of the request. You can see an example payload below.
POSTMAN
![](https://wp.pdfgeneratorapi.com/wp-content/uploads/2024/08/download-4.png)
Example Payload for the API request
{
"template": {
"id": "1154510",
"data": {
"date": "2024-07-25",
"line_items": [
{
"sku": "ABC123",
"product_id": "1001",
"quantity": "2",
"vendor": "Vendor A",
"description": "Red T-shirt, Size M"
},
{
"sku": "DEF456",
"product_id": "1002",
"quantity": "1",
"vendor": "Vendor B",
"description": "Blue Jeans, Size 32"
},
{
"sku": "GHI789",
"product_id": "1003",
"quantity": "3",
"vendor": "Vendor C",
"description": "Black Sneakers, Size 10"
},
{
"sku": "JKL012",
"product_id": "1004",
"quantity": "4",
"vendor": "Vendor D",
"description": "White Hat, One Size"
},
{
"sku": "MNO345",
"product_id": "1005",
"quantity": "5",
"vendor": "Vendor E",
"description": "Green Hoodie, Size L"
},
{
"sku": "PQR678",
"product_id": "1006",
"quantity": "6",
"vendor": "Vendor F",
"description": "Yellow Scarf, One Size"
}
],
"name": "John Doe",
"order_number": "ORD12345678",
"shipping_address": {
"address1": "123 Main St",
"address2": "Apt 4B",
"city": "New York",
"province": "NY",
"zip": "10001",
"country": "USA"
},
"shipping_receiver_company": "Acme Corp",
"shipping_receiver_fullname": "Jane Smith",
"shop": {
"name": "BestShop"
},
"tags": "urgent, gift"
}
},
"format": "pdf",
"output": "url",
"name": "QR_codes"
}
Step 3
Hit the SEND button in order to send the API request. In this case the response will be URL (as we use “output”:”URL” in the payload). Now you can open your generated pdf and save it into your computer.
![](https://wp.pdfgeneratorapi.com/wp-content/uploads/2024/08/download-5.png)
Conclusion
Utilizing the PDF Generator API, you can effortlessly create and integrate QR codes into your documents, enhancing interactivity and user engagement. This tool streamlines the process of embedding QR codes, making it ideal for creating dynamic PDFs such as brochures, catalogs, and reports. By following simple steps to generate and incorporate these codes, you can efficiently direct users to relevant digital content, ensuring a seamless and effective communication strategy.
Integrate with Your Application
We have prepared integrations with several low-code platforms, such as Wix, Bubble, Airtable, and more. Please find the tutorials here. You can always consume our API using any programming language that supports HTTP requests; our API documentation, with code examples, is available here.