Give us feedback
zxing-services
Service icon

ZXing Services

Stable version 3.0.7 (Compatible with OutSystems 11)
Other versions available for 10 and Older
Uploaded on 26 October 2021 by 
4.7
 (24 ratings)
zxing-services

ZXing Services

Documentation
3.0.7

Instructions

For the following use cases, we will use a simple application with a screen to show the generated barcode as shown below.

Encode a barcode

The next steps will guide you on how to generate a barcode using one of the component's actions EncodeBarcode.

  1. The first step is to publish the component from the Forge. If you have a previous version consider updating it to the latest version.
  2. Create the application to test the component as explained above.
  3. Open the manage dependencies and check the ZXing Services components required for this example as shown in the image below.
  4. In the GetBarcode data action, create the logic to generate the barcode image and assign the resulting binary data to the output variable of the data action. For this example, we will use all the default values and only fill in the mandatory ones setting the Value for the barcode and the CodeId that identifies the type of barcode we want, in this case, a QR Code.
  5. Publish the application and test it.

Generate a QR Code for a calendar event

The next steps will guide you on how to generate a QR Code for a calendar event using one of the component's actions EncodeCalendarEvent.

  1. The first step is to publish the component from the Forge. If you have a previous version consider updating it to the latest version.
  2. Create the application to test the component as explained above.
  3. Open the manage dependencies and check the ZXing Services components required for this example as shown in the image below
  4. In the GetBarcode data action, create the logic to generate the barcode image and assign the resulting binary data to the output variable of the data action. For this example, we are creating a QR Code for NextStep'21.
  5. Publish the application and test it.

Generate a QR Code for a contact

The next steps will guide you on how to generate a QR Code for a contact using one of the component's actions EncodeContact.

  1. The first step is to publish the component from the Forge. If you have a previous version consider updating it to the latest version.
  2. Create the application to test the component as explained above.
  3. Open the manage dependencies and check the ZXing Services components required for this example as shown in the image below
  4. In the GetBarcode data action, create the logic to generate the barcode image and assign the resulting binary data to the output variable of the data action.
  5. Publish the application and test it.

Other scenarios

All other scenarios to create a QR Code are very similar to the previous ones explained above.

Share an email address

In the "Manage Dependencies" window choose the EncodeEmail action. This action takes as a mandatory parameter the email address to be shared. Optionally you can define the size of the QR code in pixels.

Share a GPS location

In the "Manage Dependencies" window choose the EncodeGeoLocation action. This action takes as mandatory parameters the latitude and longitude of the location. Optionally you can define the size of the QR code in pixels.

Share a phone number

In the "Manage Dependencies" window choose the EncodePhoneNumber action and the PhoneType static entity which will let you choose if you want to receive a phone call (default) or a facetime call. This action takes as a mandatory parameter the phone number to be shared. Optionally you can define the type of interaction (call or facetime) and the size of the QR code in pixels.

Send an SMS

In the "Manage Dependencies" window choose the EncodeSMS action. This action takes as mandatory parameters the phone number and the SMS text. Optionally you can define the size of the QR code in pixels.

Share a Wifi network

This example is a bit more complex but more similar to the contact example above. In the "Manage Dependencies" window choose the EncodeWifi action, the WifiData structure, and the AuthenticationType static entity. On the parameters of the action expand the WifiData parameter to fill in its attributes according to the Wifi network details, the only mandatory parameter is the SSID but others might need to be filled in to properly share the Wifi network connection details. Optionally you can define the size of the QR code in pixels.

Decoding a barcode from an image

The next steps will guide you on how to decode a barcode from an image using one of the component's actions DecodeBarcode. A similar outcome can be achieved with DecodeMultiBarcode, the only difference is that this action will try to identify all the barcodes from the image while the former will only return the first barcode identified.

  1. The first step is to publish the component from the Forge. If you have a previous version consider updating it to the latest version.
  2. Create the application to test the component. We need a screen with an Upload widget and a data action to decode the image.
  3. Open the manage dependencies and check the ZXing Services components required for this example as shown in the image below
  4. Make sure the FileUpload widget has a client action associated with the OnChange event, this would be the Upload1OnChange client action in the example above. The purpose of this client action is to refresh the data action that will decode the image.
  5. Let's move on to the Decode data action. Set the Fetch attribute to 'Only on demand' so that this action is only executed when a file is actually uploaded.
  6. Next, create the logic to decode the image as in the image below.
  7. Optionally you can fill in the FormatHint parameter if you know the format of barcode you are trying to decode, e.g. QR_CODE, or MAXICODE.
  8. Assign the DecodeBarcode action output to the output parameter of the data action which should be of type Barcode.
  9. Publish and test the application.