nestjs-html-to-pdf
v0.0.1
Published
NestJS module that uses puppeteer to render html as pdf.
Downloads
1
Readme
nestjs-html-to-pdf
is a NestJS module that provides uses puppeteer to render html as pdf.
Usage
@Module({
imports: [
PdfModule
],
})
Generating PDF
@Injectable()
export class PdfRenderService {
constructor(private readonly pdfService: PdfService) {}
@Get('')
@ApiResponse({ type: String })
async sendMail(@Param('template') template: string) {
const pdf = await this.mailService.renderFromHtml(<your>);
return new StreamableFile(file, {
disposition: `test.pdf`,
type: 'application/pdf',
});
}
}