Namespace: teleprint

teleprint

Print HTML

Methods


teleprint(settings)

  • When window.print() is called, the current document can be printed by the browser.
  • In order to print custom HTML instead of the whole document, HTML will be injected into an Iframe.
  • When iframe.print() is called, the injected HTML can be printed by the browser.
  • HTML assets can also be injected into the iframe document and applied to the injected HTML.
Parameters:
Name Type Description
settings Object

settingsuration setting for the print job.

Properties
Name Type Description
html String | Element

A HTML string OR an element whose outerHTML is copied

assets Array

URLs for individual assetss

inherit Object | Boolean

Copy css and/or js tags to the print document

Properties
Name Type Description
css Boolean

Copy all the existing style tags to the print document

js Boolean

Copy all the existing js tags to the print document

test Boolean

Causes the fuction to output an object for testing purposes

window Object

A reference to a particular window. Default is the current document window

Example
var settings = {
    html: ...,
    assets: ...,
    inherit: ...,
    test: ...,
    window: ...
}

teleprint(settings);