Purpose
You want to generate a bar code of a certain type using input data and display it on the SAP screen. In this example, the material number is displayed as a bar code, once as type CODE128 and once as QR code.

Solution
Create a new .NET classlibrary and use one of the many available open-source barcode-generators.

Here we use ZXing.Net. ZXing.Net is a port of ZXing, an open-source, multi-format 1D/2D barcode image processing library originally implemented in Java. It can be used in commercial products as it is published under the APACHE LICENSE, VERSION 2.0.

You can find it using the NuGet package manager in Visual Studio.
The public repository is available at github.com/zxing/zxing

You can download the project and the stand-alone classlibrary at the bottom of this page.


GuiXT Script:

// Generate the barcode

callvb r = barcoder.utilities.create_barcode _
 
text:="&F[Material]"  _
 
width:="400" height:="35" _
 
p_type:="CODE_128" _ 
 
file:="C:\temp\barcode.png" _
 
showText:="1"

  if V[r]   
 
// An error occured
 
message "E:&V[r]" -statusline       

else     

  // Show the barcode on the screen
 
Image            (3,30)  "C:\temp\barcode.png" _
   
-plain           -nostretch -nobuffer  -transparent 

endif 

// Generate the 2nd barcode

callvb r = barcoder.utilities.create_barcode _
 
text:="&F[Material]"  _
 
width:="200" height:="200" _
 
p_type:="QR_CODE" _ 
 
file:="C:\temp\barcode_2.png" _
 
showText:="0" 

if V[r]   

  // An error occured
 
message "E:&V[r]" -statusline       

else     

  // Show the barcode on the screen
 
Image            (12.5,1)           "C:\temp\barcode_2.png"       _
   
-plain           -nostretch -nobuffer       -transparent

  endif

 

Download:

Download the .NET project with source-code:
guixt_barcoder_source.zip

Download the stand-alone classlibrary:
guixt_barcoder_lib.zip

Hint: You might need to "unblock" downloaded .dll files if you want to use them:
Go to file properties (right-click) and choose "unblock".

Components InputAssistant + Controls