Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
pdfmake with Typescript/In StencilJS Project

I am using pdf maker in my StencilJs app using the official Documentation at https://pdfmake.github.io/docs/0.1/getting-started/client-side/ First of all, I have installed it via npm using:

npm install pdfmake

Then I have created the following to test the functionality:

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);
}

}

This code does not work and in the class My-Messages where I instantiate this class, I keep on getting the following 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

How can I solve this error?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda