diff --git a/pages/api/questionnaire/download.js b/pages/api/questionnaire/download.js index 053b99d..c0fdaea 100644 --- a/pages/api/questionnaire/download.js +++ b/pages/api/questionnaire/download.js @@ -175,14 +175,20 @@ export default async function handler(req, res) if(questionnaire[group] !== null) { - page.drawText(questionnaire[group], { + let licenses = questionnaire[group]; + if(typeof licenses !== "string") + { + licenses = licenses.join(", "); + } + + page.drawText(licenses, { x: 152, - y: questionnaire[group].length > 500 ? 195 : (questionnaire[group].length > 400) ? 195 : 193, - size: questionnaire[group].length > 500 ? 4 : (questionnaire[group].length > 400) ? 5 : 6, + y: licenses.length > 500 ? 195 : (licenses.length > 400) ? 195 : 193, + size: licenses.length > 500 ? 4 : (licenses.length > 400) ? 5 : 6, font: formFont, color: rgb(0, 0, 0), maxWidth: 412, - lineHeight: questionnaire[group].length > 500 ? 4 : (questionnaire[group].length > 400) ? 5 : 6, + lineHeight: licenses.length > 500 ? 4 : (licenses.length > 400) ? 5 : 6, }); } }