Reputation: 1
I am trying to insert a SVG to my PDF using NestJS and jsPDF. But I think jsPDF doens't have support for inserting SVGs on server. Is there any way around this someone has found? Would be really helpful.
I have made a addImage function that is working as expected and inserting the image:
addImage = (imageData: Buffer, options?: any): void => {
this.doc.addImage(
imageData,
'JPEG',
options?.x || this.x,
options?.y || this.y,
options?.width || this.doc.internal.pageSize.getWidth(),
options?.height || this.doc.internal.pageSize.getHeight(),
);
this.y =
options?.height ||
this.doc.internal.pageSize.getHeight() + this.doc.getLineHeight();
this.updatePointer();
};
But the addSvgAsImage (as per the jsPDF docs jsPDF Docs: SVG) function doesn't seem to work
Upvotes: 0
Views: 113
Reputation: 46
This issue has been resolved in jsPDF already if your dont find your answer yet check the link below How to add SVG to PDF
Upvotes: 0