|
| 1 | +print |
| 2 | +============= |
| 3 | + |
| 4 | +@short: |
| 5 | + prints a view according to the specified settings |
| 6 | + |
| 7 | +@params: |
| 8 | + |
| 9 | +- view object, id the object or id of the view to print |
| 10 | +* options object a set of printing options, see the list below |
| 11 | + |
| 12 | + |
| 13 | +@example: |
| 14 | +//view obj or view id |
| 15 | +webix.print($$("datatable1")); |
| 16 | +webix.print("datatable1"); |
| 17 | + |
| 18 | +//with options |
| 19 | +webix.print($$("datatable1"), {mode:"landscape"}); |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +@template: api_method |
| 24 | +@descr: |
| 25 | + |
| 26 | +<h3>Common printing options</h3> (for all widgets) |
| 27 | + |
| 28 | +- **paper** - (*string*) paper size. Possible values are "a3", "a4" (default), "letter" |
| 29 | +- **mode** - (*string*) page orientation. Possible values are "portrait" (default), "landscape" |
| 30 | +- **margin** - (*number*|*object*) margin for printed pages, can be of two types: |
| 31 | + - *number* - to set the same margin from all sides |
| 32 | + - *object* - with any of the properties: *top*, *right*, *bottom*, *left* containing number to set margins separately |
| 33 | +- **docHeader** - (*string*) document header on the first page before the printed view (independent of the browser print header) |
| 34 | +- **docFooter** - (*string*) document footer on the last page after the printed view (independent of the browser print header) |
| 35 | + |
| 36 | +There are also additional properties that vary depending on the component. |
| 37 | + |
| 38 | +<h3>For data components</h3> |
| 39 | + |
| 40 | +- **scroll** - (*boolean*) if *true*, prints only a visible part of a scrolled component. False by default. |
| 41 | + |
| 42 | +<h3>For datatable, dataview, spreadsheet, X-list</h3> |
| 43 | + |
| 44 | +- **fit** - (*string*) adjusts printed component either to the page width ("page", default), or to the component width ("data"). |
| 45 | + |
| 46 | +<h3>For datatable and spreadsheet</h3> |
| 47 | + |
| 48 | +- **header** - (*boolean*) renders header for datatable, if exists |
| 49 | + - *true* (default for datatable) |
| 50 | + - *false* (default for spreadsheet) |
| 51 | +- **skiprows** - (*boolean*) skips empty rows within the datatable. False by default |
| 52 | +- **borderless** - (*boolean*) removes borders for datatable cells. False by default |
| 53 | +- **trim** - (*boolean*) removes empty rows and columns on the edges of datatable. |
| 54 | + - *true* (default for spreadsheet), |
| 55 | + - *false* (default for datatable) |
| 56 | + |
| 57 | +<h3>For datatable only</h3> |
| 58 | + |
| 59 | +- **footer** - (*boolean*) renders footer for datatable, if exists. True by default |
| 60 | + |
| 61 | +<h3>For spreadsheet only</h3> |
| 62 | + |
| 63 | +- **data** - (*string*) defines which data to print |
| 64 | + - "all" - all data from all sheets |
| 65 | + - "current" - all data from the current sheet (default) |
| 66 | + - "selection" - selected data from the current sheet |
| 67 | +- **sheetnames** - (*boolean*) renders name of sheets for each table. True by default. |
| 68 | + |
| 69 | + |
| 70 | +@relatedsample: 35_print/11_wide_datatable.html |
| 71 | + |
| 72 | +@related: desktop/printing.md |
| 73 | + |
0 commit comments