You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/api/gantt_exporttopdf.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,8 @@ The api/gantt_exporttopdf.md method takes as a parameter an object with a number
92
92
</tr>
93
93
<tr>
94
94
<td class="webixdoc_links0"><b>raw</b></td>
95
-
<td>(<i>boolean</i>) defines that all Gantt markup will be exported as it is, with all custom elements. <em>false</em> by default. <a href="desktop/export.md#exportingcustommarkupandstyles">Read the details</a> </td>
95
+
<td>(<i>boolean</i>) defines that all Gantt markup will be exported as it is, with all custom elements. <em>false</em> by default.
96
+
<a href="desktop/export.md#exportingcustommarkupandstyles">Read the details</a> </td>
96
97
</tr>
97
98
<tr>
98
99
<td class="webixdoc_links0"><b>callback</b></td>
@@ -102,14 +103,20 @@ The api/gantt_exporttopdf.md method takes as a parameter an object with a number
<td>(<i>object</i>) an object with additional settings. The object can contain the following attributes:
104
105
<ul>
105
-
<li><b>format</b> - (<i>string</i>) the format of the output file: <i>'A3', 'A4', 'A5', 'Legal', 'Letter', 'Tabloid'</i></li>
106
-
<li><b>landscape</b> - (<i>boolean</i>) the portrait or landscape orientation of the output file. The attribute works only when the "format" attribute is specified.</li>
107
-
<li><b>width</b> - (<i>string|number|"content"</i>) the width of the output page. The attribute is used when exporting multiple pages. </li>
108
-
<li><b>height</b> - (<i>string|number|"content"</i>) the height of the output page. The attribute is used when exporting multiple pages.</li>
109
-
<li><b>merge_pages</b> - (<i>boolean</i>) enables the multipage export in one file; if set to <i>false</i> you will have to make export several times to get
110
-
all the Gantt data</li>
106
+
<li><b>format</b> - (<i>string</i>) the format of the output file:
<li><b>landscape</b> - (<i>boolean</i>) the portrait or landscape orientation of the output file. The attribute works only when the "format" attribute is specified</li>
109
+
<li><b>width</b> - (<i>string|number|"content"</i>) the width of the output page. The attribute is used when exporting multiple pages</li>
110
+
<li><b>height</b> - (<i>string|number|"content"</i>) the height of the output page. The attribute is used when exporting multiple pages</li>
111
+
<li><b>merge_pages</b> - (<i>boolean</i>) enables the <a href="#multipageexport">multipage export</a> in one file; if set to <i>false</i> you will have to make export several times to get all the Gantt data</li>
111
112
<li><b>fixed_headers</b> - (<i>boolean</i>) enables displaying of the grid and timeline headers on each page; <i>false</i> by default. Works only with
112
113
the enabled <b>merge_pages</b> setting</li>
114
+
<li><b>margins</b> - (<i>object</i>) the object with the top, bottom, left and right margins for the output PDF file.
115
+
<a href="desktop/export.md#marginsoftheoutputpdffile">Read the details</a></li>
116
+
<li><b>header</b> - (<i>string</i>) specifies the header that will be added to each page of the output PDF file.
117
+
<a href="desktop/export.md#headerfooterforeachpage">Read the details</a></li>
118
+
<li><b>footer</b> - (<i>string</i>) specifies the footer that will be added to each page of the output PDF file.
119
+
<a href="desktop/export.md#headerfooterforeachpage">Read the details</a></li>
Copy file name to clipboardExpand all lines: data/desktop/export.md
+83-9Lines changed: 83 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,7 +162,8 @@ The api/gantt_exporttopdf.md and api/gantt_exporttopng.md methods take as a para
162
162
</tr>
163
163
<tr>
164
164
<td class="webixdoc_links0"><b>raw</b></td>
165
-
<td>(<i>boolean</i>) defines that all Gantt markup will be exported as it is, with all custom elements. <em>false</em> by default. <a href="desktop/export.md#exportingcustommarkupandstyles">Read the details below</a> </td>
165
+
<td>(<i>boolean</i>) defines that all Gantt markup will be exported as it is, with all custom elements. <em>false</em> by default.
166
+
<a href="#exportingcustommarkupandstyles">Read the details below</a> </td>
166
167
</tr>
167
168
<tr>
168
169
<td class="webixdoc_links0"><b>callback</b></td>
@@ -172,14 +173,22 @@ The api/gantt_exporttopdf.md and api/gantt_exporttopng.md methods take as a para
<td>(<i>object</i>) an object with additional settings for the <b>exportToPDF()</b> method. The object can contain the following attributes:
174
175
<ul>
175
-
<li><b>format</b> - (<i>string</i>) the format of the output file: <i>'A3', 'A4', 'A5', 'Legal', 'Letter', 'Tabloid'</i></li>
176
-
<li><b>landscape</b> - (<i>boolean</i>) the portrait or landscape orientation of the output file. The attribute works only when the "format" attribute is specified.</li>
176
+
<li><b>format</b> - (<i>string</i>) the format of the output file:
<li><b>landscape</b> - (<i>boolean</i>) the portrait or landscape orientation of the output file.
179
+
The attribute works only when the "format" attribute is specified.</li>
177
180
<li><b>width</b> - (<i>string | number | "content"</i>) the width of the output page. The attribute is used when exporting multiple pages. </li>
178
181
<li><b>height</b> - (<i>string | number | "content"</i>) the height of the output page. The attribute is used when exporting multiple pages.</li>
179
-
<li><b>merge_pages</b> - (<i>boolean</i>) enables the multipage export in one file;
182
+
<li><b>merge_pages</b> - (<i>boolean</i>) enables the <a href="api/gantt_exporttopdf.md#multipageexport">multipage export</a> in one file;
180
183
if set to <i>false</i> you will have to make export several times to get all the Gantt data</li>
181
184
<li><b>fixed_headers</b> - (<i>boolean</i>) enables displaying of the grid and timeline headers on each page; <i>false</i> by default. Works only with
182
185
the enabled <b>merge_pages</b> setting</li>
186
+
<li><b>margins</b> - (<i>object</i>) the object with the top, bottom, left and right margins for the output PDF file.
187
+
<a href="#marginsoftheoutputpdffile">Read the details below</a></li>
188
+
<li><b>header</b> - (<i>string</i>) specifies the header that will be added to each page of the output PDF file.
189
+
<a href="#headerfooterforeachpage">Read the details below</a></li>
190
+
<li><b>footer</b> - (<i>string</i>) specifies the footer that will be added to each page of the output PDF file.
191
+
<a href="#headerfooterforeachpage">Read the details below</a></li>
183
192
</ul>
184
193
</td>
185
194
</tr>
@@ -236,7 +245,7 @@ gantt.exportToPNG({
236
245
});
237
246
~~~
238
247
239
-
##Name of the output file
248
+
##Name of the output file
240
249
241
250
To set a custom name for the output file, use the **name** property in the parameter of the [exportToPDF/exportToPNG](desktop/export.md#parametersoftheexportmethods) methods:
242
251
@@ -246,7 +255,7 @@ gantt.exportToPDF({
246
255
});
247
256
~~~
248
257
249
-
##Language of the output file
258
+
##Language of the output file
250
259
251
260
By default, the Gantt chart will be exported in the same language as it is shown on the page.
252
261
@@ -270,7 +279,7 @@ To set the tasks that should be presented in the output PDF or PNG file, use one
270
279
271
280
<aid="daterange"></a>
272
281
273
-
###Specifying the date range of the output tasks
282
+
###Specifying the date range of the output tasks
274
283
275
284
To set the range of tasks that will be presented in the output document, use the **start**, **end** properties in the parameter of the [exportToPDF/exportToPNG](desktop/export.md#parametersoftheexportmethods) methods:
276
285
@@ -288,7 +297,7 @@ Note, the date format is defined by the api/gantt_date_format_config.md config.
288
297
289
298
<aid="customdata"></a>
290
299
291
-
###Setting a custom data source to export
300
+
###Setting a custom data source to export
292
301
293
302
To export the Gantt chart with a custom data set (i.e. not with the data presented in the initial Gantt chart), use the **data** property in the parameter of the
Note, you cannot specify some URL as the value of the **data** parameter, just a data object.
316
325
}}
317
326
318
-
##Skin of the output Gantt chart
327
+
##Skin of the output Gantt chart
319
328
320
329
By default, the Gantt chart will be exported with the same skin as it is shown on the page.
321
330
@@ -347,6 +356,71 @@ gantt.exportToPDF({
347
356
});
348
357
~~~
349
358
359
+
<h3id="headerfooterforeachpage">Header/footer for each page of the output PDF file</h3>
360
+
361
+
To add a header/footer for each page of the output PDF file, use the **header**/**footer** properties in the **additional_settings** object of the `exportToPDF` method.
362
+
363
+
You can specify the number of the current page by using the element with `class="pageNumber"` and the total number of pages by using the
364
+
element with `class="totalPages"` in the **header**/**footer** properties:
365
+
366
+
~~~js
367
+
gantt.exportToPDF({
368
+
additional_settings: {
369
+
format:"A4",
370
+
// correct margins are obligatory to render headers/footers
Note that these settings work only when [**margins**](#marginsoftheoutputpdffile) are specified and there is enough space to display the header/footer correctly.
384
+
Otherwise, headers/footers will be rendered outside the gantt. It is recommended to set *10* as a minimal margin for a plain line of text.
385
+
386
+
## Margins of the output PDF file
387
+
388
+
To add margins to the output PDF file, use the **margins** property in the **additional_settings** object of
389
+
the [exportToPDF](desktop/export.md#parametersoftheexportmethods) method. The **margins** property works both for one-page and
0 commit comments