We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export the type HookData from the library so that we can use it?
// eslint-disable-next-line new-cap const doc = new jsPDF() // Define the header and footer content const header = () => { doc.setFontSize(14) doc.text('Company Name: Alem Expect Solution', 14, 22) // Custom header doc.text( 'Address: Addis Ababa Ethiopia, Gerji Mebrat Hail, Mag Building 204 office', 14, 27, ) // Custom footer } // Define the footer content const footer = (pdfdata: HookData) => { // const pageCount = doc.internal.getNumberOfPages() // const pageCount = doc.internal.pages.length - 1 const pageCount = doc.getNumberOfPages() doc.setFontSize(10) doc.text( `Page ${pdfdata.pageNumber} of ${pageCount}`, pdfdata.settings.margin.left, doc.internal.pageSize.height - 10, ) // Footer with page count } // Safely map over data rows or use an empty array if data is undefined const dataRows = data?.data?.map((row) => columns.map((col) => { const accessor = col.accessorKey as keyof FinanceReportType // Assert accessorKey as a key of FinanceReportType return accessor ? row[accessor] : '' }), ) || [] // Create the table with data autoTable(doc, { head: [columns.map((c) => c.header)], // Table header body: dataRows, // Table body startY: 40, // Start the table below the header didDrawPage: (pdfdata) => { header() // Add header when drawing the page footer(pdfdata) // Add footer when drawing the page }, }) // Save the PDF to the browser doc.save('example.pdf')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
export the type HookData from the library so that we can use it?
The text was updated successfully, but these errors were encountered: