Skip to main content

print

Trigger the browser print dialog for the whole page or a single element.

Import: @rtorcato/browser-common/print

📖 MDN: Window.print()

Example

import { isPrintAvailable, printPage, printElementById } from '@rtorcato/browser-common/print'

if (isPrintAvailable()) {
printPage()
printElementById('receipt')
}

Exports

  • printPage() — triggers the browser's print dialog
  • printElementById(elementId) — opens a new window with the element's content and prints it
  • isPrintAvailable() — feature check

See the API reference for full signatures.