Skip to content
New issue

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

Added x and y to the type on HTMLOptions #2893

Merged
merged 6 commits into from Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/modules/html.js
Expand Up @@ -969,14 +969,23 @@ import { globalObject } from "../libs/globalObject.js";
* @param {HTMLElement|string} source The source HTMLElement or a string containing HTML.
* @param {Object} [options] Collection of settings
* @param {function} [options.callback] The mandatory callback-function gets as first parameter the current jsPDF instance
* @param {number|array} [options.margin] Array of margins [left, bottom, right, top]
* @param {string} [options.filename] name of the file
* @param {HTMLOptionImage} [options.image] image settings when converting HTML to image
* @param {Html2CanvasOptions} [options.html2canvas] html2canvas options
* @param {jsPDF} [options.jsPDF] jsPDF instance
* @param {number} [options.x] x position on the PDF document
* @param {number} [options.y] y position on the PDF document
*
* @example
* var doc = new jsPDF();
*
* doc.html(document.body, {
* callback: function (doc) {
* doc.save();
* }
* },
* x: 10,
* y: 10
* });
*/
jsPDFAPI.html = function(src, options) {
Expand Down
11 changes: 2 additions & 9 deletions types/index.d.ts
Expand Up @@ -182,22 +182,15 @@ declare module "jspdf" {
quality: number;
}

export interface HTMLOptionPageBreak {
mode?: "avoid-all" | "css" | "legacy" | ("avoid-all" | "css" | "legacy")[];
before?: string;
after?: string;
avoid?: string;
}

export interface HTMLOptions {
callback?: (doc: jsPDF) => void;
margin?: number | number[];
filename?: string;
enableLinks?: boolean;
pagebreak?: HTMLOptionPageBreak;
image?: HTMLOptionImage;
aaron-russell marked this conversation as resolved.
Show resolved Hide resolved
html2canvas?: Html2CanvasOptions;
jsPDF?: jsPDF;
x?: number;
y?: number;
}

//jsPDF plugin: viewerPreferences
Expand Down