Search code examples
javascripthtmljspdf

Documentation for jsPDF that actually tells me the options I can set?


I'm having trouble learning anything from the documentation, how am I supposed to know which options exists in for example the .html method? It only says I can add an options object, but doesn't say what those options can be. What am I missing here?


Solution

  • As a possible alternative to find out, you can follow a source link for particular method (Documentation) to see the code. In this case it's:

    https://rawgit.com/MrRio/jsPDF/master/docs/modules_html.js.html#line749

    This is what options object can be:

    options = options || {};
    options.callback = options.callback || function () {};
    options.html2canvas = options.html2canvas || {};
    options.html2canvas.canvas = options.html2canvas.canvas || 
    this.canvas;
    options.jsPDF = options.jsPDF || this;