

I found react-pdf but it doesn't have the types for TypeScript yet, so I'm using it as I show below: let Document = require('react-pdf') Ĭlass PdfViewer extends React.Component īut I doubt the error is here but I can't figure out what could be. I chose PDFKit because it’s popular and it doesn’t require high-overhead dependencies such as a headless web browser. Unfortunately, as of V0.7 (Nov 2014), PDFKit does not support drawing SVG content to the PDF.
#PDFKIT TYPESCRIPT PDF#
There are a ton of libraries within the JavaScript/TypeScript ecosystem to generate PDF files.

Also you can provide modified custom version of node.d.ts in your custom typing root. In your custom type root you can create index.d.ts file with ///references to typyngs from types (except node.d.ts). In this case types folder won't be used for finding types anymore. I'm trying to use a npm library that help me to render a pdf document. This guide covers using PDFKit in a NestJS API to generate a PDF and send it back to a client. Set typeRoots explicitly in your tsconfig.json.
