-
Notifications
You must be signed in to change notification settings - Fork 14
/
SlidesAppp.js
119 lines (108 loc) · 14.4 KB
/
SlidesAppp.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
// --- SlidesAppp (SlidesApp plus) ---
(function(r) {
var SlidesAppp;
SlidesAppp = (function() {
var newPPTXdata, pptxObjToBlob, putError, putInternalError, setPageSize;
class SlidesAppp {
constructor(id_) {
this.name = "SlidesAppp";
if (id_ !== "create") {
if (id_ === "" || DriveApp.getFileById(id_).getMimeType() !== MimeType.GOOGLE_SLIDES) {
putError.call(this, "This file ID is not the file ID of Google Slides.");
}
this.obj = {
presentationId: id_
};
}
this.headers = {
Authorization: `Bearer ${ScriptApp.getOAuthToken()}`
};
this.mainObj = {};
}
// --- begin methods
createNewSlidesWithPageSize(obj_) {
var blob, createObj, e, pptxObj, tmpId;
if (!obj_ || Object.keys(obj_).length === 0) {
putError.call(this, "Object was not found. Please confirm it again.");
}
pptxObj = newPPTXdata.call(this);
setPageSize.call(this, obj_, pptxObj);
blob = pptxObjToBlob.call(this, pptxObj);
createObj = {
title: "SlidesSample",
mimeType: MimeType.GOOGLE_SLIDES
};
if (obj_.hasOwnProperty("title")) {
createObj.title = obj_.title;
}
if (obj_.hasOwnProperty("parent")) {
createObj.parents = [
{
id: obj_.parent
}
];
}
try {
tmpId = Drive.Files.insert(createObj, blob).id;
} catch (error) {
e = error;
if (e.message === "Drive is not defined") {
putError.call(this, "Please enable Drive API at Advanced Google services, and try again.");
} else {
putError.call(this, e.message);
}
}
return tmpId;
}
};
SlidesAppp.name = "SlidesAppp";
// --- end meth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AAAAAAAAAAAAAAAAABmaWxlT2JqLnR4dFBLBQYAAAAAAQABADkAAABmHwAAAAA=";
return JSON.parse(Utilities.unzip(Utilities.newBlob(Utilities.base64Decode(data), MimeType.ZIP))[0].getDataAsString());
};
setPageSize = function(obj_, obj) {
var filename, h, root, unitX, unitY, w, xmlObj;
if (obj_.hasOwnProperty("width") || obj_.hasOwnProperty("height")) {
unitX = "pixel";
unitY = "pixel";
if (obj_.width.hasOwnProperty("unit")) {
unitX = obj_.width.unit;
}
if (obj_.height.hasOwnProperty("unit")) {
unitY = obj_.height.unit;
}
if ((unitX !== "pixel" && unitX !== "point") || (unitY !== "pixel" && unitY !== "point")) {
putError.call(this, "Unit is wrong.");
}
if (!obj_.width.hasOwnProperty("size") || !obj_.height.hasOwnProperty("size")) {
putError.call(this, "Size was not found.");
}
w = (unitX === "pixel" ? obj_.width.size * 0.75 : obj_.width.size) * 12700;
h = (unitX === "pixel" ? obj_.height.size * 0.75 : obj_.height.size) * 12700;
filename = "ppt/presentation.xml";
xmlObj = XmlService.parse(obj[filename]);
root = xmlObj.getRootElement();
root.getChild("sldSz", root.getNamespace("p")).setAttribute("cx", w).setAttribute("cy", h);
obj[filename] = XmlService.getRawFormat().format(root);
}
};
pptxObjToBlob = function(pptxObj) {
var blobs;
blobs = Object.entries(pptxObj).reduce((ar, [k, v]) => {
ar.push(v.toString() === "Blob" ? v : Utilities.newBlob(v, MimeType.PLAIN_TEXT, k));
return ar;
}, []);
return Utilities.zip(blobs, "temp.pptx").setContentType(MimeType.MICROSOFT_POWERPOINT);
};
putError = function(m) {
throw new Error(`${m}`);
};
putInternalError = function(m) {
throw new Error(`Internal error: ${m}`);
};
return SlidesAppp;
}).call(this);
return r.SlidesAppp = SlidesAppp;
})(this);