Skip to content

  • Documentation
    • Mobile App – Signatus
    • Web App – Signatus 2 API
    • Web App – OKdokument API
    • Web App – OKdokument
  • Contact Us

Customization – Wizard SDK

  • 1. What is a Wizard
  • 2. Introduction to Wizard Javascript API Calls
  • 2.1 Integration
  • 2.2 Document signing
  • 2.3 PDF Document Processing
  • 2.4 Device Features
  • 2.5 Files & Folders
  • 2.6 Application Features
  • 2.7 System Utilities
  • 3. Example: Simple process

Customization – PDF & Form Preparation

  • PDF Forms creation
  • 1. Tags
  • 2. Acrofields
  • 3. Sample document

Integration – REST API

  • 1. Introduction
  • 2. Download
  • 3. Upload

Integration – App-to-App

  • 1. Introduction
  • 2. How does it work?
  • 3. START-ACTIVITY-FOR-RESULT (APP – SIGNATUS – APP)
  • 4. Sending data to Master Wizard via Intent
  • 5. Runtime Configuration Parameters (Display, Fields, Signing Process)

Hardware

  • 1. Android
  • 2. iOS / iPadOS
  • 3. Windows

Signatus user manual

  • 1. Introduction
  • 2. Main menu
  • 3. Signing
  • 4. Submit signed document
  • 5. Settings in detail
  • 6. Example Wizard
View Categories
  • Home
  • Documentation
  • Mobile App - Signatus
  • Customization – Wizard SDK
  • 2.7 System Utilities

2.7 System Utilities

The System Utilities section provides common supporting functions used across the application.
It includes utilities for logging, alerts, and other shared system-level operations that do not belong to a specific functional domain.

These utilities help standardize behavior, improve observability, and simplify cross-cutting concerns within the system.

logD (Android, Windows, iOS) #

Logs the input text to a log file at the debug log level.

/**
 *
 * @param {string} text - The text to be logged.
 * @return {void} 
 */
function logD (text);

logE (Android, Windows, iOS) #

Logs the input text to a log file at the error log level.

/**
 *
 * @param {string} text - The text to be logged.
 * @return {void} 
 */
function logE (text);

setLogLevel (Android, Windows, iOS) #

Sets the level of wizard logger. Log level:

  • 3- debug
  • 6- error (default)

Note: The API allows to log events that happen in the wizard into the application log for possible debugging or auditing. The HTML wizard logs are created on daily basis in the following local (device storage) folder: \Android\data\com.anasoft.signatus.app\files\LogJS\{DATE}.log

/**
 * @param {int} level - The log level to be set.
 * @return {void}
 */
function setLoglevel (level);

sendLog (Android, Windows, iOS) #

Collects all Signatus application log files available on the device (stored in the Log folder), packages them into a ZIP file, and uploads the archive using a selected upload channel configured in the application settings. This allows users to easily send log files from the device through an action triggered in the wizard when troubleshooting is required.

Note: When using an MDM solution, logs can be collected automatically without requiring user interaction.

/**
 * @param {Object} arg- Parameter JSON object.
 * @returns {void} 
 */
function sendLog(arg);

Parameter description :

NameRequiredFormatDescription
channeltruestringName of the upload channel to use for uploading .
– LOG : By default log is send to the license server
calltruestringCallback function name
filenamefalsestringLog filename. Default is “Log_”
datafalseJSON Objectadditional data for the uploader in JSON format
docTypefalsestringIf “*” logcat is included to log zip file. Default value. Otherwise only application log is send
uploadfalseboolean– true (default value) : file is prepared for upload and uploader is called immediately
– false : file is only prepared for upload, the uploader can be started later using the ‘upload’ function

Example :

const arg = {
    "channel" : "LOG",
    "call" : "onSendLog"
};
sendLog(arg);

/**
 * callback function for sendLog function
 * @param res - result in string format
 */
function onSendLog(res) {
    const result = JSON.parse(res);
}

Result example :

{
	"parameter": {
		"status": "OK",
		"message": "",
		"data": true
	}
}

logAudit (Android) #

Adds a line to the audit log.

/**
 *
 * @param {string} text - The descriptive text for the audit log.
 * @param {number} code - A numerical code representing the audit event.
 * @param {string} message - Additional details or context about the audit event.
 * @return {void}
 */
function logAudit (text, code, message);

getAuditLog (Android) #

Exports the audit log to the file defined by the specified file path and returns true if successful. The log will contain actions since the launch of the wizard.

/**
 * @param {Object} arg- Parameter JSON object.
 * @returns {boolean} - Returns true if the audit log were successfully exported, false otherwise.
 */
function getAuditLog(arg);

Parameters description :

NameRequiredFormatDescription
savePathtruestringPath to the target file within the workspace

Example :

const arg = {
    "savePath": "/signed/audit.log"
}
const isSucess = getAuditLog(arg);

alert (Android, Windows, iOS) #

Displays a short toast notification at the bottom of the screen showing the specified text for 1 second.

