Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda