import { chunkOptions, ConfigurationChunk, image, line, imageOptions } from '../tools/formatters'; import { PrinterLanguage, LineSegment } from './base-printer-language'; import * as utils from '../tools/utils'; import * as formatters2 from '../tools/formatters'; /** * This class implements the HTML based printer language used by the Android printing logic and the print preview screen. */ export declare class HtmlPrinterLanguage extends PrinterLanguage { constructor(); /** @ignore */ protected lines: any[]; /** Can be used to increase the document height if necessary */ additionalDocumentHeight: number; /** Loads image from file and returns it as HTML image element * @ignore * @param imagePath - The path to the image * @param width - The width of the image * @param height - The height of the image * @returns The image is loaded asynchronously, so the method returns a promise containing an HTML image element. */ private loadImage; /** * Changes the current coordinates of the printer for printing the next line * @param xCoord - The new X coordinate (used for left/right alignment) * @param zCoord - The new Z coordinate (used for up/down alignment) */ updateCoordinates(xCoord?: number, zCoord?: number): void; /** * Used to print a horizontal ruler on the paper * @param ruler - The character to use for the ruler */ printHorizRuler(ruler: string): void; /** * Used to print a text line. * @param line - An array of LineSegment objects. Each LineSegment object contains the text to print and the style to use. */ printLine(line: Array): void; /** * Use to print an image. * @param imageDataInBase64 - Contains the image data in a format that can be printed by HTML printers. * If this parameter is null, empty or undefined, the method will do nothing. * @param width - The width of the image in pixels * @param height - The width of the image in pixels * @param alignment - How the image is aligned on the paper */ printImage(imageDataInBase64: any, width: number, height: number, alignment: utils.Alignment, options: imageOptions): void; /** * Use this to begin printing a new document. * @returns {string} - The document to print in HTML format */ printDocument(): string; printDocumentAsync(): Promise; /** * Used to initialise the default values for the properties of the class */ init(config: any): void; changeConfiguration(chunk: ConfigurationChunk): void; /** * Can be used to specify how a word is printed. This is useful for printing text containing special characters (arabic, french, etc.) * @param word - The word to print * @param options - Options for controlling how the word is printed * @returns - The text to print. If the language is arabic, the word is prepended with a unicode character that tells the printer how to print it correctly. */ renderWord(word: string, options: chunkOptions): string; printImageRow(images: Array, width: number, height: number, alignment: utils.Alignment, options?: imageOptions): Promise; /** * Used to print a barcode as an HTML image element * @param barcodeData - The data to encode in the barcode * @param barcodeType - The type of barcode to print (from utils.Barcode enum) * @param height - The height of the barcode in pixels * @param width - The width multiplier for barcode bars * @param alignment - How the barcode should be aligned on the paper */ printBarcode(barcodeData: string, barcodeType: utils.Barcode, height: number, width: number, offset: number, alignment: utils.Alignment, options?: formatters2.barcodeOptions): void; /** * Renders a QR code pattern simulation */ private renderQRCodePattern; /** * Draws QR code finder patterns */ private drawFinderPattern; /** * Renders a PDF417 pattern simulation */ private renderPDF417Pattern; /** * Renders an Aztec code pattern simulation */ private renderAztecPattern; /** * Renders a linear barcode pattern simulation */ private renderLinearBarcodePattern; }