In this video, you will learn how to use QR and barcodes in Centrldesk.
QR and barcodes are useful for many use cases, for example for marking documents or contracts and being able to uniquely identify them again later. In this example, we automatically create a document that contains a QR code and a barcode. So let's start building our application:
Steps:
- First, we go to the page editor by clicking on the Edit Page button.
- Add a button using drag and drop.
- Change the name of the button to "Create Document with QR and Barcode", and choose an icon and a color.
- With Centrldesk, you can easily customize your applications and graphical user interfaces to meet your needs.
- Next, we add an action to the button by clicking the "Add" function on the "On Click" event.
- The Flow Editor opens.
- On the left side, under Libraries, we now drag and drop the "File Processing" element into the center of the Flow Editor.
- The "File Processing" dialog opens.
- Select "Create QR-/Barcode" on the left side and confirm with OK.
- On the left side, under Libraries, we now drag and drop the "File Processing" element into the center of the Flow Editor.
- The "File Processing" dialog opens.
- Select "Create QR-/Barcode" on the left side and confirm with OK.
- On the left side, under App Components, we now drag and drop the "Document" element into the center of the Flow Editor.
- The "Use Document" dialog opens.
- Select "New Document", enter a name for the document, and confirm with OK.
- On the left side, under Libraries, we now drag and drop the "File Processing" element into the center of the Flow Editor.
- The "File Processing" dialog opens.
- Select "Convert to PDF" on the left side and confirm with OK.
- On the left side, under Libraries, we now drag and drop the "File Processing" element into the center of the Flow Editor.
- The "File Processing" dialog opens.
- Select "Download Files" on the left side and confirm with OK.
- Connect the upper output of the upper Create QR Code and Barcode block to the input of the Document block.
- Connect the lower output of the upper Create QR Code and Barcode block to the input of the Document block.
- Connect the output of the Document block to the input of the Convert to PDF block.
- Connect the output of the Convert to PDF block to the input of the Download Files block.
- Select the upper Create QR Code and Barcode block.
- Select a type on the right side, in our example Code-128.
- On the right side at Value select "Enter Value" and enter a value.
- Select the lower Create QR Code and Barcode block.
- Select a type on the right side, in our example QR Code.
- On the right side at Value select "Enter Value" and enter a value.
- Centrldesk offers a wide range of different barcodes for generation, for example, Code-39, Code-128, EAN, MSI, UPC, Pharmacode, or Codabar.
- Select the document and click Edit Document.
- The document editor opens.
- In order to use the barcodes queried earlier in our flow we need to create two variables.
- On the left side, click New under Variables.
- Enter a name, select "File" for the type, select the Input Checkbox, and confirm with OK.
- Now click the black arrow to use the variable content in your document.
- On the left side, click New under Variables.
- Enter a name, select "File" for the type, select the Input Checkbox, and confirm with OK.
- Now click the black arrow to use the variable content in your document.
- Then we can resize and align the images and customize our document if needed.
- Close the document editor by clicking Close in the upper left corner.
- Select the document block.
- Select Custom on the right side.
- Click on Edit Logic.
- Set the mode at the top from Autoconnect to Manual.
- Drag and drop the two barcode image blocks from the left side to the center of the Logic Editor.
- Connect the outputs of the barcode image blocks to the corresponding inputs of the document.
- Close the Logic Editor by clicking close in the upper right corner.
- Select the Convert to PDF block and give the file a name by selecting Enter Value under Filename on the right side and entering a file name.
- Select the Download Files block and choose the value "Converted PDF" under "Source One" on the right side.
- Close the Flow Editor by clicking close in the upper right corner.
- Close the Page Editor by clicking close in the upper left corner.
- Now we can start using our application.
- Clicking on the "Create Document with QR and Barcode" generates our document.
- The Downloads dialog with the automatically created PDF file is displayed.
- Clicking on the document will open the PDF with the generated QR Code and Barcode.