I want to convert ag-grid table to pdf file and export it. For this reason I use "jspdf" library. But now I can't place ag-grid table contents into my pdf.
Here is my ag-grid table portion
<button @click="createPDF">Download PDF</button>
<div ref="content" id="pdfTable" >
<ag-grid-vue
ref="agGridTable"
:components="components"
:gridOptions="gridOptions"
class="ag-theme-material w-100 my-4 ag-grid-table"
:columnDefs="columnDefs"
:defaultColDef="defaultColDef"
:rowData="usersData"
rowSelection="multiple"
colResizeDefault="shift"
:animateRows="true"
:floatingFilter="true"
:pagination="true"
:paginationPageSize="paginationPageSize"
:suppressPaginationPanel="true"
:enableRtl="$vs.rtl">
</ag-grid-vue>
</div>
and in methods: portion
createPDF (){
const doc = new jsPDF();
doc.html(this.$refs.content.innerHTML, {
callback: function (doc) {
doc.save('classroom report.pdf');
},
x: 10,
y: 10
});
},
I can print static text using jspdf, but can't print ag-grid table data. Also Is there any other easy library that I can use to export ag-grid table as pdf?