Skip to content

Commit c5cbc71

Browse files
committed
fix: updates to PDF export
1 parent 1700d3b commit c5cbc71

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

amd/src/get_pdf_content.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ define(["mod_eductx/assets",
5050
{
5151
text: title,
5252
margin: [0, 75, 30, 0],
53-
fontSize: 40,
53+
fontSize: getFontSize(title.length),
5454
color: "#333C75"
5555
},
5656
{
@@ -134,14 +134,14 @@ define(["mod_eductx/assets",
134134
{
135135
align: "right",
136136
image: assets.eduCtxLogo,
137-
width: 58,
138-
height: 58,
137+
width: 48,
138+
height: 48,
139139
},
140140
{
141141
align: "left",
142142
image: assets.bclabLogo,
143-
height: 58,
144-
width: 161,
143+
height: 48,
144+
width: 133,
145145
margin: [-42, 0, 0, 0]
146146
},
147147
],
@@ -233,8 +233,8 @@ define(["mod_eductx/assets",
233233
}
234234
};
235235

236-
function getFontSize(lengthOfName) {
237-
let fontsizeFullName = 0;
236+
const getFontSize = (lengthOfName) => {
237+
let fontsizeFullName = 12;
238238
if (lengthOfName <= 17) {
239239
fontsizeFullName = 38;
240240
} else if (lengthOfName > 17 && lengthOfName <= 20) {
@@ -255,8 +255,7 @@ define(["mod_eductx/assets",
255255
fontsizeFullName = 14;
256256
}
257257
return fontsizeFullName;
258-
}
259-
258+
};
260259

261260
const getContent = async(certificate) => {
262261
const personFullName =

amd/src/ui_driver.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ define(["mod_eductx/main",
397397
'_' +
398398
certificate.person.lastName +
399399
'_' +
400-
certificate.certificate.unitTitle
400+
certificate.certificate.unitTitle + ".pdf"
401401
);
402402

403403
// eslint-disable-next-line no-console

templates/home.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
<input type="text" class="form-control" id="achievement" name="achievement"
9494
placeholder="e.g. Certified Cyber Security Expert"><br>
9595
<label for="certShortDesc">Short Description</label>
96-
<textarea id="certShortDesc" class="form-control" name="certShortDesc" form="issueCert"
96+
<textarea maxlength="100" id="certShortDesc" class="form-control" name="certShortDesc" form="issueCert"
9797
placeholder="Successfully completed Cyber Security Workshop 2021, held in Maribor at FERI UM."></textarea><br>
9898
<label for="certType">Certificate Type</label>
9999
<input type="text" class="form-control" id="certType" name="certType"

0 commit comments

Comments
 (0)