Se agrega titulo a pdf
This commit is contained in:
@@ -21,6 +21,7 @@ export function DownloadPlanPDF({ plan }: { plan: PlanLike }) {
|
|||||||
unit: "mm",
|
unit: "mm",
|
||||||
format: "letter",
|
format: "letter",
|
||||||
})
|
})
|
||||||
|
console.log(plan);
|
||||||
|
|
||||||
const pageWidth = doc.internal.pageSize.getWidth()
|
const pageWidth = doc.internal.pageSize.getWidth()
|
||||||
const pageHeight = doc.internal.pageSize.getHeight()
|
const pageHeight = doc.internal.pageSize.getHeight()
|
||||||
@@ -229,7 +230,7 @@ export function DownloadPlanPDF({ plan }: { plan: PlanLike }) {
|
|||||||
// LICENCIATURA EN INGENIERÍA CIBERNÉTICA Y SISTEMAS COMPUTACIONALES
|
// LICENCIATURA EN INGENIERÍA CIBERNÉTICA Y SISTEMAS COMPUTACIONALES
|
||||||
doc.setFontSize(18)
|
doc.setFontSize(18)
|
||||||
// Manejamos la conversión a string si es necesario
|
// Manejamos la conversión a string si es necesario
|
||||||
const mainTitle = (plan["titulo"] !== null && plan["titulo"] !== undefined ? String(plan["titulo"]) : "LICENCIATURA EN INGENIERÍA CIBERNÉTICA Y SISTEMAS COMPUTACIONALES").toUpperCase()
|
const mainTitle = (plan["nombre"] !== null && plan["nombre"] !== undefined ? String(plan["nombre"]) : "LICENCIATURA EN INGENIERÍA CIBERNÉTICA Y SISTEMAS COMPUTACIONALES").toUpperCase()
|
||||||
const mainTitleLines = doc.splitTextToSize(mainTitle, maxWidth - 20)
|
const mainTitleLines = doc.splitTextToSize(mainTitle, maxWidth - 20)
|
||||||
doc.text(mainTitleLines, pageWidth / 2, cursorY, { align: "center" })
|
doc.text(mainTitleLines, pageWidth / 2, cursorY, { align: "center" })
|
||||||
cursorY += mainTitleLines.length * 8
|
cursorY += mainTitleLines.length * 8
|
||||||
|
|||||||
Reference in New Issue
Block a user