/**
 * @param {string} message - The text content to be displayed in the alert.
 * @returns {void}
 */
function alert(message);

Example :

alert("Hello world");

alertD (Android, Windows, iOS) #

Works the same way as alert, but the toast message is displayed only when the log level is set to debug.

/**
 * @param {string} message - The text content to be displayed in the alert.
 * @returns {void}
 */
function alertD(message);

Example :

alertD("Hello world");

convertJSONtoXML (Android) #

Converts a JSON value to XML format. This can be used when data needs to be transformed from JSON and sent to an external system that requires XML.

/**
 * @param {Object} json- Parameter JSON.
 * @returns {string} XML string
 */
function convertJSONtoXML (json);

Example :


const arg = {
    "country": "SK",
    "city": "Bratislava"
};
const xml = convertJSONtoXML(arg);

Result example :

<country>SK</country><city>Bratislava</city>

convertXMLtoJSON   (Android) #

Converts an XML value to JSON format

/**
 * @param {string} xml - Parameter XML.
 * @returns {string} JSON string
 */
function convertXMLtoJSON(json);

Example :


const arg = "<country>SK</country><city>Bratislava</city>"
const json= convertXMLtoJSON(arg);

Result example :

 {"country":"SK","city":"Bratislava"}

getMD5 (Android) #

Returns hash value used as a checksum to verify data integrity. See https://en.wikipedia.org/wiki/MD5

/**
 * @param {Object} arg- Parameter JSON object.
 * @returns {string} - Returns MD5 hash value.
 */
function getMD5(arg);

Parameters description :

NameRequiredFormatDescription
md5truestringText to hash

Example :


const arg = {
    "md5": "hash test"
};
const value= getMD5(arg);
// value = b6ecdcfccf524b9b81cf0240ddb1f300

zip (Android, Windows, iOS) #

Creates a ZIP package from the files in the specified folder, optionally encrypting the ZIP with the provided password.

/**
 * @param {Object} arg- Parameter JSON object.
 * @returns {boolean} - Returns true if the compression is successful, false otherwise.
 */
function zip(arg);

Parameters description :

NameRequiredFormatDescription
foldertruestringPath to the source directory within the workspace to be compressed
filetruestringPath to the destination zip file within the workspace
passwordfalsestringPassword to protect zip file

Example :


const arg = {
    "folder": "/signed",
    "file" : "/final/final.zip"
};
const isSucess = zip(arg);

unZip (Android, Windows, iOS) #

Unzips the file using the standard ZIP compression into the supplied path.

/**
 * @param {Object} arg- Parameter JSON object.
 * @returns {boolean} - Returns true if the decompression is successful, false otherwise.
 */
function unZip(arg);

Parameters description :

NameRequiredFormatDescription
foldertruestringPath to the destination directory within the workspace where zip file si decompressed
filetruestringPath to the zip file within the workspace
passwordfalsestringPassword if zip file is protected

Example :


const arg = {
    "folder": "/unpack",
    "file" : "/final/final.zip"
};
const isSucess = unZip(arg);

gzip (Android) #

Compresses a given file using the GZIP compression.

/**
 * @param {Object} arg- Parameter JSON object.
 * @returns {boolean} - Returns true if the compression is successful, false otherwise.
 */
function gzip(arg);

Parameters description :

NameRequiredFormatDescription
nametruestringPath to the destination gz file within the workspace
filetruestringPath to the source file within the workspace

Example :


const arg = {
    "name": "/final/gzip.gz",
    "file" : "/pdf/Test1.pdf"
};
const isSucess = gzip(arg);

unGzip (Android) #

Decompresses a file using the GZIP compression.

/**
 * @param {Object} arg- Parameter JSON object.
 * @returns {boolean} - Returns true if the decompression is successful, false otherwise.
 */
function unGzip(arg);

Parameters description :

NameRequiredFormatDescription
nametruestringPath to the gz file within the workspace to decompress
filetruestringPath to the destination file within the workspace

Example :


const arg = {
    "name": "/final/gzip.gz",
    "file" : "/unpack/Test1.pdf"
};
const isSucess = unGzip(arg);
Updated on 04/02/2026
2.6 Application Features3. Example: Simple process
Table of Contents
  • logD (Android, Windows, iOS)
  • logE (Android, Windows, iOS)
  • setLogLevel (Android, Windows, iOS)
  • sendLog (Android, Windows, iOS)
  • logAudit (Android)
  • getAuditLog (Android)
  • alert (Android, Windows, iOS)
  • alertD (Android, Windows, iOS)
  • convertJSONtoXML (Android)
  • convertXMLtoJSON   (Android)
  • getMD5 (Android)
  • zip (Android, Windows, iOS)
  • unZip (Android, Windows, iOS)
  • gzip (Android)
  • unGzip (Android)
  • Documentation
    • Mobile App – Signatus
    • Web App – Signatus 2 API
    • Web App – OKdokument API
    • Web App – OKdokument
  • Contact Us
Proudly powered by WordPress