How to print barcode label on normal printer

Sometimes it happens when you need print out bar-code labels but you cannot. It can happens due to various reasons, for example a printer was broken, problems with connection, etc. In this article I propose you a workaround. How to print barcode labels on normal printer. I have ZEBRA printers so and solution will be for them 🙂As you know, SAP generate spool with ZPL (Zebra Programming Language) code and it is not readable by normal people. Our task is to convert ‘special characters’ to normal text and barcods.

So lets go step by step:
Step 1. Print or re-print output. In this case i use transaction VL74

…select a line and Process (Shift+F2)

as a result you’ve got the system message

Step 2. Find a SAP Spool number which was generated (SP01 transaction) earlier.



Step 3. Download the Spool with Raw data (generated code in ZPL language) to PC.

you should receive a message with file name and folder

Step 4. Open the file and copy all text!!!
Step 5. Go to Online ZPL Viewer and generate your label

That’s it, you can save the label and print on a normal printer.

The Labelary has an API and you can automate the process as I did 😉
I created the batch file “generate_label.cmd” in the folder with the downloaded spool files:

@ECHO OFF
SET index=1
SET output_file=label.pdf

SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%f IN (*.txt) DO (
   SET file!index!=%%f
   ECHO !index! - %%f
   SET /A index=!index!+1
)

SETLOCAL DISABLEDELAYEDEXPANSION

SET /P selection="Select file by number:"

SET file%selection% >nul 2>&1

IF ERRORLEVEL 1 (
   ECHO "--> Invalid number selected. Press any key to Exit! <--"
   PAUSE
   EXIT /B 1
)

CALL :RESOLVE %%file%selection%%%

WHERE /q curl
IF ERRORLEVEL 1 (
    curl\curl.exe --request POST http://api.labelary.com/v1/printers/12dpmm/labels/4x6/0/ --form file=@%input_file% --header "Accept: application/pdf" > %output_file%
) ELSE (
    curl --request POST http://api.labelary.com/v1/printers/12dpmm/labels/4x6/0/ --form file=@%input_file% --header "Accept: application/pdf" > %output_file%
)

GOTO :EOF

:RESOLVE
SET input_file=%1
GOTO :EOF

EXIT

image_pdfimage_print

Leave a Comment