Control Chracters and Power Automate API

// Expert user has replied.
J Joel Lewis 1 year 11 months ago
14 8 0

Hello,
I am working with the Zebra API titled Barcode Generate where you can send parameters to Zebra from Microsoft's Power Automate to generate a barcode. One of my barcodes that I have to generate is a pdf417 and there is a requirement for control characters, particularly Group Separator, Record Separator, and End of Transmission. I have tried typing in "Alt" codes to generate a character but those don't work. I've tried putting things in brackets like and those don't work either. The API is taking any string of text literally as it's typed. I would like to know if there's a special way I can type/transmit something to the API so that it will create a pdf417 barcode with the control characters I need.

Thanks,
Joel

Please Register or Login to post a reply

8 Replies

S Sean Kennedy

Hi Joel.

Although I am not familiar with this API suite you refer to - there is two things you could try:
The ASCII lookup for GS for example is decimal 29, or 0x1D (hex) - and i am unsure of the common convention of using ~ddd or \ddd is usable.

ASCII to refer to for the decimal for GS / STX / ETX
https://www.rapidtables.com/code/text/ascii-table.html

Also this web link discussing similar data "map" separator components in PDF417 - here:
https://stackoverflow.com/questions/22374593/extracting-data-from-pdf41…

J Joel Lewis

Thank you for the quick reply PVT784. I have tried doing the decimal codes like you referred to in the first suggestion with no success. When I type them, I get characters like ↔▲♦ and those are not control characters. I appreciate the second link but I don't know how the discussion there would apply.

Everything I type and send via the API is coming over literally character for character and I am hoping there's possibly a sequence of characters, when typed, translate into those control characters.

I read on a Zebra forum that in Zebra software (not API) you can use things like or and the software translates those into the control characters, but when I try it with the API, it reads back literally as or instead of using the control characters. It would be great if there was already something built into the API when sent over would translate.

J Joel Lewis

I still do not have a resolution for this issue. If anyone could take another look into this, I would appreciate it. I just want to know how to input a a "code" or "series of characters" that translates to control characters, like Record Separator and Group Separator in the Barcode Generate API (Link below to the website I'm using)

https://developer.zebra.com/apis/barcode-generate#/Barcode%20Generator/…

S Steven Si

As suggested by PVT784, it looks like you need to create a string buffer and fill in with the corresponding hex values of the control characters in the ASCII at the desired positions in the buffer, and then pass the content of the string buffer to the API call. For example, the Group Separator (GS) is the 0x1D in hex on the ASCII table, which cannot be typed in as a readable character. Programmatically, however, the 0x1D can be inserted at the desired position in the string buffer and the content of the string buffer can be sent with the barcode generator API call.

J Joel Lewis

I apologize, not entirely sure what a "string buffer" is. Would you be able to tell me how to input the following text example and translate "RS" to record separator, "GS" to group separator, and "EOT" to end of transmission to the correct string that I need to type to get them to work with the Zebra Barcode Generator?

Example
"RS"08"GS"TEST"EOT"

S Steven Si

Here is the code snippet in Java to form a string with the control characters of your example.

final String RS  = Character.toString(0x1E); // Hex 0x1E for the Record Separator
final String GS  = Character.toString(0x1D); // Hex 0x1D for the Group Separator
final String EOT = Character.toString(0x04); // Hex 0x1D for the EOT

// The string to be sent to the barcode generator with the API for PDF-417 encoding
String strToEncode = RS + "08" + GS + "TEST" + EOT;

 

J Joel Lewis

I guess I'm still not sure how to put that java code into the Barcode Generator to work properly. Again, I'm working in this site:

https://developer.zebra.com/apis/barcode-generate#/Barcode%20Generator/…

The string portion is what I'm trying to get the control character to work in.

S Steven Si

The referred page is about the Barcode Generate API, which is supposed to be used in a program. The page gives the user an opportunity to try the API out without writing a program, however, the page itself has limitation for the user to input the non-printable control characters. I think you need to write a program that uses the Barcode Generate API for the control characters.

CONTACT
Can’t find what you’re looking for?