Deals with printing
- Source:
Methods
(static) closeAllDetails()
- Source:
(static) fixGrid(paper, delayopt) → {Promise}
- Source:
Fixes a Grid Theme layout programmatically by imitating CSS multi-line flexbox in JavaScript.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
paper |
PaperObj | paper format |
||
delay |
number |
<optional> |
500
|
delay in milliseconds, to wait for re-painting to finish. |
Returns:
Promise that resolves with undefined
- Type
- Promise
(static) isGrid() → {boolean}
- Source:
Tests if the form element is set to use the Grid Theme.
Returns:
whether the form definition was defined to use the Grid theme
- Type
- boolean
(static) openAllDetails()
- Source:
(static) print(theme)
- Source:
Prints the form after first preparing the Grid (every time it is called).
It's just a demo function that only collects paper format and should be replaced in your app with a dialog that collects a complete paper format (size, margin, orientation);
Parameters:
Name | Type | Description |
---|---|---|
theme |
string | theme name |
(static) styleReset()
- Source:
Resets the print stylesheet to only apply to media 'print'
(static) styleToAll() → {boolean}
- Source:
Applies the print stylesheet to the current view by changing stylesheets media property to 'all'
Returns:
whether there was a print stylesheet to change
- Type
- boolean
(inner) _resizeRowElements(row, maxWidth)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
row |
Element | row elements |
maxWidth |
number | maximum width of row |
(inner) getPaperPixelWidth(paper) → {string}
- Source:
Returns a CSS width value in px (e.g. "100px"
) for a provided paper format, orientation ("portrait"
or "landscape"
) and margin (as any valid CSS value).
Parameters:
Name | Type | Description |
---|---|---|
paper |
PaperObj | paper format |
Returns:
pixel width string
- Type
- string
(inner) getPrintStyleSheet() → {object|null}
- Source:
Gets a single print stylesheet
Returns:
stylesheet
- Type
- object | null
(inner) getPrintStyleSheetLink() → {Element}
- Source:
Obtains a link element with a reference to the print stylesheet.
Returns:
stylesheet link HTML element
- Type
- Element
(inner) setDpi()
- Source:
Calculates the dots per inch and sets the dpi property
Type Definitions
PaperObj
- Source:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
external |
object |
<optional> |
Array of external data objects, required for each external data instance in the XForm |
format |
string |
<optional> |
Paper format name, defaults as "A4". Other valid values are " Letter", "Legal", "Tabloid", "Ledger", "A0", "A1", "A2", "A3", "A5", and "A6" |
landscape |
string |
<optional> |
whether the paper is in landscape orientation, defaults to true |
margin |
number |
<optional> |
paper margin in any valid CSS value |