@jsreport/jsreport-libreoffice 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/index.js +7 -0
- package/jsreport.config.js +24 -0
- package/lib/main.js +72 -0
- package/lib/worker.js +427 -0
- package/package.json +58 -0
- package/studio/LibreOfficePdfExportOptionsEditor.js +603 -0
- package/studio/LibreOfficePdfExportOptionsTitle.js +3 -0
- package/studio/LibreOfficeProperties.js +69 -0
- package/studio/constants.js +2 -0
- package/studio/main.css +19 -0
- package/studio/main.css.map +1 -0
- package/studio/main.js +859 -0
- package/studio/main.js.map +1 -0
- package/studio/main_dev.js +11 -0
- package/studio/styles.css +19 -0
@@ -0,0 +1,603 @@
|
|
1
|
+
import React, { Component } from 'react'
|
2
|
+
import Studio from 'jsreport-studio'
|
3
|
+
import styles from './styles.css'
|
4
|
+
|
5
|
+
class LibreOfficePdfExportOptionsEditor extends Component {
|
6
|
+
changeLibreOffice (props, change) {
|
7
|
+
const { entity } = props
|
8
|
+
|
9
|
+
Studio.updateEntity(Object.assign({}, entity, { libreOffice: { ...entity.libreOffice, ...change } }))
|
10
|
+
}
|
11
|
+
|
12
|
+
reset () {
|
13
|
+
if (confirm('Are you sure you want to reset to defaults?')) {
|
14
|
+
const { entity } = this.props
|
15
|
+
Studio.updateEntity(Object.assign({}, entity, {
|
16
|
+
libreOffice: {
|
17
|
+
format: entity.libreOffice?.format,
|
18
|
+
enabled: entity.libreOffice?.enabled
|
19
|
+
}
|
20
|
+
}))
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
render () {
|
25
|
+
const { entity } = this.props
|
26
|
+
|
27
|
+
return (
|
28
|
+
<div className='block custom-editor' style={{ overflowX: 'auto' }}>
|
29
|
+
<h1>
|
30
|
+
<i className='fa fa-file-pdf-o' /> Libre Office PDF Export Options
|
31
|
+
<button className='button danger' onClick={() => this.reset()}>Reset to defaults</button>
|
32
|
+
</h1>
|
33
|
+
<h2>General
|
34
|
+
</h2>
|
35
|
+
|
36
|
+
<div className={styles.row}>
|
37
|
+
<div className={styles.column + ' form-group'}>
|
38
|
+
<label>Page Range</label>
|
39
|
+
<input
|
40
|
+
type='text'
|
41
|
+
value={entity.libreOffice?.pdfExportPageRange}
|
42
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportPageRange: v.target.value })}
|
43
|
+
/>
|
44
|
+
</div>
|
45
|
+
<div className={styles.column + ' form-group'}>
|
46
|
+
<label>Use lossless compression</label>
|
47
|
+
<input
|
48
|
+
type='checkbox'
|
49
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportUseLosslessCompression === true}
|
50
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportUseLosslessCompression: v.target.checked })}
|
51
|
+
/>
|
52
|
+
</div>
|
53
|
+
</div>
|
54
|
+
<div className={styles.row}>
|
55
|
+
<div className={styles.column + ' form-group'}>
|
56
|
+
<label>Quality</label>
|
57
|
+
<input
|
58
|
+
type='number'
|
59
|
+
placeholder='90'
|
60
|
+
value={entity.libreOffice?.pdfExportQuality}
|
61
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportQuality: v.target.valueAsNumber })}
|
62
|
+
/>
|
63
|
+
</div>
|
64
|
+
<div className={styles.column + ' form-group'}>
|
65
|
+
<label>Reduce image resolution</label>
|
66
|
+
<input
|
67
|
+
type='checkbox'
|
68
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportReduceImageResolution === true}
|
69
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportReduceImageResolution: v.target.checked })}
|
70
|
+
/>
|
71
|
+
</div>
|
72
|
+
</div>
|
73
|
+
<div className={styles.row}>
|
74
|
+
<div className={styles.column + ' form-group'}>
|
75
|
+
<label>Max image resolution</label>
|
76
|
+
<input
|
77
|
+
type='number'
|
78
|
+
placeholder='90'
|
79
|
+
value={entity.libreOffice?.pdfExportMaxImageResolution}
|
80
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportMaxImageResolution: v.target.valueAsNumber })}
|
81
|
+
/>
|
82
|
+
</div>
|
83
|
+
<div className={styles.column + ' form-group'}>
|
84
|
+
<label>PDF version</label>
|
85
|
+
<select
|
86
|
+
value={entity.libreOffice?.pdfExportSelectPdfVersion == null ? '0' : entity.libreOffice.pdfExportSelectPdfVersion}
|
87
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportSelectPdfVersion: parseInt(v.target.value) })}
|
88
|
+
>
|
89
|
+
<option value='0'>PDF 1.7</option>
|
90
|
+
<option value='1'>PDF/A-1b</option>
|
91
|
+
<option value='2'>PDF/A-2b</option>
|
92
|
+
<option value='3'>PDF/A-3b</option>
|
93
|
+
<option value='15'>PDF 1.5</option>
|
94
|
+
<option value='16'>PDF 1.6</option>
|
95
|
+
<option value='17'>PDF 1.7</option>
|
96
|
+
</select>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
<div className={styles.row}>
|
100
|
+
<div className={styles.column + ' form-group'}>
|
101
|
+
<label>PDF U/A compliance</label>
|
102
|
+
<input
|
103
|
+
type='checkbox'
|
104
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportPDFUACompliance === true}
|
105
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportPDFUACompliance: v.target.checked })}
|
106
|
+
/>
|
107
|
+
</div>
|
108
|
+
<div className={styles.column + ' form-group'}>
|
109
|
+
<label>Use tagged PDF</label>
|
110
|
+
<input
|
111
|
+
type='checkbox'
|
112
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportUseTaggedPDF === true}
|
113
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportUseTaggedPDF: v.target.checked })}
|
114
|
+
/>
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
<div className={styles.row}>
|
118
|
+
<div className={styles.column + ' form-group'}>
|
119
|
+
<label>Export form fields</label>
|
120
|
+
<input
|
121
|
+
type='checkbox'
|
122
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportExportFormFields !== false}
|
123
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportExportFormFields: v.target.checked })}
|
124
|
+
/>
|
125
|
+
</div>
|
126
|
+
<div className={styles.column + ' form-group'}>
|
127
|
+
<label>Forms type</label>
|
128
|
+
<select
|
129
|
+
value={entity.libreOffice?.pdfExportFormsType == null ? '0' : entity.libreOffice.pdfExportFormsType}
|
130
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportFormsType: parseInt(v.target.value) })}
|
131
|
+
>
|
132
|
+
<option value='0'>Form type FDF is used</option>
|
133
|
+
<option value='1'>Form type PDF is used</option>
|
134
|
+
<option value='2'>Form type HTML is used</option>
|
135
|
+
<option value='3'>Form type XML is used</option>
|
136
|
+
</select>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
<div className={styles.row}>
|
140
|
+
<div className={styles.column + ' form-group'}>
|
141
|
+
<label>Allow duplicate field names</label>
|
142
|
+
<input
|
143
|
+
type='checkbox'
|
144
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportAllowDuplicateFieldNames === true}
|
145
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportAllowDuplicateFieldNames: v.target.checked })}
|
146
|
+
/>
|
147
|
+
</div>
|
148
|
+
<div className={styles.column + ' form-group'}>
|
149
|
+
<label>Export bookmarks</label>
|
150
|
+
<input
|
151
|
+
type='checkbox'
|
152
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportExportBookmarks !== false}
|
153
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportExportBookmarks: v.target.checked })}
|
154
|
+
/>
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
<div className={styles.row}>
|
158
|
+
<div className={styles.column + ' form-group'}>
|
159
|
+
<label>Export placeholders</label>
|
160
|
+
<input
|
161
|
+
type='checkbox'
|
162
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportExportPlaceholders === true}
|
163
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportExportPlaceholders: v.target.checked })}
|
164
|
+
/>
|
165
|
+
</div>
|
166
|
+
<div className={styles.column + ' form-group'}>
|
167
|
+
<label>Export notes</label>
|
168
|
+
<input
|
169
|
+
type='checkbox'
|
170
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportExportNotes === true}
|
171
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportExportNotes: v.target.checked })}
|
172
|
+
/>
|
173
|
+
</div>
|
174
|
+
</div>
|
175
|
+
<div className={styles.row}>
|
176
|
+
<div className={styles.column + ' form-group'}>
|
177
|
+
<label>Export notes pages</label>
|
178
|
+
<input
|
179
|
+
type='checkbox'
|
180
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportExportNotesPages === true}
|
181
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportExportNotesPages: v.target.checked })}
|
182
|
+
/>
|
183
|
+
</div>
|
184
|
+
<div className={styles.column + ' form-group'}>
|
185
|
+
<label>Export only notes pages</label>
|
186
|
+
<input
|
187
|
+
type='checkbox'
|
188
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportExportOnlyNotesPages === true}
|
189
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportExportOnlyNotesPages: v.target.checked })}
|
190
|
+
/>
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
<div className={styles.row}>
|
194
|
+
<div className={styles.column + ' form-group'}>
|
195
|
+
<label>Export notes in margin</label>
|
196
|
+
<input
|
197
|
+
type='checkbox'
|
198
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportExportNotesInMargin === true}
|
199
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportExportNotesInMargin: v.target.checked })}
|
200
|
+
/>
|
201
|
+
</div>
|
202
|
+
<div className={styles.column + ' form-group'}>
|
203
|
+
<label>Export hidden slides</label>
|
204
|
+
<input
|
205
|
+
type='checkbox'
|
206
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportExportHiddenSlides === true}
|
207
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportExportHiddenSlides: v.target.checked })}
|
208
|
+
/>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
<div className={styles.row}>
|
212
|
+
<div className={styles.column + ' form-group'}>
|
213
|
+
<label>Is skip empty pages</label>
|
214
|
+
<input
|
215
|
+
type='checkbox'
|
216
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportIsSkipEmptyPages === true}
|
217
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportIsSkipEmptyPages: v.target.checked })}
|
218
|
+
/>
|
219
|
+
</div>
|
220
|
+
<div className={styles.column + ' form-group'}>
|
221
|
+
<label>Embed standard fonts</label>
|
222
|
+
<input
|
223
|
+
type='checkbox'
|
224
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportEmbedStandardFonts === true}
|
225
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportEmbedStandardFonts: v.target.checked })}
|
226
|
+
/>
|
227
|
+
</div>
|
228
|
+
</div>
|
229
|
+
<div className={styles.row}>
|
230
|
+
<div className={styles.column + ' form-group'}>
|
231
|
+
<label>Is add s tream</label>
|
232
|
+
<input
|
233
|
+
type='checkbox'
|
234
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportIsAddStream === true}
|
235
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportIsAddStream: v.target.checked })}
|
236
|
+
/>
|
237
|
+
</div>
|
238
|
+
<div className={styles.column + ' form-group'}>
|
239
|
+
<label>Watermak</label>
|
240
|
+
<input
|
241
|
+
type='text'
|
242
|
+
value={entity.libreOffice?.pdfExportWatermark}
|
243
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportWatermark: v.target.value })}
|
244
|
+
/>
|
245
|
+
</div>
|
246
|
+
</div>
|
247
|
+
<div className={styles.row}>
|
248
|
+
<div className={styles.column + ' form-group'}>
|
249
|
+
<label>Watermark color</label>
|
250
|
+
<input
|
251
|
+
type='number'
|
252
|
+
placeholder='0'
|
253
|
+
value={entity.libreOffice?.pdfExportWatermarkColor}
|
254
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportWatermarkColor: v.target.valueAsNumber })}
|
255
|
+
/>
|
256
|
+
</div>
|
257
|
+
<div className={styles.column + ' form-group'}>
|
258
|
+
<label>Watermark font height</label>
|
259
|
+
<input
|
260
|
+
type='number'
|
261
|
+
placeholder='0'
|
262
|
+
value={entity.libreOffice?.pdfExportWatermarkFontHeight}
|
263
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportWatermarkFontHeight: v.target.valueAsNumber })}
|
264
|
+
/>
|
265
|
+
</div>
|
266
|
+
</div>
|
267
|
+
<div className={styles.row}>
|
268
|
+
<div className={styles.column + ' form-group'}>
|
269
|
+
<label>Watermark rotate angle</label>
|
270
|
+
<input
|
271
|
+
type='number'
|
272
|
+
placeholder='0'
|
273
|
+
value={entity.libreOffice?.pdfExportWatermarkRotateAngle}
|
274
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportWatermarkRotateAngle: v.target.valueAsNumber })}
|
275
|
+
/>
|
276
|
+
</div>
|
277
|
+
<div className={styles.column + ' form-group'}>
|
278
|
+
<label>Watermak font name</label>
|
279
|
+
<input
|
280
|
+
type='text'
|
281
|
+
placeholder='Helvetica'
|
282
|
+
value={entity.libreOffice?.pdfExportWatermarkFontName}
|
283
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportWatermarkFontName: v.target.value })}
|
284
|
+
/>
|
285
|
+
</div>
|
286
|
+
</div>
|
287
|
+
<div className={styles.row}>
|
288
|
+
<div className={styles.column + ' form-group'}>
|
289
|
+
<label>Tiled watermark</label>
|
290
|
+
<input
|
291
|
+
type='text'
|
292
|
+
value={entity.libreOffice?.pdfExportTiledWatermark}
|
293
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportTiledWatermark: v.target.value })}
|
294
|
+
/>
|
295
|
+
</div>
|
296
|
+
<div className={styles.column + ' form-group'}>
|
297
|
+
<label>Use reference XObject</label>
|
298
|
+
<input
|
299
|
+
type='checkbox'
|
300
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportUseReferenceXObject === true}
|
301
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportUseReferenceXObject: v.target.checked })}
|
302
|
+
/>
|
303
|
+
</div>
|
304
|
+
</div>
|
305
|
+
<div className={styles.row}>
|
306
|
+
<div className={styles.column + ' form-group'}>
|
307
|
+
<label>Is redact mode</label>
|
308
|
+
<input
|
309
|
+
type='checkbox'
|
310
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportIsRedactMode === true}
|
311
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportIsRedactMode: v.target.checked })}
|
312
|
+
/>
|
313
|
+
</div>
|
314
|
+
<div className={styles.column + ' form-group'}>
|
315
|
+
<label>Single page sheets</label>
|
316
|
+
<input
|
317
|
+
type='checkbox'
|
318
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportSinglePageSheets === true}
|
319
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportSinglePageSheets: v.target.checked })}
|
320
|
+
/>
|
321
|
+
</div>
|
322
|
+
</div>
|
323
|
+
<h2>Initial View
|
324
|
+
</h2>
|
325
|
+
<div className={styles.row}>
|
326
|
+
<div className={styles.column + ' form-group'}>
|
327
|
+
<label>Resize window to initial page</label>
|
328
|
+
<input
|
329
|
+
type='checkbox'
|
330
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportResizeWindowToInitialPage === true}
|
331
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportResizeWindowToInitialPage: v.target.checked })}
|
332
|
+
/>
|
333
|
+
</div>
|
334
|
+
<div className={styles.column + ' form-group'}>
|
335
|
+
<label>Center window</label>
|
336
|
+
<input
|
337
|
+
type='checkbox'
|
338
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportCenterWindow === true}
|
339
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportCenterWindow: v.target.checked })}
|
340
|
+
/>
|
341
|
+
</div>
|
342
|
+
</div>
|
343
|
+
<div className={styles.row}>
|
344
|
+
<div className={styles.column + ' form-group'}>
|
345
|
+
<label>Open in full screen mode</label>
|
346
|
+
<input
|
347
|
+
type='checkbox'
|
348
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportOpenInFullScreenMode === true}
|
349
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportOpenInFullScreenMode: v.target.checked })}
|
350
|
+
/>
|
351
|
+
</div>
|
352
|
+
<div className={styles.column + ' form-group'}>
|
353
|
+
<label>Display PDF Document title</label>
|
354
|
+
<input
|
355
|
+
type='checkbox'
|
356
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportDisplayPDFDocumentTitle !== false}
|
357
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportDisplayPDFDocumentTitle: v.target.checked })}
|
358
|
+
/>
|
359
|
+
</div>
|
360
|
+
</div>
|
361
|
+
<div className={styles.row}>
|
362
|
+
<div className={styles.column + ' form-group'}>
|
363
|
+
<label>Hide viewer menu bar</label>
|
364
|
+
<input
|
365
|
+
type='checkbox'
|
366
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportHideViewerMenubar === true}
|
367
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportHideViewerMenubar: v.target.checked })}
|
368
|
+
/>
|
369
|
+
</div>
|
370
|
+
<div className={styles.column + ' form-group'}>
|
371
|
+
<label>Hide viewer toolbar</label>
|
372
|
+
<input
|
373
|
+
type='checkbox'
|
374
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportHideViewerToolbar === true}
|
375
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportHideViewerToolbar: v.target.checked })}
|
376
|
+
/>
|
377
|
+
</div>
|
378
|
+
</div>
|
379
|
+
<div className={styles.row}>
|
380
|
+
<div className={styles.column + ' form-group'}>
|
381
|
+
<label>Hide viewer window controls</label>
|
382
|
+
<input
|
383
|
+
type='checkbox'
|
384
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportHideViewerWindowControls === true}
|
385
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportHideViewerWindowControls: v.target.checked })}
|
386
|
+
/>
|
387
|
+
</div>
|
388
|
+
<div className={styles.column + ' form-group'}>
|
389
|
+
<label>Use transition effects</label>
|
390
|
+
<input
|
391
|
+
type='checkbox'
|
392
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportUseTransitionEffects !== false}
|
393
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportUseTransitionEffects: v.target.checked })}
|
394
|
+
/>
|
395
|
+
</div>
|
396
|
+
</div>
|
397
|
+
<h2>Links
|
398
|
+
</h2>
|
399
|
+
<div className={styles.row}>
|
400
|
+
<div className={styles.column + ' form-group'}>
|
401
|
+
<label>Open bookmark levels</label>
|
402
|
+
<input
|
403
|
+
type='number'
|
404
|
+
placeholder='-1'
|
405
|
+
value={entity.libreOffice?.pdfExportOpenBookmarkLevels}
|
406
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportOpenBookmarkLevels: v.target.valueAsNumber })}
|
407
|
+
/>
|
408
|
+
</div>
|
409
|
+
<div className={styles.column + ' form-group'}>
|
410
|
+
<label>Export bookmarks to PDF destination</label>
|
411
|
+
<input
|
412
|
+
type='checkbox'
|
413
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportExportBookmarksToPDFDestination === true}
|
414
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportExportBookmarksToPDFDestination: v.target.checked })}
|
415
|
+
/>
|
416
|
+
</div>
|
417
|
+
</div>
|
418
|
+
<div className={styles.row}>
|
419
|
+
<div className={styles.column + ' form-group'}>
|
420
|
+
<label>Convert OOo target to PDF target</label>
|
421
|
+
<input
|
422
|
+
type='checkbox'
|
423
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportConvertOOoTargetToPDFTarget === true}
|
424
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportConvertOOoTargetToPDFTarget: v.target.checked })}
|
425
|
+
/>
|
426
|
+
</div>
|
427
|
+
<div className={styles.column + ' form-group'}>
|
428
|
+
<label>Export links relative Fsys</label>
|
429
|
+
<input
|
430
|
+
type='checkbox'
|
431
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportExportLinksRelativeFsys === true}
|
432
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportExportLinksRelativeFsys: v.target.checked })}
|
433
|
+
/>
|
434
|
+
</div>
|
435
|
+
</div>
|
436
|
+
<div className={styles.row}>
|
437
|
+
<div className={styles.column + ' form-group'}>
|
438
|
+
<label>PDF view selection</label>
|
439
|
+
<select
|
440
|
+
value={entity.libreOffice?.pdfExportPDFViewSelection == null ? '0' : entity.libreOffice.pdfExportPDFViewSelection}
|
441
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportPDFViewSelection: parseInt(v.target.value) })}
|
442
|
+
>
|
443
|
+
<option value='0'>All the links external to the document treated as URI</option>
|
444
|
+
<option value='1'>Viewed through a PDF reader application only</option>
|
445
|
+
<option value='2'>Viewed through an Internet browser</option>
|
446
|
+
</select>
|
447
|
+
</div>
|
448
|
+
</div>
|
449
|
+
|
450
|
+
<h2>Security
|
451
|
+
</h2>
|
452
|
+
<div className={styles.row}>
|
453
|
+
<div className={styles.column + ' form-group'}>
|
454
|
+
<label>Encrypt file</label>
|
455
|
+
<input
|
456
|
+
type='checkbox'
|
457
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportEncryptFile === true}
|
458
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportEncryptFile: v.target.checked })}
|
459
|
+
/>
|
460
|
+
</div>
|
461
|
+
<div className={styles.column + ' form-group'}>
|
462
|
+
<label>Document open password</label>
|
463
|
+
<input
|
464
|
+
type='password'
|
465
|
+
value={entity.libreOffice?.pdfExportDocumentOpenPassword}
|
466
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportDocumentOpenPassword: v.target.value })}
|
467
|
+
/>
|
468
|
+
</div>
|
469
|
+
</div>
|
470
|
+
<div className={styles.row}>
|
471
|
+
<div className={styles.column + ' form-group'}>
|
472
|
+
<label>Restrict permissions</label>
|
473
|
+
<input
|
474
|
+
type='checkbox'
|
475
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportRestrictPermissions === true}
|
476
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportRestrictPermissions: v.target.checked })}
|
477
|
+
/>
|
478
|
+
</div>
|
479
|
+
<div className={styles.column + ' form-group'}>
|
480
|
+
<label>Permissions password</label>
|
481
|
+
<input
|
482
|
+
type='password'
|
483
|
+
value={entity.libreOffice?.pdfExportPermissionPassword}
|
484
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportPermissionPassword: v.target.value })}
|
485
|
+
/>
|
486
|
+
</div>
|
487
|
+
</div>
|
488
|
+
<div className={styles.row}>
|
489
|
+
<div className={styles.column + ' form-group'}>
|
490
|
+
<label>Printing</label>
|
491
|
+
<select
|
492
|
+
value={entity.libreOffice?.pdfExportPrinting == null ? '2' : entity.libreOffice.pdfExportPrinting}
|
493
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportPrinting: parseInt(v.target.value) })}
|
494
|
+
>
|
495
|
+
<option value='0'>The document cannot be printed</option>
|
496
|
+
<option value='1'>The document can be printed at low resolution only</option>
|
497
|
+
<option value='2'>The document can be printed at maximum resolution</option>
|
498
|
+
</select>
|
499
|
+
</div>
|
500
|
+
<div className={styles.column + ' form-group'}>
|
501
|
+
<label>Changes</label>
|
502
|
+
<select
|
503
|
+
value={entity.libreOffice?.pdfExportChanges == null ? '4' : entity.libreOffice.pdfExportChanges}
|
504
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportChanges: parseInt(v.target.value) })}
|
505
|
+
>
|
506
|
+
<option value='0'>The document cannot be changed</option>
|
507
|
+
<option value='1'>Inserting deleting and rotating pages is allowed</option>
|
508
|
+
<option value='2'>Filling of form field is allowed</option>
|
509
|
+
<option value='3'>Both filling of form field and commenting is allowed</option>
|
510
|
+
<option value='4'>All the changes of the previous selections are permitted</option>
|
511
|
+
</select>
|
512
|
+
</div>
|
513
|
+
</div>
|
514
|
+
<div className={styles.row}>
|
515
|
+
<div className={styles.column + ' form-group'}>
|
516
|
+
<label>Enable copying of content</label>
|
517
|
+
<input
|
518
|
+
type='checkbox'
|
519
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportEnableCopyingOfContent !== false}
|
520
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportEnableCopyingOfContent: v.target.checked })}
|
521
|
+
/>
|
522
|
+
</div>
|
523
|
+
<div className={styles.column + ' form-group'}>
|
524
|
+
<label>Enable text access for accessibility tools</label>
|
525
|
+
<input
|
526
|
+
type='checkbox'
|
527
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportEnableTextAccessForAccessibilityTools !== false}
|
528
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportEnableTextAccessForAccessibilityTools: v.target.checked })}
|
529
|
+
/>
|
530
|
+
</div>
|
531
|
+
</div>
|
532
|
+
<h2>Digital signature
|
533
|
+
</h2>
|
534
|
+
<div className={styles.row}>
|
535
|
+
<div className={styles.column + ' form-group'}>
|
536
|
+
<label>Sign PDF</label>
|
537
|
+
<input
|
538
|
+
type='checkbox'
|
539
|
+
checked={entity.libreOffice && entity.libreOffice.pdfExportSignPDF === true}
|
540
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportSignPDF: v.target.checked })}
|
541
|
+
/>
|
542
|
+
</div>
|
543
|
+
<div className={styles.column + ' form-group'}>
|
544
|
+
<label>Signature location</label>
|
545
|
+
<input
|
546
|
+
type='text'
|
547
|
+
value={entity.libreOffice?.pdfExportSignatureLocation}
|
548
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportSignatureLocation: v.target.value })}
|
549
|
+
/>
|
550
|
+
</div>
|
551
|
+
</div>
|
552
|
+
<div className={styles.row}>
|
553
|
+
<div className={styles.column + ' form-group'}>
|
554
|
+
<label>Signature reason</label>
|
555
|
+
<input
|
556
|
+
type='text'
|
557
|
+
value={entity.libreOffice?.pdfExportSignatureReason}
|
558
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportSignatureReason: v.target.value })}
|
559
|
+
/>
|
560
|
+
</div>
|
561
|
+
<div className={styles.column + ' form-group'}>
|
562
|
+
<label>Signature contact info</label>
|
563
|
+
<input
|
564
|
+
type='text'
|
565
|
+
value={entity.libreOffice?.pdfExportSignatureContactInfo}
|
566
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportSignatureContactInfo: v.target.value })}
|
567
|
+
/>
|
568
|
+
</div>
|
569
|
+
</div>
|
570
|
+
<div className={styles.row}>
|
571
|
+
<div className={styles.column + ' form-group'}>
|
572
|
+
<label>Signature password</label>
|
573
|
+
<input
|
574
|
+
type='password'
|
575
|
+
value={entity.libreOffice?.pdfExportSignaturePassword}
|
576
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportSignaturePassword: v.target.value })}
|
577
|
+
/>
|
578
|
+
</div>
|
579
|
+
<div className={styles.column + ' form-group'}>
|
580
|
+
<label>Signature certificate subject name</label>
|
581
|
+
<input
|
582
|
+
type='text'
|
583
|
+
value={entity.libreOffice?.pdfExportSignCertificateSubjectName}
|
584
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportSignCertificateSubjectName: v.target.value })}
|
585
|
+
/>
|
586
|
+
</div>
|
587
|
+
</div>
|
588
|
+
<div className={styles.row}>
|
589
|
+
<div className={styles.column + ' form-group'}>
|
590
|
+
<label>Signature timestamp</label>
|
591
|
+
<input
|
592
|
+
type='text'
|
593
|
+
value={entity.libreOffice?.pdfExportSignatureTSA}
|
594
|
+
onChange={(v) => this.changeLibreOffice(this.props, { pdfExportSignatureTSA: v.target.value })}
|
595
|
+
/>
|
596
|
+
</div>
|
597
|
+
</div>
|
598
|
+
</div>
|
599
|
+
)
|
600
|
+
}
|
601
|
+
}
|
602
|
+
|
603
|
+
export default LibreOfficePdfExportOptionsEditor
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import React, { Component } from 'react'
|
2
|
+
import * as Constants from './constants.js'
|
3
|
+
import Studio from 'jsreport-studio'
|
4
|
+
|
5
|
+
export default class Properties extends Component {
|
6
|
+
static title (entity, entities) {
|
7
|
+
if (!entity.libreOffice || (!entity.libreOffice.format && !entity.libreOffice.forma) || entity.libreOffice.enabled === false) {
|
8
|
+
return 'libre office'
|
9
|
+
}
|
10
|
+
|
11
|
+
return `libre office ${entity.libreOffice.format || ''} ${entity.libreOffice.print || ''}`
|
12
|
+
}
|
13
|
+
|
14
|
+
changeLibreOffice (props, change) {
|
15
|
+
const { entity, onChange } = props
|
16
|
+
const libreOffice = entity.libreOffice || {}
|
17
|
+
|
18
|
+
onChange({
|
19
|
+
...entity,
|
20
|
+
libreOffice: { ...libreOffice, ...change }
|
21
|
+
})
|
22
|
+
}
|
23
|
+
|
24
|
+
openEditor () {
|
25
|
+
Studio.openTab({
|
26
|
+
key: this.props.entity._id + '_libreOfficePdfExportOptions',
|
27
|
+
_id: this.props.entity._id,
|
28
|
+
editorComponentKey: Constants.LIBREOFFICE_PDF_EXPORT_TAB_EDITOR,
|
29
|
+
titleComponentKey: Constants.LIBREOFFICE_PDF_EXPORT_TAB_TITLE
|
30
|
+
})
|
31
|
+
}
|
32
|
+
|
33
|
+
render () {
|
34
|
+
const { entity } = this.props
|
35
|
+
|
36
|
+
return (
|
37
|
+
<div className='properties-section'>
|
38
|
+
<div className='form-group'><label>Format</label>
|
39
|
+
<input
|
40
|
+
type='text'
|
41
|
+
placeholder='pdf'
|
42
|
+
value={entity.libreOffice ? entity.libreOffice.format : ''}
|
43
|
+
onChange={(v) => this.changeLibreOffice(this.props, { format: v.target.value })}
|
44
|
+
/>
|
45
|
+
</div>
|
46
|
+
<div className='form-group'><label>Print</label>
|
47
|
+
<input
|
48
|
+
type='text'
|
49
|
+
placeholder='default'
|
50
|
+
value={entity.libreOffice ? entity.libreOffice.print : ''}
|
51
|
+
onChange={(v) => this.changeLibreOffice(this.props, { print: v.target.value })}
|
52
|
+
/>
|
53
|
+
</div>
|
54
|
+
<div className='form-group'>
|
55
|
+
<label>Enabled</label>
|
56
|
+
<input
|
57
|
+
type='checkbox'
|
58
|
+
checked={!entity.libreOffice || entity.libreOffice.enabled !== false}
|
59
|
+
onChange={(v) => this.changeLibreOffice(this.props, { enabled: v.target.checked })}
|
60
|
+
/>
|
61
|
+
</div>
|
62
|
+
<div className='form-group'>
|
63
|
+
<label>Pdf Export Options</label>
|
64
|
+
<button onClick={() => this.openEditor()}>Configure</button>
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
)
|
68
|
+
}
|
69
|
+
}
|