-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.gs
53 lines (44 loc) · 1.4 KB
/
styles.gs
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
var textFont = {};
textFont[DocumentApp.Attribute.FONT_SIZE] = 12;
textFont[DocumentApp.Attribute.FONT_FAMILY] = 'Helvetica Neue';
var dateFont = {};
dateFont[DocumentApp.Attribute.FONT_SIZE] = 8;
textFont[DocumentApp.Attribute.FONT_FAMILY] = 'Helvetica Neue';
dateFont[DocumentApp.Attribute.SPACING_AFTER] = 12;
var intentSize = 100;
function setStyleSent(par) {
par.setAlignment(DocumentApp.HorizontalAlignment.RIGHT);
par.setIndentFirstLine(intentSize);
par.setIndentStart(intentSize);
par.setAttributes(textFont);
}
function setStyleReceived(par) {
par.setAlignment(DocumentApp.HorizontalAlignment.LEFT);
par.setIndentEnd(intentSize);
par.setAttributes(textFont);
}
function setDateStyleSent(par) {
par.setAlignment(DocumentApp.HorizontalAlignment.RIGHT);
par.setAttributes(dateFont);
}
function setDateStyleReceived(par) {
par.setAlignment(DocumentApp.HorizontalAlignment.LEFT);
par.setAttributes(dateFont);
}
function setDateStyleReceived(par) {
par.setAlignment(DocumentApp.HorizontalAlignment.LEFT);
par.setAttributes(dateFont);
}
function formatImage(img) {
var orgImgWidth = img.getWidth();
img.setWidth(250);
img.setHeight(img.getHeight()*250/orgImgWidth);
}
function setBodyParams(body) {
var marginSize = 50;
body.setPageWidth(450);
body.setMarginTop(marginSize);
body.setMarginBottom(marginSize);
body.setMarginLeft(marginSize);
body.setMarginRight(marginSize);
}