Skip to main content

Veritran Docs

Print

This function enables printing images, texts and barcodes (QR or EAN) using the Smartpos thermal receipt printer.

Parameter Configuration

This function requires you to complete register 390 with the printing configurations in JSON format. Refer to the Input Registers section to learn more.

Function ID

Register

Value

110

1

Input Registers

Register

Description

Mandatory

Value

390

JSON with printing configurations

Yes

The JSON should be structured as in the following example:

{
    "printLines": [{
            "type": "IMAGE",
            "content": "#S{1001}",
            "graphicStyle": {
                "offset": 0
            }
        },
        {
            "type": "TEXT",
            "content": "COMERCIO:#S{2000}",
            "textStyle": {
                "align": "CENTER",
                "fontsize": "LARGE",
                "bold": true
            }
        },
        {
            "type": "IMAGE",
            "content": "#S{1001}",
            "textStyle": {
                "width": 100,
                "height": 50,
                "offset": 0,
                "align": "CENTER"
            }
        },
        {
            "type": "TEXT",
            "content": "COMERCIO:#S{2000}",
            "textStyle": {
                "align": "CENTER",
                "fontsize": "LARGE",
                "bold": true
            }
        },
        {
            "type": "TEXT",
            "content": "FECHA:#K{NOW:D} HORA:#K{NOW:T}",
            "textStyle": {
                "align": "CENTER",
                "fontsize": "MEDIUM",
                "bold": false
            }
        },
        {
            "type": "TEXT",
            "content": "DIRECCION:#S{2001}\n",
            "textStyle": {
                "align": "CENTER",
                "fontsize": "MEDIUM",
                "bold": false
            }
        },
        {
            "type": "TEXT",
            "content": "AUTORIZACION|TARJ\n#S{6001}|****#S{6002}\nVALOR RETIRO #S{6003:G}\n\n\n\n",
            "textStyle": {
                "align": "CENTER",
                "fontsize": "SMALL",
                "bold": false
            }
        },
        {
            "type": "QR",
            "content": "#S{1002}",
            "graphicStyle": {
                "height": 200,
                "offset": 0
            }
        },
        {
            "type": "BARCODE",
            "content": "#S{1005}",
            "graphicStyle": {
                "width": 400,
                "height": 80,
                "offset": 0,
                "align": "CENTER"
            }
        }
    ]
}
Output Registers

Register

Description

Value

112

Call result

000

NO_ERROR

001

ERROR_INVALID_INPUT_JSON

002

ERROR_ADDING_QR_LINE

003

ERROR_ADDING_BARCODE_LINE

004

ERROR_ADDING_IMAGE_LINE

005

ERROR_ADDING_TEXT_LINE

006

ERROR_INITIALIZING_PRINTER

007

ERROR_STARTING_PRINTER

008

ERROR_NO_LINES_TO_PRINT

009

ERROR_INVALID_BASE64

010

ERROR_PAPER_ENDED

011

ERROR_PRINTER_LOW_TEMPERATURE

012

ERROR_PRINTER_OVERHEAT

013

ERROR_PRINTER_ BUFFER_OVERFLOW

014

ERROR_PRINTER_LOW_VOLTAGE_PROTECTION

015

ERROR_PRINTER_MOTOR_FAILED

016

ERROR_PRINTER_FAIL_AUTOMATIC_POSITIONING

017

ERROR_PRINTER_PAPER_JAM

018

ERROR_PRINTER_NO_BLACK_MARK_FOUND

019

ERROR_PRINTER_HEADER_LIFTED

020

ERROR_PRINTER_CUTTER_IS_NOT_IN_PLACE

021

ERROR_PRINTER_BUSY

022

ERROR_PRINTER_HARDWARE

023

ERROR_PRINTER_PAPER_ENDING

99

ERROR_UNKNOWN