A small JavaScript plugin to create PDF, XLS, CSV, and DOC files from a JavaScript or DOM-only element from the frontend!
JsObjExporter is a lightweight and fast JS library used to dynamically generate files from a collection of JavaScript objects.
A jQuery Parsing And Displaying CSV Files Plugin | jquery-csv
How to make use of it:
Download the library and load the JavaScript file objectexporter.min.js within the web page.
<script src='objectexporter.min.js'></script>
Or from a CDN.
<script src='https://unpkg.com/[email protected]/dist/objectexporter.min.js'></script>
Prepare your information.
const myData = [{ col1: value 1, col2: value 2 },{ col 3: value 3, col 4: value 4 },{ col 5: value 6, col 5: value 6 }]
Export the info you provide to a CSV, XLS, or PSF file.
objectExporter({ exportable: myData, type: 'xls' // csv, xls, pdf and doc })
Customize the header for CSV export.
objectExporter({ exportable: myData, type: 'csv', headers: [header 1, header 2, ..., header n] })
Customize the file identify of the generated CSV, XLS, or PSF file.
objectExporter({ exportable: myData, type: 'csv', fileName: 'export' })
Customize the header and cell styles. Applicable to Xls, pdf, and doc.
objectExporter({ exportable: myData, type: 'pdf', headerStyle: 'font-size:16px; font-weight:bold;', cellStyle: 'font-size:14px;' })
Customize the sheet identify for XLS export.
objectExporter({ exportable: myData, type: 'xls', sheetName: 'yourname' })
Customize the doc title for pdf and doc export.
objectExporter({ exportable: myData, type: 'pdf', documentTitle: 'Title', documentTitleStyle: 'color: red' })
Determine whether or not or to not repeat headers throughout varied pages.
objectExporter({ exportable: myData, type: 'pdf', repeatHeader: true })
Specify the column separator in CSV export.
objectExporter({ exportable: myData, type: 'csv', columnSeparator: ',' })
Generate CSV, PDF, DOC, And XLS Files From JS Objects, Object Exporter Plugin/Github
See Demo And Download
Official Website(gharibi): Click Here
This superior jQuery/javascript plugin is developed by gharibi. For extra advanced usage, please go to the official website.
Be First to Comment