How to use the jspdf.autoTableSetDefaults function in jspdf

To help you get started, we’ve selected a few jspdf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github simonbengtsson / jsPDF-AutoTable / src / main.ts View on Github external
resetState();
    return this;
}
jsPDF.API.autoTable = autoTable;

// Assign false to enable `doc.lastAutoTable.finalY || 40` sugar;
jsPDF.API.lastAutoTable = false;
jsPDF.API.previousAutoTable = false; // deprecated in v3
jsPDF.API.autoTable.previous = false; // deprecated in v3

jsPDF.API.autoTableSetDefaults = function(defaults) {
    setDefaults(defaults, this);
    return this;
};

jsPDF.autoTableSetDefaults = function(defaults, doc) {
    setDefaults(defaults, doc);
    return this;
};

jsPDF.API.autoTableHtmlToJson = function(tableElem, includeHiddenElements) {
    includeHiddenElements = includeHiddenElements || false;

    if (!tableElem || !(tableElem instanceof HTMLTableElement)) {
        console.error("A HTMLTableElement has to be sent to autoTableHtmlToJson");
        return null;
    }

    let {head, body, foot} = parseHtml(tableElem, includeHiddenElements, false);
    let firstRow = head[0] || body[0] || foot[0];

    return {columns: firstRow, rows: body, data: body};
github simonbengtsson / jsPDF-AutoTable / src / main.ts View on Github external
resetState();
    return this;
}
jsPDF.API.autoTable = autoTable;

// Assign false to enable `doc.lastAutoTable.finalY || 40` sugar;
jsPDF.API.lastAutoTable = false;
jsPDF.API.previousAutoTable = false; // deprecated in v3
jsPDF.API.autoTable.previous = false; // deprecated in v3

jsPDF.API.autoTableSetDefaults = function(defaults) {
    setDefaults(defaults, this);
    return this;
};

jsPDF.autoTableSetDefaults = function(defaults, doc) {
    setDefaults(defaults, doc);
    return this;
};

jsPDF.API.autoTableHtmlToJson = function(tableElem, includeHiddenElements) {
    includeHiddenElements = includeHiddenElements || false;

    if (!tableElem || !(tableElem instanceof HTMLTableElement)) {
        console.error("A HTMLTableElement has to be sent to autoTableHtmlToJson");
        return null;
    }

    let {head, body, foot} = parseHtml(tableElem, includeHiddenElements, false);
    let firstRow = head[0] || body[0] || foot[0];

    return {columns: firstRow, rows: body, data: body};

jspdf

PDF Document creation from JavaScript

MIT
Latest version published 2 months ago

Package Health Score

97 / 100
Full package analysis