[FE] Fixes #25: Load cert images lazily

master
Araozu 2023-12-14 15:30:30 -05:00
parent 840ed0187d
commit 1a236dc505
17 changed files with 1875 additions and 1855 deletions

View File

@ -10,150 +10,155 @@ import {
import { cmText, createSimpleText, getImage, getQR } from "./utils"; import { cmText, createSimpleText, getImage, getQR } from "./utils";
import { CertData } from "./CertData"; import { CertData } from "./CertData";
const {
Document, Paragraph, PageOrientation,
FrameAnchorType,
TextRun,
AlignmentType,
BorderStyle,
} = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// MANEJO EN 4x4 ROAD DANGER
const tCourse = createSimpleText({
xPosition: 1.8,
yPosition: 8.4,
width: 20.92,
height: 1.5,
text: "MANEJO EN 4x4 ROAD DANGER",
size: 44,
bold: true,
});
// (caminos peligrosos)
const tCourseDesc = createSimpleText({
xPosition: 9.7,
yPosition: 9.6,
width: 5,
height: 0.5,
text: "(CAMINOS PELIGROSOS)",
size: 20,
bold: true,
});
// En temas de...
const tTopics = createSimpleText({
xPosition: 2.3,
yPosition: 10.4,
width: 20.92,
height: 1.5,
text: "En temas de: Terreno Firme y Complicado, Reacciones ante Eventos, Manejo Adecuado de Unidad, Uso Correcto de 4x4, Control Adecuado en Trocha y Pendientes, Uso de Velocidad Adecuada, equivalente a 12 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.LEFT,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: 5.95,
yPosition: 11.65,
width: 12.38,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function _4X4Cert(props: CertData<null>): Promise<Document> { export async function _4X4Cert(props: CertData<null>): Promise<Document> {
// All these resources compose the certificate.
// They load images from the server,
// and so are here, so they are loaded only when the certificate is generated,
// and not when the app is loaded.
const {
Document, Paragraph, PageOrientation,
FrameAnchorType,
TextRun,
AlignmentType,
BorderStyle,
} = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// MANEJO EN 4x4 ROAD DANGER
const tCourse = createSimpleText({
xPosition: 1.8,
yPosition: 8.4,
width: 20.92,
height: 1.5,
text: "MANEJO EN 4x4 ROAD DANGER",
size: 44,
bold: true,
});
// (caminos peligrosos)
const tCourseDesc = createSimpleText({
xPosition: 9.7,
yPosition: 9.6,
width: 5,
height: 0.5,
text: "(CAMINOS PELIGROSOS)",
size: 20,
bold: true,
});
// En temas de...
const tTopics = createSimpleText({
xPosition: 2.3,
yPosition: 10.4,
width: 20.92,
height: 1.5,
text: "En temas de: Terreno Firme y Complicado, Reacciones ante Eventos, Manejo Adecuado de Unidad, Uso Correcto de 4x4, Control Adecuado en Trocha y Pendientes, Uso de Velocidad Adecuada, equivalente a 12 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.LEFT,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: 5.95,
yPosition: 11.65,
width: 12.38,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const imgQR = await getQR({ const imgQR = await getQR({
iid: props.certIId, iid: props.certIId,
dni: props.personDni, dni: props.personDni,

View File

@ -9,96 +9,97 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function cargadorFrontal(props: CertData<null>): Promise<Document> { export async function cargadorFrontal(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const hasCustomLabel = (props.certCustomLabel?.length ?? 0) > 0; const hasCustomLabel = (props.certCustomLabel?.length ?? 0) > 0;
const customLabelYOffset = 0.8; const customLabelYOffset = 0.8;

View File

@ -9,121 +9,123 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// En temas de...
const tTopics = createSimpleText({
xPosition: 2.3,
yPosition: 10.4,
width: 20.92,
height: 1.5,
text: "En temas de: Descripción general de las excavadoras, Funcionamiento elemental de sus componentes, Símbolos pictográficos, Mandos, indicadores y alarmas, Manejo e interpretación, Normas de arranque y parada, Técnicas operativas en el trabajo con excavadoras, Dispositivos de seguridad de las excavadoras. equivalente a 60 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.LEFT,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: 5.95,
yPosition: 11.9,
width: 12.38,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function excavadoraHidraulica(props: CertData<null>): Promise<Document> { export async function excavadoraHidraulica(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// En temas de...
const tTopics = createSimpleText({
xPosition: 2.3,
yPosition: 10.4,
width: 20.92,
height: 1.5,
text: "En temas de: Descripción general de las excavadoras, Funcionamiento elemental de sus componentes, Símbolos pictográficos, Mandos, indicadores y alarmas, Manejo e interpretación, Normas de arranque y parada, Técnicas operativas en el trabajo con excavadoras, Dispositivos de seguridad de las excavadoras. equivalente a 60 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.LEFT,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: 5.95,
yPosition: 11.9,
width: 12.38,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
// OPERADOR PROFESIONAL DE EXCAVADORA HIDRÁULICA // OPERADOR PROFESIONAL DE EXCAVADORA HIDRÁULICA
const tCourse = createSimpleText({ const tCourse = createSimpleText({
xPosition: 2.2, xPosition: 2.2,

View File

@ -10,137 +10,139 @@ const {
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_manejo_defensivo.png",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: -0.05,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.52,
verticalOffset: 15.24,
});
const imgMTC = getImage({
name: "mtc_2_logo.png",
height: 0.94,
width: 5.14,
horizontalOffset: 1,
verticalOffset: 19.21,
});
// MTC: R.D.N° ...
const tMTCLabel = createSimpleText({
xPosition: -1.51,
yPosition: 18,
width: 6,
height: 0.75,
text: "R.D.N° 092-2021-MTC/17.03",
size: 24,
font: "Calibri",
alignment: AlignmentType.LEFT,
color: "FFFFFF",
bold: true,
});
// CERTIFICADO
const tCertificate = createSimpleTextP({
xPosition: 0.17,
yPosition: 5.9,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: -1.08,
yPosition: 5.4,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// IPERC
const tCourse = createSimpleText({
xPosition: -0.44,
yPosition: 8,
width: 20.92,
height: 1.5,
text: "USO Y MANEJO DE EXTINTORES",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleTextP({
xPosition: 2,
yPosition: 11.5,
width: 20.92,
height: 1.5,
text: "En temas de: Concepto Básico, Combustión, Distintas Clases de Combustión, Clases de Fuego, Propagación de Calor, Formas de Transmisión, Uso de extintores, Amago de Incendios, equivalente a 12 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Se expide certificado...
const tFinishLabel = createSimpleTextP({
xPosition: 1.9,
yPosition: 12.6,
width: 20.92,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(23.35),
y: cmText(8.3),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function extintores(props: CertData<null>): Promise<Document> { export async function extintores(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_manejo_defensivo.png",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: -0.05,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.52,
verticalOffset: 15.24,
});
const imgMTC = getImage({
name: "mtc_2_logo.png",
height: 0.94,
width: 5.14,
horizontalOffset: 1,
verticalOffset: 19.21,
});
// MTC: R.D.N° ...
const tMTCLabel = createSimpleText({
xPosition: -1.51,
yPosition: 18,
width: 6,
height: 0.75,
text: "R.D.N° 092-2021-MTC/17.03",
size: 24,
font: "Calibri",
alignment: AlignmentType.LEFT,
color: "FFFFFF",
bold: true,
});
// CERTIFICADO
const tCertificate = createSimpleTextP({
xPosition: 0.17,
yPosition: 5.9,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: -1.08,
yPosition: 5.4,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// IPERC
const tCourse = createSimpleText({
xPosition: -0.44,
yPosition: 8,
width: 20.92,
height: 1.5,
text: "USO Y MANEJO DE EXTINTORES",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleTextP({
xPosition: 2,
yPosition: 11.5,
width: 20.92,
height: 1.5,
text: "En temas de: Concepto Básico, Combustión, Distintas Clases de Combustión, Clases de Fuego, Propagación de Calor, Formas de Transmisión, Uso de extintores, Amago de Incendios, equivalente a 12 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Se expide certificado...
const tFinishLabel = createSimpleTextP({
xPosition: 1.9,
yPosition: 12.6,
width: 20.92,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(23.35),
y: cmText(8.3),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const imgQR = await getQR({ const imgQR = await getQR({
iid: props.certIId, iid: props.certIId,
dni: props.personDni, dni: props.personDni,

View File

@ -11,123 +11,125 @@ const {
const imgFondoDoc = getImage({
name: "fondo_certificado_manejo_defensivo.png",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: -0.05,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.52,
verticalOffset: 15.24,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.6,
width: 2.25,
horizontalOffset: 0.34,
verticalOffset: 17.99,
});
// CERTIFICADO
const tCertificate = createSimpleTextP({
xPosition: 0.17,
yPosition: 5.9,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: -1.08,
yPosition: 5.4,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// IPERC
const tCourse = createSimpleText({
xPosition: -0.44,
yPosition: 8,
width: 20.92,
height: 1.5,
text: "IDENTIFICACIÓN DE PELIGROS, EVALUACIÓN DE RIESGOS Y CONTROLES (IPERC)",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleTextP({
xPosition: 2,
yPosition: 12.7,
width: 20.92,
height: 1.5,
text: "En temas de: Interpretación de Riesgos, Métodos de Identificación de Riesgos, Evaluación de Riesgos, Análisis de Riesgos, Medidas de Control y Tipos de IPERC; equivalente a 12 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Se expide certificado...
const tFinishLabel = createSimpleTextP({
xPosition: 1.9,
yPosition: 13.8,
width: 20.92,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(23.35),
y: cmText(8.3),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function ipercCert(props: CertData<null>): Promise<Document> { export async function ipercCert(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_manejo_defensivo.png",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: -0.05,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.52,
verticalOffset: 15.24,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.6,
width: 2.25,
horizontalOffset: 0.34,
verticalOffset: 17.99,
});
// CERTIFICADO
const tCertificate = createSimpleTextP({
xPosition: 0.17,
yPosition: 5.9,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: -1.08,
yPosition: 5.4,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// IPERC
const tCourse = createSimpleText({
xPosition: -0.44,
yPosition: 8,
width: 20.92,
height: 1.5,
text: "IDENTIFICACIÓN DE PELIGROS, EVALUACIÓN DE RIESGOS Y CONTROLES (IPERC)",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleTextP({
xPosition: 2,
yPosition: 12.7,
width: 20.92,
height: 1.5,
text: "En temas de: Interpretación de Riesgos, Métodos de Identificación de Riesgos, Evaluación de Riesgos, Análisis de Riesgos, Medidas de Control y Tipos de IPERC; equivalente a 12 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Se expide certificado...
const tFinishLabel = createSimpleTextP({
xPosition: 1.9,
yPosition: 13.8,
width: 20.92,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(23.35),
y: cmText(8.3),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const imgQR = await getQR({ const imgQR = await getQR({
iid: props.certIId, iid: props.certIId,
dni: props.personDni, dni: props.personDni,

View File

@ -11,116 +11,118 @@ const {
const imgFondoDoc = getImage({
name: "fondo_certificado_manejo_defensivo.png",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: -0.05,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.52,
verticalOffset: 15.24,
});
// CERTIFICADO
const tCertificate = createSimpleTextP({
xPosition: 0.17,
yPosition: 5.9,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: -1.08,
yPosition: 5.4,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// IPERC
const tCourse = createSimpleText({
xPosition: -0.44,
yPosition: 8,
width: 20.92,
height: 1.5,
text: "LUCHA CONTRA INCENDIOS",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleTextP({
xPosition: 2,
yPosition: 11.5,
width: 20.92,
height: 1.5,
text: "En temas de: Concepto Básico, Combustión, Distintas Clases de Combustión, Clases de Fuego, Propagación de Calor, Formas de Transmisión, Uso de extintores, Amago de Incendios, equivalente a 24 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Se expide certificado...
const tFinishLabel = createSimpleTextP({
xPosition: 1.9,
yPosition: 12.6,
width: 20.92,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(23.35),
y: cmText(8.3),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function luchaContraIncendiosCert(props: CertData<null>): Promise<Document> { export async function luchaContraIncendiosCert(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_manejo_defensivo.png",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: -0.05,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.52,
verticalOffset: 15.24,
});
// CERTIFICADO
const tCertificate = createSimpleTextP({
xPosition: 0.17,
yPosition: 5.9,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: -1.08,
yPosition: 5.4,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// IPERC
const tCourse = createSimpleText({
xPosition: -0.44,
yPosition: 8,
width: 20.92,
height: 1.5,
text: "LUCHA CONTRA INCENDIOS",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleTextP({
xPosition: 2,
yPosition: 11.5,
width: 20.92,
height: 1.5,
text: "En temas de: Concepto Básico, Combustión, Distintas Clases de Combustión, Clases de Fuego, Propagación de Calor, Formas de Transmisión, Uso de extintores, Amago de Incendios, equivalente a 24 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Se expide certificado...
const tFinishLabel = createSimpleTextP({
xPosition: 1.9,
yPosition: 12.6,
width: 20.92,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(23.35),
y: cmText(8.3),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const imgQR = await getQR({ const imgQR = await getQR({
iid: props.certIId, iid: props.certIId,
dni: props.personDni, dni: props.personDni,

View File

@ -9,145 +9,147 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_manejo_defensivo.png",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: -0.05,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.52,
verticalOffset: 15.24,
});
const imgMTC = getImage({
name: "mtc_2_logo.png",
height: 0.94,
width: 5.14,
horizontalOffset: 3.11,
verticalOffset: 19.21,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.6,
width: 2.25,
horizontalOffset: 0.34,
verticalOffset: 17.99,
});
const tCertificate = createSimpleText({
xPosition: 2.42,
yPosition: 4.2,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: -1.08,
yPosition: 5.4,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// MANEJO DEFENSIVO
const tCourse = createSimpleText({
xPosition: -0.44,
yPosition: 8,
width: 20.92,
height: 1.5,
text: "MANEJO DEFENSIVO",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleText({
xPosition: -0.44,
yPosition: 9.4,
width: 20.92,
height: 1.5,
text: "En temas de: Reacción a Eventos, Técnicas Preventivas, Puntos Ciegos, Primeros Auxilios Básico, Fatiga y Somnolencia, Normas Vigentes, Acción y Reacción Adecuada, Conducción en Condiciones Adversas, equivalente a 12 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: -0.44,
yPosition: 10.5,
width: 20.92,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// MTC: R.D.N° ...
const tMTCLabel = createSimpleText({
xPosition: 0.6,
yPosition: 18,
width: 6,
height: 0.75,
text: "R.D.N° 092-2021-MTC/17.03",
size: 24,
font: "Calibri",
alignment: AlignmentType.LEFT,
color: "FFFFFF",
bold: true,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(23.35),
y: cmText(8.3),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function manejoDefensivoCert(props: CertData<null>): Promise<Document> { export async function manejoDefensivoCert(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_manejo_defensivo.png",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: -0.05,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.52,
verticalOffset: 15.24,
});
const imgMTC = getImage({
name: "mtc_2_logo.png",
height: 0.94,
width: 5.14,
horizontalOffset: 3.11,
verticalOffset: 19.21,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.6,
width: 2.25,
horizontalOffset: 0.34,
verticalOffset: 17.99,
});
const tCertificate = createSimpleText({
xPosition: 2.42,
yPosition: 4.2,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: -1.08,
yPosition: 5.4,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// MANEJO DEFENSIVO
const tCourse = createSimpleText({
xPosition: -0.44,
yPosition: 8,
width: 20.92,
height: 1.5,
text: "MANEJO DEFENSIVO",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleText({
xPosition: -0.44,
yPosition: 9.4,
width: 20.92,
height: 1.5,
text: "En temas de: Reacción a Eventos, Técnicas Preventivas, Puntos Ciegos, Primeros Auxilios Básico, Fatiga y Somnolencia, Normas Vigentes, Acción y Reacción Adecuada, Conducción en Condiciones Adversas, equivalente a 12 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: -0.44,
yPosition: 10.5,
width: 20.92,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// MTC: R.D.N° ...
const tMTCLabel = createSimpleText({
xPosition: 0.6,
yPosition: 18,
width: 6,
height: 0.75,
text: "R.D.N° 092-2021-MTC/17.03",
size: 24,
font: "Calibri",
alignment: AlignmentType.LEFT,
color: "FFFFFF",
bold: true,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(23.35),
y: cmText(8.3),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const imgQR = await getQR({ const imgQR = await getQR({
iid: props.certIId, iid: props.certIId,
dni: props.personDni, dni: props.personDni,

View File

@ -1,113 +1,12 @@
import { Matpel, cmText, getImage, getMatpelHours, getMatpelLabel, getQR } from "./utils"; import { Matpel, cmText, getImage, getMatpelHours, getMatpelLabel, getQR } from "./utils";
import { CertData } from "./CertData"; import { CertData } from "./CertData";
/*
import {
Document, Packer, Paragraph, PageOrientation,
FrameAnchorType,
TextRun,
AlignmentType,
} from "docx";
// */
//*
const { const {
Document, Paragraph, PageOrientation, Document, Paragraph, PageOrientation,
FrameAnchorType, FrameAnchorType,
TextRun, TextRun,
AlignmentType, AlignmentType,
} = window.docx; } = window.docx;
// */
const imgFondoDoc = getImage({
name: "fondo_certificado.png",
height: 20.97,
width: 29.8,
horizontalOffset: 0,
verticalOffset: 0,
behindDocument: true,
});
const imgMatpel = getImage({
name: "matpel-logo.png",
height: 2.81,
width: 2.81,
horizontalOffset: 0.7,
verticalOffset: 0.7,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 0.91,
verticalOffset: 3.64,
});
const imgCEE = getImage({
name: "cee_logo.png",
height: 2.22,
width: 3.11,
horizontalOffset: 0.29,
verticalOffset: 18,
});
const imgMTC = getImage({
name: "mtc_logo.png",
height: 1.3,
width: 4.08,
horizontalOffset: 5.13,
verticalOffset: 19.33,
});
const imgEEG = getImage({
name: "eeg_f_logo.png",
height: 4.39,
width: 6.4,
horizontalOffset: 23.35,
verticalOffset: 0,
});
const imgOSHA = getImage({
name: "osha_logo.png",
height: 1.55,
width: 4.46,
horizontalOffset: 24.34,
verticalOffset: 4.95,
});
const imgAguila = getImage({
name: "aguila_logo.png",
height: 2.62,
width: 2.68,
horizontalOffset: 25.45,
verticalOffset: 6.57,
});
const imgMichigan = getImage({
name: "michigan_logo.png",
height: 2.47,
width: 2.6,
horizontalOffset: 25.59,
verticalOffset: 9.54,
});
const imgCEEM = getImage({
name: "ceem_logo.jpg",
height: 1,
width: 3.99,
horizontalOffset: 24.97,
verticalOffset: 12.5,
});
const imgEATE = getImage({
name: "eate_logo.jpg",
height: 2.21,
width: 3.28,
horizontalOffset: 25.54,
verticalOffset: 14.09,
});
@ -118,6 +17,98 @@ const imgEATE = getImage({
* @returns A buffer of the DOCX document * @returns A buffer of the DOCX document
*/ */
export async function matpelCert(props: CertData<Matpel>): Promise<Document> { export async function matpelCert(props: CertData<Matpel>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado.png",
height: 20.97,
width: 29.8,
horizontalOffset: 0,
verticalOffset: 0,
behindDocument: true,
});
const imgMatpel = getImage({
name: "matpel-logo.png",
height: 2.81,
width: 2.81,
horizontalOffset: 0.7,
verticalOffset: 0.7,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 0.91,
verticalOffset: 3.64,
});
const imgCEE = getImage({
name: "cee_logo.png",
height: 2.22,
width: 3.11,
horizontalOffset: 0.29,
verticalOffset: 18,
});
const imgMTC = getImage({
name: "mtc_logo.png",
height: 1.3,
width: 4.08,
horizontalOffset: 5.13,
verticalOffset: 19.33,
});
const imgEEG = getImage({
name: "eeg_f_logo.png",
height: 4.39,
width: 6.4,
horizontalOffset: 23.35,
verticalOffset: 0,
});
const imgOSHA = getImage({
name: "osha_logo.png",
height: 1.55,
width: 4.46,
horizontalOffset: 24.34,
verticalOffset: 4.95,
});
const imgAguila = getImage({
name: "aguila_logo.png",
height: 2.62,
width: 2.68,
horizontalOffset: 25.45,
verticalOffset: 6.57,
});
const imgMichigan = getImage({
name: "michigan_logo.png",
height: 2.47,
width: 2.6,
horizontalOffset: 25.59,
verticalOffset: 9.54,
});
const imgCEEM = getImage({
name: "ceem_logo.jpg",
height: 1,
width: 3.99,
horizontalOffset: 24.97,
verticalOffset: 12.5,
});
const imgEATE = getImage({
name: "eate_logo.jpg",
height: 2.21,
width: 3.28,
horizontalOffset: 25.54,
verticalOffset: 14.09,
});
const certificateName = new Paragraph({ const certificateName = new Paragraph({
frame: { frame: {
position: { position: {

View File

@ -9,129 +9,131 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_mecanica_basica.jpg",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: 0,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 0.22,
verticalOffset: 16.45,
});
const imgMichigan = getImage({
name: "michigan_logo.png",
height: 1.96,
width: 2.22,
horizontalOffset: 0.31,
verticalOffset: 18.86,
});
const tCertificate = createSimpleText({
xPosition: 7.75,
yPosition: 1.64,
width: 9,
height: 1.56,
text: "CERTIFICADO",
size: 60,
bold: true,
});
// Se expide el presente certificado a:
const tExpediteText = createSimpleText({
xPosition: 0.76,
yPosition: 3.45,
width: 7.88,
height: 1,
text: "Se expide el presente certificado a:",
size: 22,
});
// MECANICA BASICA
const tCourse = createSimpleText({
xPosition: 1.7,
yPosition: 7,
width: 20.08,
height: 1.5,
text: "MECÁNICA BÁSICA",
size: 72,
bold: true,
});
// En los temas de...
const tTopics = createSimpleText({
xPosition: 1.7,
yPosition: 8.9,
width: 19.31,
height: 1.5,
text: "En los temas de: Lineamientos del Ministerio de Transportes y Comunicaciones (MTC), Operatividad efectiva del equipo. Procedimiento de operación correcta. Equipamiento y mantenimiento preventivo, Medidas de Control y Tipos de IPERC, Cuidados de la maquina durante la operación, Uso de pedales y controles, Funcionamiento del motor;",
size: 22,
alignment: AlignmentType.JUSTIFIED,
});
// Con una duracion de...
const tDuration = createSimpleText({
xPosition: 1.7,
yPosition: 11,
width: 19.31,
height: 1,
text: "Con una duración de 12 horas lectivas.",
size: 22,
alignment: AlignmentType.JUSTIFIED,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: 1.52,
yPosition: 11.65,
width: 20.1,
height: 0.8,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
alignment: AlignmentType.CENTER,
italics: true,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.5),
y: cmText(-1.9),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function mecanicaBasicaCert(props: CertData<null>): Promise<Document> { export async function mecanicaBasicaCert(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_mecanica_basica.jpg",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: 0,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 0.22,
verticalOffset: 16.45,
});
const imgMichigan = getImage({
name: "michigan_logo.png",
height: 1.96,
width: 2.22,
horizontalOffset: 0.31,
verticalOffset: 18.86,
});
const tCertificate = createSimpleText({
xPosition: 7.75,
yPosition: 1.64,
width: 9,
height: 1.56,
text: "CERTIFICADO",
size: 60,
bold: true,
});
// Se expide el presente certificado a:
const tExpediteText = createSimpleText({
xPosition: 0.76,
yPosition: 3.45,
width: 7.88,
height: 1,
text: "Se expide el presente certificado a:",
size: 22,
});
// MECANICA BASICA
const tCourse = createSimpleText({
xPosition: 1.7,
yPosition: 7,
width: 20.08,
height: 1.5,
text: "MECÁNICA BÁSICA",
size: 72,
bold: true,
});
// En los temas de...
const tTopics = createSimpleText({
xPosition: 1.7,
yPosition: 8.9,
width: 19.31,
height: 1.5,
text: "En los temas de: Lineamientos del Ministerio de Transportes y Comunicaciones (MTC), Operatividad efectiva del equipo. Procedimiento de operación correcta. Equipamiento y mantenimiento preventivo, Medidas de Control y Tipos de IPERC, Cuidados de la maquina durante la operación, Uso de pedales y controles, Funcionamiento del motor;",
size: 22,
alignment: AlignmentType.JUSTIFIED,
});
// Con una duracion de...
const tDuration = createSimpleText({
xPosition: 1.7,
yPosition: 11,
width: 19.31,
height: 1,
text: "Con una duración de 12 horas lectivas.",
size: 22,
alignment: AlignmentType.JUSTIFIED,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: 1.52,
yPosition: 11.65,
width: 20.1,
height: 0.8,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
alignment: AlignmentType.CENTER,
italics: true,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.5),
y: cmText(-1.9),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const imgQR = await getQR({ const imgQR = await getQR({
iid: props.certIId, iid: props.certIId,
dni: props.personDni, dni: props.personDni,

View File

@ -9,97 +9,100 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function minicargador(props: CertData<null>): Promise<Document> { export async function minicargador(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const hasCustomLabel = (props.certCustomLabel?.length ?? 0) > 0; const hasCustomLabel = (props.certCustomLabel?.length ?? 0) > 0;
const customLabelYOffset = 0.8; const customLabelYOffset = 0.8;

View File

@ -9,137 +9,139 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_manejo_defensivo.png",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: -0.05,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.52,
verticalOffset: 15.24,
});
const imgMTC = getImage({
name: "mtc_2_logo.png",
height: 0.94,
width: 5.14,
horizontalOffset: 1,
verticalOffset: 19.21,
});
const tCertificate = createSimpleText({
xPosition: 2.42,
yPosition: 4.2,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: -1.08,
yPosition: 5.4,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// PRIMEROS AUXILIOS
const tCourse = createSimpleText({
xPosition: -0.44,
yPosition: 8,
width: 20.92,
height: 1.5,
text: "PRIMEROS AUXILIOS",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleText({
xPosition: -0.44,
yPosition: 9.4,
width: 20.92,
height: 1.5,
text: "En temas de: Tres Reglas de Seguridad Básicas (S.S.S.), Primeros Auxilios Psicológico, Inicio de la Cadena de Vida, RCP, Hemorragias Quemaduras, Fracturas, uso de férulas y vendajes, Maniobra de Heimlich, Traslado de Pacientes, Posición lateral de Seguridad PLS, Tratamientos por intoxicación asfixia o ahogamiento, Practicas en Técnicas de Control de Primeros Auxilios, equivalente a 12 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.LEFT,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: -0.44,
yPosition: 11.3,
width: 20.92,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// MTC: R.D.N° ...
const tMTCLabel = createSimpleText({
xPosition: -1.51,
yPosition: 18,
width: 6,
height: 0.75,
text: "R.D.N° 092-2021-MTC/17.03",
size: 24,
font: "Calibri",
alignment: AlignmentType.LEFT,
color: "FFFFFF",
bold: true,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(23.35),
y: cmText(8.3),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function primerosAuxiliosCert(props: CertData<null>): Promise<Document> { export async function primerosAuxiliosCert(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_manejo_defensivo.png",
height: 21.23,
width: 29.8,
horizontalOffset: 0,
verticalOffset: -0.05,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.52,
verticalOffset: 15.24,
});
const imgMTC = getImage({
name: "mtc_2_logo.png",
height: 0.94,
width: 5.14,
horizontalOffset: 1,
verticalOffset: 19.21,
});
const tCertificate = createSimpleText({
xPosition: 2.42,
yPosition: 4.2,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: -1.08,
yPosition: 5.4,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// PRIMEROS AUXILIOS
const tCourse = createSimpleText({
xPosition: -0.44,
yPosition: 8,
width: 20.92,
height: 1.5,
text: "PRIMEROS AUXILIOS",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleText({
xPosition: -0.44,
yPosition: 9.4,
width: 20.92,
height: 1.5,
text: "En temas de: Tres Reglas de Seguridad Básicas (S.S.S.), Primeros Auxilios Psicológico, Inicio de la Cadena de Vida, RCP, Hemorragias Quemaduras, Fracturas, uso de férulas y vendajes, Maniobra de Heimlich, Traslado de Pacientes, Posición lateral de Seguridad PLS, Tratamientos por intoxicación asfixia o ahogamiento, Practicas en Técnicas de Control de Primeros Auxilios, equivalente a 12 horas lectivas.",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.LEFT,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: -0.44,
yPosition: 11.3,
width: 20.92,
height: 0.75,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Times New Roman",
alignment: AlignmentType.CENTER,
});
// MTC: R.D.N° ...
const tMTCLabel = createSimpleText({
xPosition: -1.51,
yPosition: 18,
width: 6,
height: 0.75,
text: "R.D.N° 092-2021-MTC/17.03",
size: 24,
font: "Calibri",
alignment: AlignmentType.LEFT,
color: "FFFFFF",
bold: true,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(23.35),
y: cmText(8.3),
},
width: cmText(2.81),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const imgQR = await getQR({ const imgQR = await getQR({
iid: props.certIId, iid: props.certIId,
dni: props.personDni, dni: props.personDni,

View File

@ -9,97 +9,99 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function retroexcavadora(props: CertData<null>): Promise<Document> { export async function retroexcavadora(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const hasCustomLabel = (props.certCustomLabel?.length ?? 0) > 0; const hasCustomLabel = (props.certCustomLabel?.length ?? 0) > 0;
const customLabelYOffset = 0.8; const customLabelYOffset = 0.8;

View File

@ -9,132 +9,134 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_seg_op_maq_pes.png",
height: 21.02,
width: 29.63,
horizontalOffset: 0.03,
verticalOffset: 0.04,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.02,
width: 2.02,
horizontalOffset: 25.53,
verticalOffset: 14.17,
});
const imgMundomaq = getImage({
name: "mundo_maq.png",
height: 4.82,
width: 6.73,
horizontalOffset: 20.87,
verticalOffset: 0.9,
});
const imgHazescorp = getImage({
name: "logo_hazescorp.png",
height: 2.95,
width: 3.33,
horizontalOffset: 0.4,
verticalOffset: 17.73,
});
const imgEEG = getImage({
name: "eeg_logo.png",
height: 2.38,
width: 4.94,
horizontalOffset: 1.66,
verticalOffset: 1.6,
});
// SEGURIDAD EN LA OPERACIÓN DE MAQUINARIA PESADA
const tCourse = createSimpleText({
xPosition: 5.5,
yPosition: 6.65,
width: 12.83,
height: 1.5,
text: "SEGURIDAD EN LA OPERACIÓN DE MAQUINARIA PESADA",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleText({
xPosition: 1.65,
yPosition: 8.9,
width: 20.42,
height: 1.5,
text: "En los temas de: Seguridad en maquinaria pesada, IPERC, Prevención de riesgos con Maquinas, Medidas de prevención con máquinas en movimientos de tierra, Seguridad en la operación, Procedimiento de mantenimiento, Correcto llenado de IPERC, Correcto llenado de Check List, Mantenimiento Preventivo, predictivo, correctivo.",
size: 22,
font: "Arial",
alignment: AlignmentType.JUSTIFIED,
});
// Con una duracion...
const tHours = createSimpleText({
xPosition: 1.65,
yPosition: 10.7,
width: 13.15,
height: 0.5,
text: "Con una duración de 36 horas lectivas",
size: 22,
font: "Arial",
alignment: AlignmentType.LEFT,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: 5.3,
yPosition: 11.5,
width: 13.15,
height: 0.5,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Arial",
italics: true,
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(22.62),
y: cmText(7),
},
height: cmText(3.57),
width: cmText(2.81),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function segOpMaqPesCert(props: CertData<null>): Promise<Document> { export async function segOpMaqPesCert(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_seg_op_maq_pes.png",
height: 21.02,
width: 29.63,
horizontalOffset: 0.03,
verticalOffset: 0.04,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.02,
width: 2.02,
horizontalOffset: 25.53,
verticalOffset: 14.17,
});
const imgMundomaq = getImage({
name: "mundo_maq.png",
height: 4.82,
width: 6.73,
horizontalOffset: 20.87,
verticalOffset: 0.9,
});
const imgHazescorp = getImage({
name: "logo_hazescorp.png",
height: 2.95,
width: 3.33,
horizontalOffset: 0.4,
verticalOffset: 17.73,
});
const imgEEG = getImage({
name: "eeg_logo.png",
height: 2.38,
width: 4.94,
horizontalOffset: 1.66,
verticalOffset: 1.6,
});
// SEGURIDAD EN LA OPERACIÓN DE MAQUINARIA PESADA
const tCourse = createSimpleText({
xPosition: 5.5,
yPosition: 6.65,
width: 12.83,
height: 1.5,
text: "SEGURIDAD EN LA OPERACIÓN DE MAQUINARIA PESADA",
size: 44,
bold: true,
});
// En temas de...
const tTopics = createSimpleText({
xPosition: 1.65,
yPosition: 8.9,
width: 20.42,
height: 1.5,
text: "En los temas de: Seguridad en maquinaria pesada, IPERC, Prevención de riesgos con Maquinas, Medidas de prevención con máquinas en movimientos de tierra, Seguridad en la operación, Procedimiento de mantenimiento, Correcto llenado de IPERC, Correcto llenado de Check List, Mantenimiento Preventivo, predictivo, correctivo.",
size: 22,
font: "Arial",
alignment: AlignmentType.JUSTIFIED,
});
// Con una duracion...
const tHours = createSimpleText({
xPosition: 1.65,
yPosition: 10.7,
width: 13.15,
height: 0.5,
text: "Con una duración de 36 horas lectivas",
size: 22,
font: "Arial",
alignment: AlignmentType.LEFT,
});
// Se expide certificado...
const tFinishLabel = createSimpleText({
xPosition: 5.3,
yPosition: 11.5,
width: 13.15,
height: 0.5,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Arial",
italics: true,
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(22.62),
y: cmText(7),
},
height: cmText(3.57),
width: cmText(2.81),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const imgQR = await getQR({ const imgQR = await getQR({
iid: props.certIId, iid: props.certIId,
dni: props.personDni, dni: props.personDni,

View File

@ -9,191 +9,193 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_super_escolta.png",
height: 20.99,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0,
behindDocument: true,
});
const imgEEG = getImage({
name: "eeg_f_logo.png",
height: 4.39,
width: 6.4,
horizontalOffset: 1.19,
verticalOffset: 0.94,
});
const imgEATE = getImage({
name: "eate_logo.jpg",
height: 2.28,
width: 3.39,
horizontalOffset: 0.94,
verticalOffset: 15.67,
});
const imgMTC = getImage({
name: "mtc_logo.png",
height: 1.6,
width: 5,
horizontalOffset: 0.9,
verticalOffset: 18.3,
});
const imgOSHA = getImage({
name: "osha_logo.png",
height: 1.99,
width: 5.72,
horizontalOffset: 22.58,
verticalOffset: 1.29,
});
const imgMatpelTransparent = getImage({
name: "logo_matpel_transparente.png",
height: 18.63,
width: 18.63,
horizontalOffset: 5.38,
verticalOffset: 1.38,
});
const tCertificate = createSimpleTextP({
xPosition: 9.18,
yPosition: 2.91,
width: 11.3,
height: 1.46,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Se expide el presente
const tLabel3 = createSimpleTextP({
xPosition: 11.08,
yPosition: 5.43,
width: 7.74,
height: 0.5,
text: "Se expide el presente a:",
size: 22,
font: "Arial",
});
// SUPERVISOR ESCOLTA MATPEL
const tCourse = createSimpleTextP({
xPosition: 7.28,
yPosition: 8.75,
width: 15.42,
height: 1.5,
text: "SUPERVISOR ESCOLTA MATPEL",
size: 52,
bold: true,
});
// Por haber aprobado la dormacion...
const tLabel2 = createSimpleTextP({
xPosition: 10.93,
yPosition: 7.95,
width: 7.74,
height: 0.6,
text: "Por haber aprobado la formación en el curso",
size: 22,
font: "Arial",
});
// Temas tratados...
const tTopics = createSimpleTextP({
xPosition: 5.04,
yPosition: 10.3,
width: 19.34,
height: 1.5,
text: "Temas tratados: Inspección de Unidades y Llenado de Herramientas de Gestión Check List, IPERC, Inspección básica de Kit de Emergencias, Parada de Controles e Inspección, Delimitación y Evaluación del Evento, Sistemas de Comando de Incidentes, Practicas Reales en caso de Derrames de MATPEL con Trajes, Evacuación de Pacientes Afectados con Camioneta, Primeros Auxilios básico, Con una duración de 36 horas lectivas.",
size: 22,
font: "Arial",
alignment: AlignmentType.JUSTIFIED,
});
// Respaldado por:
const tHours = createSimpleTextP({
xPosition: 1.15,
yPosition: 15,
width: 3.07,
height: 0.5,
text: "Respaldado por:",
size: 22,
font: "Arial",
italics: true,
alignment: AlignmentType.LEFT,
});
// Chile
const tChile = createSimpleTextP({
xPosition: 3.07,
yPosition: 17.83,
width: 1.43,
height: 0.5,
text: "CHILE",
size: 22,
font: "Times New Roman",
bold: true,
alignment: AlignmentType.LEFT,
});
// Se expide certificado...
const tFinishLabel = createSimpleTextP({
xPosition: 8.22,
yPosition: 12.68,
width: 13.15,
height: 0.5,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Arial",
italics: true,
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(25),
y: cmText(5.2),
},
height: cmText(3.57),
width: cmText(2.81),
anchor: {
horizontal: FrameAnchorType.PAGE,
vertical: FrameAnchorType.PAGE,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
size: 2,
},
bottom: {
style: BorderStyle.DASHED,
size: 2,
},
left: {
style: BorderStyle.DASHED,
size: 2,
},
right: {
style: BorderStyle.DASHED,
size: 2,
},
},
alignment: AlignmentType.LEFT,
});
export async function supervisorEscolta(props: CertData<null>): Promise<Document> { export async function supervisorEscolta(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_super_escolta.png",
height: 20.99,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0,
behindDocument: true,
});
const imgEEG = getImage({
name: "eeg_f_logo.png",
height: 4.39,
width: 6.4,
horizontalOffset: 1.19,
verticalOffset: 0.94,
});
const imgEATE = getImage({
name: "eate_logo.jpg",
height: 2.28,
width: 3.39,
horizontalOffset: 0.94,
verticalOffset: 15.67,
});
const imgMTC = getImage({
name: "mtc_logo.png",
height: 1.6,
width: 5,
horizontalOffset: 0.9,
verticalOffset: 18.3,
});
const imgOSHA = getImage({
name: "osha_logo.png",
height: 1.99,
width: 5.72,
horizontalOffset: 22.58,
verticalOffset: 1.29,
});
const imgMatpelTransparent = getImage({
name: "logo_matpel_transparente.png",
height: 18.63,
width: 18.63,
horizontalOffset: 5.38,
verticalOffset: 1.38,
});
const tCertificate = createSimpleTextP({
xPosition: 9.18,
yPosition: 2.91,
width: 11.3,
height: 1.46,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Se expide el presente
const tLabel3 = createSimpleTextP({
xPosition: 11.08,
yPosition: 5.43,
width: 7.74,
height: 0.5,
text: "Se expide el presente a:",
size: 22,
font: "Arial",
});
// SUPERVISOR ESCOLTA MATPEL
const tCourse = createSimpleTextP({
xPosition: 7.28,
yPosition: 8.75,
width: 15.42,
height: 1.5,
text: "SUPERVISOR ESCOLTA MATPEL",
size: 52,
bold: true,
});
// Por haber aprobado la dormacion...
const tLabel2 = createSimpleTextP({
xPosition: 10.93,
yPosition: 7.95,
width: 7.74,
height: 0.6,
text: "Por haber aprobado la formación en el curso",
size: 22,
font: "Arial",
});
// Temas tratados...
const tTopics = createSimpleTextP({
xPosition: 5.04,
yPosition: 10.3,
width: 19.34,
height: 1.5,
text: "Temas tratados: Inspección de Unidades y Llenado de Herramientas de Gestión Check List, IPERC, Inspección básica de Kit de Emergencias, Parada de Controles e Inspección, Delimitación y Evaluación del Evento, Sistemas de Comando de Incidentes, Practicas Reales en caso de Derrames de MATPEL con Trajes, Evacuación de Pacientes Afectados con Camioneta, Primeros Auxilios básico, Con una duración de 36 horas lectivas.",
size: 22,
font: "Arial",
alignment: AlignmentType.JUSTIFIED,
});
// Respaldado por:
const tHours = createSimpleTextP({
xPosition: 1.15,
yPosition: 15,
width: 3.07,
height: 0.5,
text: "Respaldado por:",
size: 22,
font: "Arial",
italics: true,
alignment: AlignmentType.LEFT,
});
// Chile
const tChile = createSimpleTextP({
xPosition: 3.07,
yPosition: 17.83,
width: 1.43,
height: 0.5,
text: "CHILE",
size: 22,
font: "Times New Roman",
bold: true,
alignment: AlignmentType.LEFT,
});
// Se expide certificado...
const tFinishLabel = createSimpleTextP({
xPosition: 8.22,
yPosition: 12.68,
width: 13.15,
height: 0.5,
text: "Se expide el presente certificado para los fines que se estime conveniente",
size: 22,
font: "Arial",
italics: true,
alignment: AlignmentType.CENTER,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(25),
y: cmText(5.2),
},
height: cmText(3.57),
width: cmText(2.81),
anchor: {
horizontal: FrameAnchorType.PAGE,
vertical: FrameAnchorType.PAGE,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
size: 2,
},
bottom: {
style: BorderStyle.DASHED,
size: 2,
},
left: {
style: BorderStyle.DASHED,
size: 2,
},
right: {
style: BorderStyle.DASHED,
size: 2,
},
},
alignment: AlignmentType.LEFT,
});
const imgQR = await getQR({ const imgQR = await getQR({
iid: props.certIId, iid: props.certIId,
dni: props.personDni, dni: props.personDni,

View File

@ -9,97 +9,99 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function tractorOruga(props: CertData<null>): Promise<Document> { export async function tractorOruga(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const hasCustomLabel = (props.certCustomLabel?.length ?? 0) > 0; const hasCustomLabel = (props.certCustomLabel?.length ?? 0) > 0;
const customLabelYOffset = 0.8; const customLabelYOffset = 0.8;

View File

@ -9,97 +9,99 @@ const {
BorderStyle, BorderStyle,
} = window.docx; } = window.docx;
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
export async function volquete(props: CertData<null>): Promise<Document> { export async function volquete(props: CertData<null>): Promise<Document> {
const imgFondoDoc = getImage({
name: "fondo_certificado_4x4.png",
height: 21.03,
width: 29.69,
horizontalOffset: 0,
verticalOffset: 0.01,
behindDocument: true,
});
const imgCIP = getImage({
name: "colegio_ingenieros_logo.png",
height: 2.15,
width: 2.15,
horizontalOffset: 26.76,
verticalOffset: 12.26,
});
const imgCEE = getImage({
name: "cee_dark_logo.png",
height: 1.5,
width: 2.1,
horizontalOffset: 26.89,
verticalOffset: 17.06,
});
const imgMTC = getImage({
name: "mtc_transparente.png",
height: 1.65,
width: 5.16,
horizontalOffset: 23.92,
verticalOffset: 18.83,
});
const tCertificate = createSimpleText({
xPosition: 7.7,
yPosition: 3.7,
width: 11.05,
height: 1.72,
text: "CERTIFICADO",
size: 72,
font: "Times New Roman",
bold: true,
});
// Otorgado a
const tExpediteText = createSimpleText({
xPosition: 4.2,
yPosition: 5.5,
width: 3,
height: 0.7,
text: "Otorgado a:",
size: 22,
});
// Recuadro de foto
const photoSection = new Paragraph({
frame: {
position: {
x: cmText(-1.68),
y: cmText(8.6),
},
width: cmText(2.7),
height: cmText(3.57),
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
},
children: [],
border: {
top: {
style: BorderStyle.DASHED,
},
bottom: {
style: BorderStyle.DASHED,
},
left: {
style: BorderStyle.DASHED,
},
right: {
style: BorderStyle.DASHED,
},
},
alignment: AlignmentType.LEFT,
});
const hasCustomLabel = (props.certCustomLabel?.length ?? 0) > 0; const hasCustomLabel = (props.certCustomLabel?.length ?? 0) > 0;
const customLabelYOffset = 0.8; const customLabelYOffset = 0.8;

View File

@ -14,10 +14,6 @@ function isoDateToLocalDate(date: string): string {
return `${day}/${month}`; return `${day}/${month}`;
} }
function wait(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
// TODO: Refactor // TODO: Refactor
export function RegisterPreview(props: {selections: Array<RegistrationPreview>, personId: number | null, onDelete: (v: number) => void, onRegister: () => void}) { export function RegisterPreview(props: {selections: Array<RegistrationPreview>, personId: number | null, onDelete: (v: number) => void, onRegister: () => void}) {
const [error, setError] = createSignal(""); const [error, setError] = createSignal("");