i am trying to create a pdf generator that will export json data into specific parts of a pdf template ( the template will always be the same, I just want to change generate multiple pdfs ).
I tried using reactpdf but didn’t know how to impliment the solution
any suggestions ?
import React,{PureComponent} from "react";
import jsPDF from 'jspdf';
export default class pdfGenerator extends PureComponent{
constructor(props) {
super(props)
this.state ={
}
}
jsPdfGenerator=()=>{
var doc= new jsPDF('p','pt') ;
doc.text(20,20,'yes')
doc.save("generated.pdf");
}
render(){
return ( <button onClick={this.jsPdfGenerator}click here
</button> )
}
}