Skip to main content

@rtorcato/browser-common / print

print

Functions​

printPage()​

printPage(): void

Defined in: print/index.ts:10

Triggers the browser's print dialog.

Example​

import { printPage } from '@rtorcato/browser-common/print'
printPage()

Returns​

void


printElementById()​

printElementById(elementId): void

Defined in: print/index.ts:27

Prints a specific HTML element by its ID. Opens a new window with the element's content and triggers print.

Example​

import { printElementById } from '@rtorcato/browser-common/print'
printElementById('receipt')

Parameters​

elementId​

string

The ID of the element to print.

Returns​

void


isPrintAvailable()​

isPrintAvailable(): boolean

Defined in: print/index.ts:52

Checks if the browser's print function is available.

Example​

import { isPrintAvailable } from '@rtorcato/browser-common/print'
if (isPrintAvailable()) showPrintButton()

Returns​

boolean

True if print is available, false otherwise.