Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
pdfmake con Typescript/In StencilJS Project

Estoy usando pdf maker en mi aplicación StencilJs usando la documentación oficial enhttps://pdfmake.github.io/docs/0.1/getting-started/client-side/ En primer lugar, lo instalé a través de npm usando:

 npm install pdfmake

Luego he creado lo siguiente para probar la funcionalidad:

 import * as pdfMake from 'pdfmake/build/pdfmake'; import * as pdfFonts from 'pdfmake/build/vfs_fonts'; (<any>pdfMake).vfs = pdfFonts.pdfMake.vfs; export class PDFCreateService { constructor() { // empty } public createNachrichtPDF(message: string): any { const fileName: string = 'ba-postfach-' + moment(new Date()).format('DD-MM-YYYY'); const docDefinition = { content: [message] }; return pdfMake.createPdf(docDefinition); }

}

Este código no funciona y en la clase My-Messages donde instalo esta clase, sigo recibiendo el siguiente error:

 index-2022e853.js:2706 TypeError: Cannot read properties of undefined (reading 'pdfMake') at my-messages.entry.js:78239 undefined Uncaught (in promise) Error: Constructor for "my-messages#undefined" was not found at initializeComponent

¿Cómo puedo solucionar este error?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!