diff --git a/lib/evo_anketa_v2_empty_licenses.pdf b/lib/evo_anketa_v2_empty_licenses.pdf index 06dbafb..0d348fb 100644 Binary files a/lib/evo_anketa_v2_empty_licenses.pdf and b/lib/evo_anketa_v2_empty_licenses.pdf differ diff --git a/pages/api/questionnaire/download.js b/pages/api/questionnaire/download.js index f7c74bb..4350937 100644 --- a/pages/api/questionnaire/download.js +++ b/pages/api/questionnaire/download.js @@ -109,7 +109,7 @@ const fields = { fin_goals_trucks: { name: "nko_object_trucks", type: "text", bind: null, size: 6 }, fin_goals_special: { name: "nko_object_special", type: "text", bind: null, size: 6 }, }, - licenses: { name: "licenses", type: "text", bind: null, size: 4 }, + licenses: { name: "licenses", type: "text", bind: null, size: 5 }, }; function good(value) @@ -167,16 +167,16 @@ export default async function handler(req, res) width: 412, height: 26, color: rgb(0.87, 0.87, 0.87), - }); + }); page.drawText(questionnaire[group], { - x: 152, - y: 195, - size: fields[group].size, - font: formFont, - color: rgb(0, 0, 0), - maxWidth: 412, - lineHeight: 4, + 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, + font: formFont, + color: rgb(0, 0, 0), + maxWidth: 412, + lineHeight: questionnaire[group].length > 500 ? 4 : (questionnaire[group].length > 400) ? 5 : 6, }); } else if(group === "founder_persons") @@ -197,7 +197,7 @@ export default async function handler(req, res) const { placebirth, citizenship, doctype, seria, docnumber, code, issueby, issuedate, } = questionnaire[group][p].identity_document; fields[group][p][field].bind = form.getTextField(fields[group][p][field].name); if(fields[group][p][field].size !== undefined) { fields[group][p][field].bind.setFontSize(fields[group][p][field].size); } - fields[group][p][field].bind.setText(`${ moment(birthdate).format("DD.MM.YYYY") }, ${ placebirth }, ${ citizenship.title }, ${ personal_doctypes[doctype].toString().toUpperCase() } ${ seria.toString() } ${ docnumber.toString() }, выдан ${ issueby.toString() } ${ moment(issuedate).format("DD.MM.YYYY") }, ${ code.toString() }`.toUpperCase()); + fields[group][p][field].bind.setText(`${ moment(birthdate).format("DD.MM.YYYY") }, ${ placebirth }, ${ citizenship.title }, ${ personal_doctypes[doctype].toString().toUpperCase() } ${ seria.toString() } ${ docnumber.toString() }, выдан ${ issueby.toString() }, ${ moment(issuedate).format("DD.MM.YYYY") }, ${ code.toString() }`.toUpperCase()); } else if(field === "registration") {