Skip to main content

Veritran Docs

[en] Print

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

[en] Parameter Configuration

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

[en] Function ID

[en] Register

[en] Value

110

1

[en] Input Registers

[en] Register

[en] Description

[en] Mandatory

[en] Value

390

[en] JSON with printing configurations

[en] Yes

[en] 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"
            }
        }
    ]
}
[en] Output Registers

[en] Register

[en] Description

[en] Value

112

[en] Call result

000

[en] NO_ERROR

001

[en] ERROR_INVALID_INPUT_JSON

002

[en] ERROR_ADDING_QR_LINE

003

[en] ERROR_ADDING_BARCODE_LINE

004

[en] ERROR_ADDING_IMAGE_LINE

005

[en] ERROR_ADDING_TEXT_LINE

006

[en] ERROR_INITIALIZING_PRINTER

007

[en] ERROR_STARTING_PRINTER

008

[en] ERROR_NO_LINES_TO_PRINT

009

[en] ERROR_INVALID_BASE64

010

[en] ERROR_PAPER_ENDED

011

[en] ERROR_PRINTER_LOW_TEMPERATURE

012

[en] ERROR_PRINTER_OVERHEAT

013

[en] ERROR_PRINTER_ BUFFER_OVERFLOW

014

[en] ERROR_PRINTER_LOW_VOLTAGE_PROTECTION

015

[en] ERROR_PRINTER_MOTOR_FAILED

016

[en] ERROR_PRINTER_FAIL_AUTOMATIC_POSITIONING

017

[en] ERROR_PRINTER_PAPER_JAM

018

[en] ERROR_PRINTER_NO_BLACK_MARK_FOUND

019

[en] ERROR_PRINTER_HEADER_LIFTED

020

[en] ERROR_PRINTER_CUTTER_IS_NOT_IN_PLACE

021

[en] ERROR_PRINTER_BUSY

022

[en] ERROR_PRINTER_HARDWARE

023

[en] ERROR_PRINTER_PAPER_ENDING

99

[en] ERROR_UNKNOWN