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 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/modules/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,14 +969,24 @@ 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 {boolean} [options.enableLinks] should links work in the HTML when added to the PDF
aaron-russell marked this conversation as resolved.
Show resolved Hide resolved
* @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
2 changes: 2 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ declare module "jspdf" {
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