-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy pathconstants.js
137 lines (135 loc) · 2.72 KB
/
constants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import { cloneDeep } from 'lodash';
const applicationName = 'html-to-docx';
const defaultOrientation = 'portrait';
const landscapeWidth = 15840;
const landscapeHeight = 12240;
const landscapeMargins = {
top: 1800,
right: 1440,
bottom: 1800,
left: 1440,
header: 720,
footer: 720,
gutter: 0,
};
const portraitMargins = {
top: 1440,
right: 1800,
bottom: 1440,
left: 1800,
header: 720,
footer: 720,
gutter: 0,
};
const defaultFont = 'Times New Roman';
const defaultFontSize = 22;
const defaultLang = 'en-US';
const defaultDocumentOptions = {
orientation: defaultOrientation,
margins: cloneDeep(portraitMargins),
title: '',
subject: '',
creator: applicationName,
keywords: [applicationName],
description: '',
lastModifiedBy: applicationName,
revision: 1,
createdAt: new Date(),
modifiedAt: new Date(),
headerType: 'default',
header: false,
footerType: 'default',
footer: false,
font: defaultFont,
fontSize: defaultFontSize,
complexScriptFontSize: defaultFontSize,
table: {
row: {
cantSplit: false,
},
},
pageSize: {
width: landscapeHeight,
height: landscapeWidth,
},
pageNumber: false,
skipFirstHeaderFooter: false,
lineNumber: false,
lineNumberOptions: {
countBy: 1,
start: 0,
restart: 'continuous',
},
numbering: {
defaultOrderedListStyleType: 'decimal',
},
decodeUnicode: false,
defaultLang,
};
const defaultHTMLString = '<p></p>';
const relsFolderName = '_rels';
const headerFileName = 'header1';
const footerFileName = 'footer1';
const themeFileName = 'theme1';
const documentFileName = 'document';
const headerType = 'header';
const footerType = 'footer';
const themeType = 'theme';
const hyperlinkType = 'hyperlink';
const imageType = 'image';
const internalRelationship = 'Internal';
const wordFolder = 'word';
const themeFolder = 'theme';
const paragraphBordersObject = {
top: {
size: 0,
spacing: 3,
color: 'FFFFFF',
},
left: {
size: 0,
spacing: 3,
color: 'FFFFFF',
},
bottom: {
size: 0,
spacing: 3,
color: 'FFFFFF',
},
right: {
size: 0,
spacing: 3,
color: 'FFFFFF',
},
};
const colorlessColors = ['transparent', 'auto'];
const verticalAlignValues = ['top', 'middle', 'bottom'];
export {
defaultDocumentOptions,
defaultHTMLString,
relsFolderName,
headerFileName,
footerFileName,
themeFileName,
documentFileName,
headerType,
footerType,
themeType,
internalRelationship,
wordFolder,
themeFolder,
landscapeMargins,
portraitMargins,
defaultOrientation,
landscapeWidth,
landscapeHeight,
applicationName,
defaultFont,
defaultFontSize,
hyperlinkType,
imageType,
paragraphBordersObject,
colorlessColors,
verticalAlignValues,
defaultLang,
};