modificaciond de pdf

This commit is contained in:
DanielRamirezGe
2019-10-07 15:55:00 -05:00
parent fd4add9556
commit 0ebdc77bc9
2 changed files with 41 additions and 5 deletions
+2 -1
View File
@@ -25,6 +25,7 @@
"qr-image": "^3.2.0",
"qrcode-generator": "^1.4.4",
"validator": "^11.1.0",
"voilab-pdf-table": "^0.5.0"
"voilab-pdf-table": "^0.5.0",
"xlsx": "^0.15.1"
}
}
+39 -4
View File
@@ -14,8 +14,7 @@ let g_pdf = async function(idPersona) {
let inicio = 120;
var datetime = new Date();
doc.image(__dirname + '/Imagenes/logo_unam.png', inicio, 30, { scale: 0.04 });
@@ -39,6 +38,24 @@ let g_pdf = async function(idPersona) {
doc.moveTo(70, 110)
.lineTo(542, 110);
console.log(datetime);
let d = datetime.getDate();
let m = datetime.getMonth();
let a = datetime.getFullYear();
if (d < 10) {
let aux = `0${d}`;
d = aux;
}
if (m < 10) {
let aux = `0${m}`;
m = aux;
}
doc.font('Times-Roman')
.fontSize(13)
.text(`${d}/${m}/${a}`, inicio + 305, 120);
let marg = 70;
doc.image(__dirname + `/Imagenes/persona_${idPersona}.png`, marg, 120, { scale: 0.85 });
@@ -52,8 +69,21 @@ let g_pdf = async function(idPersona) {
.fontSize(13)
.text('CONFERENCIAS', inicio + 142, 240);
doc.font('Times-Roman')
.fontSize(12)
.text('Nota:', marg, 270);
doc.font('Times-Roman')
.fontSize(10)
.text(` 1.- Presentarse 10 minutos antes de que inicie la actividad.`, marg, 285);
doc.font('Times-Roman')
.fontSize(10)
.text(' 2.- Todas las actividades serán en el auditorio 901, excepto la Feria se llevará acabo en el Corredor Multidisciplinario.', marg, 295);
doc.font('Times-Roman')
.fontSize(12)
.text('', marg, 300);
var table1 = {
headers: ['Nombre', 'Fecha ', 'Hora'],
rows: []
@@ -102,11 +132,16 @@ let g_pdf = async function(idPersona) {
}
let uno = `${dia}/${mes}/${anio}`;
let dos = `${hora}:${min}`;
let dos = "";
if (results[index].idConferencia == 7)
dos = `${hora}:${min} - 16:00`;
else
dos = `${hora}:${min}`;
table1.rows.push([results[index].nombre, uno, dos])
}
doc.moveDown().table(table1, 70, 270, { width: 470 });
doc.moveDown().table(table1, 70, 340, { width: 470 });
doc.end();
});
return;