diff --git a/dist/jspdf.debug.js b/dist/jspdf.debug.js index 4c0736d16..2404e4f72 100644 --- a/dist/jspdf.debug.js +++ b/dist/jspdf.debug.js @@ -1,13 +1,12 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = global || self, factory(global.jsPDF = {})); -}(this, function (exports) { 'use strict'; +(function (factory) { + typeof define === 'function' && define.amd ? define(factory) : + factory(); +}(function () { 'use strict'; /** @license * jsPDF - PDF Document creation from JavaScript - * Version 1.5.2 Built on 2018-12-20T15:49:00.470Z - * CommitID 81f5c40ca4 + * Version 1.5.3 Built on 2018-12-26T22:17:53.465Z + * CommitID 5533a7bbbc * * Copyright (c) 2010-2016 James Hall , https://github.com/MrRio/jsPDF * 2010 Aaron Spike, https://github.com/acspike @@ -47,10 +46,10 @@ return _typeof(obj); } - /** - * JavaScript Polyfill functions for jsPDF - * Collected from public resources by - * https://github.com/diegocr + /** + * JavaScript Polyfill functions for jsPDF + * Collected from public resources by + * https://github.com/diegocr */ (function (global) { if (_typeof(global.console) !== "object") { @@ -358,327 +357,37 @@ // while `this` is nsIContentFrameMessageManager // with an attribute `content` that corresponds to the window - (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory() : typeof define === 'function' && define.amd ? define(factory) : factory(); - })(window, function () { - /** - * @this {Promise} - */ - - function finallyConstructor(callback) { - var constructor = this.constructor; - return this.then(function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, function (reason) { - return constructor.resolve(callback()).then(function () { - return constructor.reject(reason); - }); - }); - } // Store setTimeout reference so promise-polyfill will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - - - var setTimeoutFunc = setTimeout; - - function noop() {} // Polyfill for Function.prototype.bind - - - function bind(fn, thisArg) { - return function () { - fn.apply(thisArg, arguments); - }; - } - /** - * @constructor - * @param {Function} fn - */ - - - function Promise(fn) { - if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new'); - if (typeof fn !== 'function') throw new TypeError('not a function'); - /** @type {!number} */ - - this._state = 0; - /** @type {!boolean} */ - - this._handled = false; - /** @type {Promise|undefined} */ - - this._value = undefined; - /** @type {!Array} */ - - this._deferreds = []; - doResolve(fn, this); - } - - function handle(self, deferred) { - while (self._state === 3) { - self = self._value; - } - - if (self._state === 0) { - self._deferreds.push(deferred); - - return; - } - - self._handled = true; - - Promise._immediateFn(function () { - var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; - - if (cb === null) { - (self._state === 1 ? resolve : reject)(deferred.promise, self._value); - return; - } - - var ret; - - try { - ret = cb(self._value); - } catch (e) { - reject(deferred.promise, e); - return; - } - - resolve(deferred.promise, ret); - }); - } - - function resolve(self, newValue) { - try { - // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure - if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.'); - - if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { - var then = newValue.then; - - if (newValue instanceof Promise) { - self._state = 3; - self._value = newValue; - finale(self); - return; - } else if (typeof then === 'function') { - doResolve(bind(then, newValue), self); - return; - } - } - - self._state = 1; - self._value = newValue; - finale(self); - } catch (e) { - reject(self, e); - } - } - - function reject(self, newValue) { - self._state = 2; - self._value = newValue; - finale(self); - } - - function finale(self) { - if (self._state === 2 && self._deferreds.length === 0) { - Promise._immediateFn(function () { - if (!self._handled) { - Promise._unhandledRejectionFn(self._value); - } - }); - } - - for (var i = 0, len = self._deferreds.length; i < len; i++) { - handle(self, self._deferreds[i]); - } - - self._deferreds = null; - } - /** - * @constructor - */ - - - function Handler(onFulfilled, onRejected, promise) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.promise = promise; - } - /** - * Take a potentially misbehaving resolver function and make sure - * onFulfilled and onRejected are only called once. - * - * Makes no guarantees about asynchrony. - */ - - - function doResolve(fn, self) { - var done = false; - - try { - fn(function (value) { - if (done) return; - done = true; - resolve(self, value); - }, function (reason) { - if (done) return; - done = true; - reject(self, reason); - }); - } catch (ex) { - if (done) return; - done = true; - reject(self, ex); - } - } - - Promise.prototype['catch'] = function (onRejected) { - return this.then(null, onRejected); - }; - - Promise.prototype.then = function (onFulfilled, onRejected) { - // @ts-ignore - var prom = new this.constructor(noop); - handle(this, new Handler(onFulfilled, onRejected, prom)); - return prom; - }; - - Promise.prototype['finally'] = finallyConstructor; - - Promise.all = function (arr) { - return new Promise(function (resolve, reject) { - if (!arr || typeof arr.length === 'undefined') throw new TypeError('Promise.all accepts an array'); - var args = Array.prototype.slice.call(arr); - if (args.length === 0) return resolve([]); - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - - if (typeof then === 'function') { - then.call(val, function (val) { - res(i, val); - }, reject); - return; - } - } - - args[i] = val; - - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - - return new Promise(function (resolve) { - resolve(value); - }); - }; - - Promise.reject = function (value) { - return new Promise(function (resolve, reject) { - reject(value); - }); - }; - - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var i = 0, len = values.length; i < len; i++) { - values[i].then(resolve, reject); - } - }); - }; // Use polyfill for setImmediate for performance gains - - - Promise._immediateFn = typeof setImmediate === 'function' && function (fn) { - setImmediate(fn); - } || function (fn) { - setTimeoutFunc(fn, 0); - }; - - Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { - if (typeof console !== 'undefined' && console) { - console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console - } - }; - /** @suppress {undefinedVars} */ - - - var globalNS = function () { - // the only reliable means to get the global object is - // `Function('return this')()` - // However, this causes CSP violations in Chrome apps. - if (typeof self !== 'undefined') { - return self; - } - - if (typeof window !== 'undefined') { - return window; - } - - if (typeof global !== 'undefined') { - return global; - } - - throw new Error('unable to locate global object'); - }(); - - if (!('Promise' in globalNS)) { - globalNS['Promise'] = Promise; - } else if (!globalNS.Promise.prototype['finally']) { - globalNS.Promise.prototype['finally'] = finallyConstructor; - } - }); - - /** - * Creates new jsPDF document object instance. - * @name jsPDF - * @class - * @param orientation {string/Object} Orientation of the first page. Possible values are "portrait" or "landscape" (or shortcuts "p" (Default), "l").
- * Can also be an options object. - * @param unit {string} Measurement unit to be used when coordinates are specified.
- * Possible values are "pt" (points), "mm" (Default), "cm", "in" or "px". - * @param format {string/Array} The format of the first page. Can be:
- * Default is "a4". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89] - * @returns {jsPDF} jsPDF-instance - * @description - * If the first parameter (orientation) is an object, it will be interpreted as an object of named parameters - * ``` - * { - * orientation: 'p', - * unit: 'mm', - * format: 'a4', - * hotfixes: [] // an array of hotfix strings to enable - * } - * ``` + /** + * Creates new jsPDF document object instance. + * @name jsPDF + * @class + * @param orientation {string/Object} Orientation of the first page. Possible values are "portrait" or "landscape" (or shortcuts "p" (Default), "l").
+ * Can also be an options object. + * @param unit {string} Measurement unit to be used when coordinates are specified.
+ * Possible values are "pt" (points), "mm" (Default), "cm", "in" or "px". + * @param format {string/Array} The format of the first page. Can be:
+ * Default is "a4". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89] + * @returns {jsPDF} jsPDF-instance + * @description + * If the first parameter (orientation) is an object, it will be interpreted as an object of named parameters + * ``` + * { + * orientation: 'p', + * unit: 'mm', + * format: 'a4', + * hotfixes: [] // an array of hotfix strings to enable + * } + * ``` */ var jsPDF = function (global) { - /** - * jsPDF's Internal PubSub Implementation. - * Backward compatible rewritten on 2014 by - * Diego Casorran, https://github.com/diegocr - * - * @class - * @name PubSub - * @ignore + /** + * jsPDF's Internal PubSub Implementation. + * Backward compatible rewritten on 2014 by + * Diego Casorran, https://github.com/diegocr + * + * @class + * @name PubSub + * @ignore */ function PubSub(context) { @@ -747,9 +456,9 @@ return topics; }; } - /** - * @constructor - * @private + /** + * @constructor + * @private */ @@ -875,13 +584,13 @@ fileId = value; return fileId; }; - /** - * @name setFileId - * @memberOf jsPDF - * @function - * @instance - * @param {string} value GUID. - * @returns {jsPDF} + /** + * @name setFileId + * @memberOf jsPDF + * @function + * @instance + * @param {string} value GUID. + * @returns {jsPDF} */ @@ -889,13 +598,13 @@ setFileId(value); return this; }; - /** - * @name getFileId - * @memberOf jsPDF - * @function - * @instance - * - * @returns {string} GUID. + /** + * @name getFileId + * @memberOf jsPDF + * @function + * @instance + * + * @returns {string} GUID. */ @@ -958,13 +667,13 @@ return result; }; - /** - * @name setCreationDate - * @memberOf jsPDF - * @function - * @instance - * @param {Object} date - * @returns {jsPDF} + /** + * @name setCreationDate + * @memberOf jsPDF + * @function + * @instance + * @param {Object} date + * @returns {jsPDF} */ @@ -972,13 +681,13 @@ setCreationDate(date); return this; }; - /** - * @name getCreationDate - * @memberOf jsPDF - * @function - * @instance - * @param {Object} type - * @returns {Object} + /** + * @name getCreationDate + * @memberOf jsPDF + * @function + * @instance + * @param {Object} type + * @returns {Object} */ @@ -1048,29 +757,29 @@ }; var activeFontSize = options.fontSize || 16; - /** - * Sets font size for upcoming text elements. - * - * @param {number} size Font size in points. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setFontSize + /** + * Sets font size for upcoming text elements. + * + * @param {number} size Font size in points. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setFontSize */ var setFontSize = API.__private__.setFontSize = API.setFontSize = function (size) { activeFontSize = size; return this; }; - /** - * Gets the fontsize for upcoming text elements. - * - * @function - * @instance - * @returns {number} - * @memberOf jsPDF - * @name getFontSize + /** + * Gets the fontsize for upcoming text elements. + * + * @function + * @instance + * @returns {number} + * @memberOf jsPDF + * @name getFontSize */ @@ -1079,29 +788,29 @@ }; var R2L = options.R2L || false; - /** - * Set value of R2L functionality. - * - * @param {boolean} value - * @function - * @instance - * @returns {jsPDF} jsPDF-instance - * @memberOf jsPDF - * @name setR2L + /** + * Set value of R2L functionality. + * + * @param {boolean} value + * @function + * @instance + * @returns {jsPDF} jsPDF-instance + * @memberOf jsPDF + * @name setR2L */ var setR2L = API.__private__.setR2L = API.setR2L = function (value) { R2L = value; return this; }; - /** - * Get value of R2L functionality. - * - * @function - * @instance - * @returns {boolean} jsPDF-instance - * @memberOf jsPDF - * @name getR2L + /** + * Get value of R2L functionality. + * + * @function + * @instance + * @returns {boolean} jsPDF-instance + * @memberOf jsPDF + * @name getR2L */ @@ -1160,30 +869,30 @@ var getLayoutMode = API.__private__.getLayoutMode = function () { return layoutMode; }; - /** - * Set the display mode options of the page like zoom and layout. - * - * @name setDisplayMode - * @memberOf jsPDF - * @function - * @instance - * @param {integer|String} zoom You can pass an integer or percentage as - * a string. 2 will scale the document up 2x, '200%' will scale up by the - * same amount. You can also set it to 'fullwidth', 'fullheight', - * 'fullpage', or 'original'. - * - * Only certain PDF readers support this, such as Adobe Acrobat. - * - * @param {string} layout Layout mode can be: 'continuous' - this is the - * default continuous scroll. 'single' - the single page mode only shows one - * page at a time. 'twoleft' - two column left mode, first page starts on - * the left, and 'tworight' - pages are laid out in two columns, with the - * first page on the right. This would be used for books. - * @param {string} pmode 'UseOutlines' - it shows the - * outline of the document on the left. 'UseThumbs' - shows thumbnails along - * the left. 'FullScreen' - prompts the user to enter fullscreen mode. - * - * @returns {jsPDF} + /** + * Set the display mode options of the page like zoom and layout. + * + * @name setDisplayMode + * @memberOf jsPDF + * @function + * @instance + * @param {integer|String} zoom You can pass an integer or percentage as + * a string. 2 will scale the document up 2x, '200%' will scale up by the + * same amount. You can also set it to 'fullwidth', 'fullheight', + * 'fullpage', or 'original'. + * + * Only certain PDF readers support this, such as Adobe Acrobat. + * + * @param {string} layout Layout mode can be: 'continuous' - this is the + * default continuous scroll. 'single' - the single page mode only shows one + * page at a time. 'twoleft' - two column left mode, first page starts on + * the left, and 'tworight' - pages are laid out in two columns, with the + * first page on the right. This would be used for books. + * @param {string} pmode 'UseOutlines' - it shows the + * outline of the document on the left. 'UseThumbs' - shows thumbnails along + * the left. 'FullScreen' - prompts the user to enter fullscreen mode. + * + * @returns {jsPDF} */ @@ -1213,15 +922,15 @@ var getDocumentProperties = API.__private__.getDocumentProperties = function (properties) { return documentProperties; }; - /** - * Adds a properties to the PDF document. - * - * @param {Object} A property_name-to-property_value object structure. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setDocumentProperties + /** + * Adds a properties to the PDF document. + * + * @param {Object} A property_name-to-property_value object structure. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setDocumentProperties */ @@ -1511,7 +1220,7 @@ out('<
  • a0 - a10
  • b0 - b10
  • c0 - c10
  • dl
  • letter
  • government-letter
  • legal
  • junior-legal
  • ledger
  • tabloid
  • credit-card

  • - * Default is "a4". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89] - * @param orientation {string} Orientation of the new page. Possible values are "portrait" or "landscape" (or shortcuts "p" (Default), "l"). - * @function - * @instance - * @returns {jsPDF} - * - * @memberOf jsPDF - * @name addPage + /** + * Adds (and transfers the focus to) new page to the PDF document. + * @param format {String/Array} The format of the new page. Can be:
    + * Default is "a4". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89] + * @param orientation {string} Orientation of the new page. Possible values are "portrait" or "landscape" (or shortcuts "p" (Default), "l"). + * @function + * @instance + * @returns {jsPDF} + * + * @memberOf jsPDF + * @name addPage */ @@ -2399,22 +2114,22 @@ return this; }; - /** - * Adds (and transfers the focus to) new page to the PDF document. - * @function - * @instance - * @returns {jsPDF} - * - * @memberOf jsPDF - * @name setPage - * @param {number} page Switch the active page to the page number specified. - * @example - * doc = jsPDF() - * doc.addPage() - * doc.addPage() - * doc.text('I am on page 3', 10, 10) - * doc.setPage(1) - * doc.text('I am on page 1', 10, 10) + /** + * Adds (and transfers the focus to) new page to the PDF document. + * @function + * @instance + * @returns {jsPDF} + * + * @memberOf jsPDF + * @name setPage + * @param {number} page Switch the active page to the page number specified. + * @example + * doc = jsPDF() + * doc.addPage() + * doc.addPage() + * doc.text('I am on page 3', 10, 10) + * doc.setPage(1) + * doc.text('I am on page 1', 10, 10) */ @@ -2423,14 +2138,14 @@ return this; }; - /** - * @name insertPage - * @memberOf jsPDF - * - * @function - * @instance - * @param {Object} beforePage - * @returns {jsPDF} + /** + * @name insertPage + * @memberOf jsPDF + * + * @function + * @instance + * @param {Object} beforePage + * @returns {jsPDF} */ @@ -2439,14 +2154,14 @@ this.movePage(currentPage, beforePage); return this; }; - /** - * @name movePage - * @memberOf jsPDF - * @function - * @instance - * @param {Object} targetPage - * @param {Object} beforePage - * @returns {jsPDF} + /** + * @name movePage + * @memberOf jsPDF + * @function + * @instance + * @param {Object} targetPage + * @param {Object} beforePage + * @returns {jsPDF} */ @@ -2479,13 +2194,13 @@ return this; }; - /** - * Deletes a page from the PDF. - * @name deletePage - * @memberOf jsPDF - * @function - * @instance - * @returns {jsPDF} + /** + * Deletes a page from the PDF. + * @name deletePage + * @memberOf jsPDF + * @function + * @instance + * @returns {jsPDF} */ @@ -2494,43 +2209,43 @@ return this; }; - /** - * Adds text to page. Supports adding multiline text when 'text' argument is an Array of Strings. - * - * @function - * @instance - * @param {String|Array} text String or array of strings to be added to the page. Each line is shifted one line down per font, spacing settings declared before this call. - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. - * @param {Object} [options] - Collection of settings signaling how the text must be encoded. - * @param {string} [options.align=left] - The alignment of the text, possible values: left, center, right, justify. - * @param {string} [options.baseline=alphabetic] - Sets text baseline used when drawing the text, possible values: alphabetic, ideographic, bottom, top, middle. - * @param {string} [options.angle=0] - Rotate the text counterclockwise. Expects the angle in degree. - * @param {string} [options.charSpace=0] - The space between each letter. - * @param {string} [options.lineHeightFactor=1.15] - The lineheight of each line. - * @param {string} [options.flags] - Flags for to8bitStream. - * @param {string} [options.flags.noBOM=true] - Don't add BOM to Unicode-text. - * @param {string} [options.flags.autoencode=true] - Autoencode the Text. - * @param {string} [options.maxWidth=0] - Split the text by given width, 0 = no split. - * @param {string} [options.renderingMode=fill] - Set how the text should be rendered, possible values: fill, stroke, fillThenStroke, invisible, fillAndAddForClipping, strokeAndAddPathForClipping, fillThenStrokeAndAddToPathForClipping, addToPathForClipping. - * @returns {jsPDF} - * @memberOf jsPDF - * @name text + /** + * Adds text to page. Supports adding multiline text when 'text' argument is an Array of Strings. + * + * @function + * @instance + * @param {String|Array} text String or array of strings to be added to the page. Each line is shifted one line down per font, spacing settings declared before this call. + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {Object} [options] - Collection of settings signaling how the text must be encoded. + * @param {string} [options.align=left] - The alignment of the text, possible values: left, center, right, justify. + * @param {string} [options.baseline=alphabetic] - Sets text baseline used when drawing the text, possible values: alphabetic, ideographic, bottom, top, middle. + * @param {string} [options.angle=0] - Rotate the text counterclockwise. Expects the angle in degree. + * @param {string} [options.charSpace=0] - The space between each letter. + * @param {string} [options.lineHeightFactor=1.15] - The lineheight of each line. + * @param {string} [options.flags] - Flags for to8bitStream. + * @param {string} [options.flags.noBOM=true] - Don't add BOM to Unicode-text. + * @param {string} [options.flags.autoencode=true] - Autoencode the Text. + * @param {string} [options.maxWidth=0] - Split the text by given width, 0 = no split. + * @param {string} [options.renderingMode=fill] - Set how the text should be rendered, possible values: fill, stroke, fillThenStroke, invisible, fillAndAddForClipping, strokeAndAddPathForClipping, fillThenStrokeAndAddToPathForClipping, addToPathForClipping. + * @returns {jsPDF} + * @memberOf jsPDF + * @name text */ var text = API.__private__.text = API.text = function (text, x, y, options) { - /** - * Inserts something like this into PDF - * BT - * /F1 16 Tf % Font name + size - * 16 TL % How many units down for next line in multiline text - * 0 g % color - * 28.35 813.54 Td % position - * (line one) Tj - * T* (line two) Tj - * T* (line three) Tj - * ET + /** + * Inserts something like this into PDF + * BT + * /F1 16 Tf % Font name + size + * 16 TL % How many units down for next line in multiline text + * 0 g % color + * 28.35 813.54 Td % position + * (line one) Tj + * T* (line two) Tj + * T* (line three) Tj + * ET */ //backwardsCompatibility var tmp; // Pre-August-2012 the order of arguments was function(x, y, text, flags) @@ -3019,19 +2734,19 @@ usedFonts[activeFontKey] = true; return scope; }; - /** - * Letter spacing method to print text with gaps - * - * @function - * @instance - * @param {String|Array} text String to be added to the page. - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {number} spacing Spacing (in units declared at inception) - * @returns {jsPDF} - * @memberOf jsPDF - * @name lstext - * @deprecated We'll be removing this function. It doesn't take character width into account. + /** + * Letter spacing method to print text with gaps + * + * @function + * @instance + * @param {String|Array} text String to be added to the page. + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page + * @param {number} spacing Spacing (in units declared at inception) + * @returns {jsPDF} + * @memberOf jsPDF + * @name lstext + * @deprecated We'll be removing this function. It doesn't take character width into account. */ @@ -3041,15 +2756,15 @@ charSpace: charSpace }); }; - /** - * - * @name clip - * @function - * @instance - * @param {string} rule - * @returns {jsPDF} - * @memberOf jsPDF - * @description All .clip() after calling drawing ops with a style argument of null. + /** + * + * @name clip + * @function + * @instance + * @param {string} rule + * @returns {jsPDF} + * @memberOf jsPDF + * @description All .clip() after calling drawing ops with a style argument of null. */ @@ -3067,11 +2782,11 @@ out('n'); }; - /** - * This fixes the previous function clip(). Perhaps the 'stroke path' hack was due to the missing 'n' instruction? - * We introduce the fixed version so as to not break API. - * @param fillRule - * @ignore + /** + * This fixes the previous function clip(). Perhaps the 'stroke path' hack was due to the missing 'n' instruction? + * We introduce the fixed version so as to not break API. + * @param fillRule + * @ignore */ @@ -3100,30 +2815,30 @@ } else if (style === 'FD' || style === 'DF') { op = 'B'; // both } else if (style === 'f' || style === 'f*' || style === 'B' || style === 'B*') { - /* - Allow direct use of these PDF path-painting operators: - - f fill using nonzero winding number rule - - f* fill using even-odd rule - - B fill then stroke with fill using non-zero winding number rule - - B* fill then stroke with fill using even-odd rule + /* + Allow direct use of these PDF path-painting operators: + - f fill using nonzero winding number rule + - f* fill using even-odd rule + - B fill then stroke with fill using non-zero winding number rule + - B* fill then stroke with fill using even-odd rule */ op = style; } return op; }; - /** - * Draw a line on the current page. - * - * @name line - * @function - * @instance - * @param {number} x1 - * @param {number} y1 - * @param {number} x2 - * @param {number} y2 - * @returns {jsPDF} - * @memberOf jsPDF + /** + * Draw a line on the current page. + * + * @name line + * @function + * @instance + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @returns {jsPDF} + * @memberOf jsPDF */ @@ -3134,25 +2849,25 @@ return this.lines([[x2 - x1, y2 - y1]], x1, y1); }; - /** - * Adds series of curves (straight lines or cubic bezier curves) to canvas, starting at `x`, `y` coordinates. - * All data points in `lines` are relative to last line origin. - * `x`, `y` become x1,y1 for first line / curve in the set. - * For lines you only need to specify [x2, y2] - (ending point) vector against x1, y1 starting point. - * For bezier curves you need to specify [x2,y2,x3,y3,x4,y4] - vectors to control points 1, 2, ending point. All vectors are against the start of the curve - x1,y1. - * - * @example .lines([[2,2],[-2,2],[1,1,2,2,3,3],[2,1]], 212,110, [1,1], 'F', false) // line, line, bezier curve, line - * @param {Array} lines Array of *vector* shifts as pairs (lines) or sextets (cubic bezier curves). - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. - * @param {number} scale (Defaults to [1.0,1.0]) x,y Scaling factor for all vectors. Elements can be any floating number Sub-one makes drawing smaller. Over-one grows the drawing. Negative flips the direction. - * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. - * @param {boolean} closed If true, the path is closed with a straight line from the end of the last curve to the starting point. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name lines + /** + * Adds series of curves (straight lines or cubic bezier curves) to canvas, starting at `x`, `y` coordinates. + * All data points in `lines` are relative to last line origin. + * `x`, `y` become x1,y1 for first line / curve in the set. + * For lines you only need to specify [x2, y2] - (ending point) vector against x1, y1 starting point. + * For bezier curves you need to specify [x2,y2,x3,y3,x4,y4] - vectors to control points 1, 2, ending point. All vectors are against the start of the curve - x1,y1. + * + * @example .lines([[2,2],[-2,2],[1,1,2,2,3,3],[2,1]], 212,110, [1,1], 'F', false) // line, line, bezier curve, line + * @param {Array} lines Array of *vector* shifts as pairs (lines) or sextets (cubic bezier curves). + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} scale (Defaults to [1.0,1.0]) x,y Scaling factor for all vectors. Elements can be any floating number Sub-one makes drawing smaller. Over-one grows the drawing. Negative flips the direction. + * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. + * @param {boolean} closed If true, the path is closed with a straight line from the end of the last curve to the starting point. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name lines */ @@ -3228,19 +2943,19 @@ return this; }; - /** - * Adds a rectangle to PDF. - * - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. - * @param {number} w Width (in units declared at inception of PDF document). - * @param {number} h Height (in units declared at inception of PDF document). - * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name rect + /** + * Adds a rectangle to PDF. + * + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} w Width (in units declared at inception of PDF document). + * @param {number} h Height (in units declared at inception of PDF document). + * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name rect */ @@ -3257,21 +2972,21 @@ return this; }; - /** - * Adds a triangle to PDF. - * - * @param {number} x1 Coordinate (in units declared at inception of PDF document) against left edge of the page. - * @param {number} y1 Coordinate (in units declared at inception of PDF document) against upper edge of the page. - * @param {number} x2 Coordinate (in units declared at inception of PDF document) against left edge of the page. - * @param {number} y2 Coordinate (in units declared at inception of PDF document) against upper edge of the page. - * @param {number} x3 Coordinate (in units declared at inception of PDF document) against left edge of the page. - * @param {number} y3 Coordinate (in units declared at inception of PDF document) against upper edge of the page. - * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name triangle + /** + * Adds a triangle to PDF. + * + * @param {number} x1 Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y1 Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} x2 Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y2 Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} x3 Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y3 Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name triangle */ @@ -3287,21 +3002,21 @@ [1, 1], style, true); return this; }; - /** - * Adds a rectangle with rounded corners to PDF. - * - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. - * @param {number} w Width (in units declared at inception of PDF document). - * @param {number} h Height (in units declared at inception of PDF document). - * @param {number} rx Radius along x axis (in units declared at inception of PDF document). - * @param {number} ry Radius along y axis (in units declared at inception of PDF document). - * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name roundedRect + /** + * Adds a rectangle with rounded corners to PDF. + * + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} w Width (in units declared at inception of PDF document). + * @param {number} h Height (in units declared at inception of PDF document). + * @param {number} rx Radius along x axis (in units declared at inception of PDF document). + * @param {number} ry Radius along y axis (in units declared at inception of PDF document). + * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name roundedRect */ @@ -3315,19 +3030,19 @@ [1, 1], style); return this; }; - /** - * Adds an ellipse to PDF. - * - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. - * @param {number} rx Radius along x axis (in units declared at inception of PDF document). - * @param {number} ry Radius along y axis (in units declared at inception of PDF document). - * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name ellipse + /** + * Adds an ellipse to PDF. + * + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} rx Radius along x axis (in units declared at inception of PDF document). + * @param {number} ry Radius along y axis (in units declared at inception of PDF document). + * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name ellipse */ @@ -3349,18 +3064,18 @@ return this; }; - /** - * Adds an circle to PDF. - * - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. - * @param {number} r Radius (in units declared at inception of PDF document). - * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name circle + /** + * Adds an circle to PDF. + * + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} r Radius (in units declared at inception of PDF document). + * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name circle */ @@ -3371,17 +3086,17 @@ return this.ellipse(x, y, r, r, style); }; - /** - * Sets text font face, variant for upcoming text elements. - * See output of jsPDF.getFontList() for possible font names, styles. - * - * @param {string} fontName Font name or family. Example: "times". - * @param {string} fontStyle Font style or variant. Example: "italic". - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setFont + /** + * Sets text font face, variant for upcoming text elements. + * See output of jsPDF.getFontList() for possible font names, styles. + * + * @param {string} fontName Font name or family. Example: "times". + * @param {string} fontStyle Font style or variant. Example: "italic". + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setFont */ @@ -3391,17 +3106,17 @@ }); return this; }; - /** - * Switches font style or variant for upcoming text elements, - * while keeping the font face or family same. - * See output of jsPDF.getFontList() for possible font names, styles. - * - * @param {string} style Font style or variant. Example: "italic". - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setFontStyle + /** + * Switches font style or variant for upcoming text elements, + * while keeping the font face or family same. + * See output of jsPDF.getFontList() for possible font names, styles. + * + * @param {string} style Font style or variant. Example: "italic". + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setFontStyle */ @@ -3410,16 +3125,16 @@ return this; }; - /** - * Returns an object - a tree of fontName to fontStyle relationships available to - * active PDF document. - * - * @public - * @function - * @instance - * @returns {Object} Like {'times':['normal', 'italic', ... ], 'arial':['normal', 'bold', ... ], ... } - * @memberOf jsPDF - * @name getFontList + /** + * Returns an object - a tree of fontName to fontStyle relationships available to + * active PDF document. + * + * @public + * @function + * @instance + * @returns {Object} Like {'times':['normal', 'italic', ... ], 'arial':['normal', 'bold', ... ], ... } + * @memberOf jsPDF + * @name getFontList */ @@ -3444,17 +3159,17 @@ return list; }; - /** - * Add a custom font to the current instance. - * - * @property {string} postScriptName PDF specification full name for the font. - * @property {string} id PDF-document-instance-specific label assinged to the font. - * @property {string} fontStyle Style of the Font. - * @property {Object} encoding Encoding_name-to-Font_metrics_object mapping. - * @function - * @instance - * @memberOf jsPDF - * @name addFont + /** + * Add a custom font to the current instance. + * + * @property {string} postScriptName PDF specification full name for the font. + * @property {string} id PDF-document-instance-specific label assinged to the font. + * @property {string} fontStyle Style of the Font. + * @property {Object} encoding Encoding_name-to-Font_metrics_object mapping. + * @function + * @instance + * @memberOf jsPDF + * @name addFont */ @@ -3465,32 +3180,32 @@ var lineWidth = options.lineWidth || 0.200025; // 2mm - /** - * Sets line width for upcoming lines. - * - * @param {number} width Line width (in units declared at inception of PDF document). - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setLineWidth + /** + * Sets line width for upcoming lines. + * + * @param {number} width Line width (in units declared at inception of PDF document). + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setLineWidth */ var setLineWidth = API.__private__.setLineWidth = API.setLineWidth = function (width) { out((width * k).toFixed(2) + ' w'); return this; }; - /** - * Sets the dash pattern for upcoming lines. - * - * To reset the settings simply call the method without any parameters. - * @param {array} dashArray The pattern of the line, expects numbers. - * @param {number} dashPhase The phase at which the dash pattern starts. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setLineDash + /** + * Sets the dash pattern for upcoming lines. + * + * To reset the settings simply call the method without any parameters. + * @param {array} dashArray The pattern of the line, expects numbers. + * @param {number} dashPhase The phase at which the dash pattern starts. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setLineDash */ @@ -3521,15 +3236,15 @@ var getLineHeight = API.__private__.getLineHeight = API.getLineHeight = function () { return activeFontSize * lineHeightFactor; }; - /** - * Sets the LineHeightFactor of proportion. - * - * @param {number} value LineHeightFactor value. Default: 1.15. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setLineHeightFactor + /** + * Sets the LineHeightFactor of proportion. + * + * @param {number} value LineHeightFactor value. Default: 1.15. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setLineHeightFactor */ @@ -3542,14 +3257,14 @@ return this; }; - /** - * Gets the LineHeightFactor, default: 1.15. - * - * @function - * @instance - * @returns {number} lineHeightFactor - * @memberOf jsPDF - * @name getLineHeightFactor + /** + * Gets the LineHeightFactor, default: 1.15. + * + * @function + * @instance + * @returns {number} lineHeightFactor + * @memberOf jsPDF + * @name getLineHeightFactor */ @@ -3576,56 +3291,56 @@ }; var strokeColor = options.strokeColor || '0 G'; - /** - * Gets the stroke color for upcoming elements. - * - * @function - * @instance - * @returns {string} colorAsHex - * @memberOf jsPDF - * @name getDrawColor + /** + * Gets the stroke color for upcoming elements. + * + * @function + * @instance + * @returns {string} colorAsHex + * @memberOf jsPDF + * @name getDrawColor */ var getStrokeColor = API.__private__.getStrokeColor = API.getDrawColor = function () { return decodeColorString(strokeColor); }; - /** - * Sets the stroke color for upcoming elements. - * - * Depending on the number of arguments given, Gray, RGB, or CMYK - * color space is implied. - * - * When only ch1 is given, "Gray" color space is implied and it - * must be a value in the range from 0.00 (solid black) to to 1.00 (white) - * if values are communicated as String types, or in range from 0 (black) - * to 255 (white) if communicated as Number type. - * The RGB-like 0-255 range is provided for backward compatibility. - * - * When only ch1,ch2,ch3 are given, "RGB" color space is implied and each - * value must be in the range from 0.00 (minimum intensity) to to 1.00 - * (max intensity) if values are communicated as String types, or - * from 0 (min intensity) to to 255 (max intensity) if values are communicated - * as Number types. - * The RGB-like 0-255 range is provided for backward compatibility. - * - * When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each - * value must be a in the range from 0.00 (0% concentration) to to - * 1.00 (100% concentration) - * - * Because JavaScript treats fixed point numbers badly (rounds to - * floating point nearest to binary representation) it is highly advised to - * communicate the fractional numbers as String types, not JavaScript Number type. - * - * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'. - * @param {Number|String} ch2 Color channel value. - * @param {Number|String} ch3 Color channel value. - * @param {Number|String} ch4 Color channel value. - * - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setDrawColor + /** + * Sets the stroke color for upcoming elements. + * + * Depending on the number of arguments given, Gray, RGB, or CMYK + * color space is implied. + * + * When only ch1 is given, "Gray" color space is implied and it + * must be a value in the range from 0.00 (solid black) to to 1.00 (white) + * if values are communicated as String types, or in range from 0 (black) + * to 255 (white) if communicated as Number type. + * The RGB-like 0-255 range is provided for backward compatibility. + * + * When only ch1,ch2,ch3 are given, "RGB" color space is implied and each + * value must be in the range from 0.00 (minimum intensity) to to 1.00 + * (max intensity) if values are communicated as String types, or + * from 0 (min intensity) to to 255 (max intensity) if values are communicated + * as Number types. + * The RGB-like 0-255 range is provided for backward compatibility. + * + * When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each + * value must be a in the range from 0.00 (0% concentration) to to + * 1.00 (100% concentration) + * + * Because JavaScript treats fixed point numbers badly (rounds to + * floating point nearest to binary representation) it is highly advised to + * communicate the fractional numbers as String types, not JavaScript Number type. + * + * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'. + * @param {Number|String} ch2 Color channel value. + * @param {Number|String} ch3 Color channel value. + * @param {Number|String} ch4 Color channel value. + * + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setDrawColor */ @@ -3644,56 +3359,56 @@ }; var fillColor = options.fillColor || '0 g'; - /** - * Gets the fill color for upcoming elements. - * - * @function - * @instance - * @returns {string} colorAsHex - * @memberOf jsPDF - * @name getFillColor + /** + * Gets the fill color for upcoming elements. + * + * @function + * @instance + * @returns {string} colorAsHex + * @memberOf jsPDF + * @name getFillColor */ var getFillColor = API.__private__.getFillColor = API.getFillColor = function () { return decodeColorString(fillColor); }; - /** - * Sets the fill color for upcoming elements. - * - * Depending on the number of arguments given, Gray, RGB, or CMYK - * color space is implied. - * - * When only ch1 is given, "Gray" color space is implied and it - * must be a value in the range from 0.00 (solid black) to to 1.00 (white) - * if values are communicated as String types, or in range from 0 (black) - * to 255 (white) if communicated as Number type. - * The RGB-like 0-255 range is provided for backward compatibility. - * - * When only ch1,ch2,ch3 are given, "RGB" color space is implied and each - * value must be in the range from 0.00 (minimum intensity) to to 1.00 - * (max intensity) if values are communicated as String types, or - * from 0 (min intensity) to to 255 (max intensity) if values are communicated - * as Number types. - * The RGB-like 0-255 range is provided for backward compatibility. - * - * When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each - * value must be a in the range from 0.00 (0% concentration) to to - * 1.00 (100% concentration) - * - * Because JavaScript treats fixed point numbers badly (rounds to - * floating point nearest to binary representation) it is highly advised to - * communicate the fractional numbers as String types, not JavaScript Number type. - * - * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'. - * @param {Number|String} ch2 Color channel value. - * @param {Number|String} ch3 Color channel value. - * @param {Number|String} ch4 Color channel value. - * - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setFillColor + /** + * Sets the fill color for upcoming elements. + * + * Depending on the number of arguments given, Gray, RGB, or CMYK + * color space is implied. + * + * When only ch1 is given, "Gray" color space is implied and it + * must be a value in the range from 0.00 (solid black) to to 1.00 (white) + * if values are communicated as String types, or in range from 0 (black) + * to 255 (white) if communicated as Number type. + * The RGB-like 0-255 range is provided for backward compatibility. + * + * When only ch1,ch2,ch3 are given, "RGB" color space is implied and each + * value must be in the range from 0.00 (minimum intensity) to to 1.00 + * (max intensity) if values are communicated as String types, or + * from 0 (min intensity) to to 255 (max intensity) if values are communicated + * as Number types. + * The RGB-like 0-255 range is provided for backward compatibility. + * + * When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each + * value must be a in the range from 0.00 (0% concentration) to to + * 1.00 (100% concentration) + * + * Because JavaScript treats fixed point numbers badly (rounds to + * floating point nearest to binary representation) it is highly advised to + * communicate the fractional numbers as String types, not JavaScript Number type. + * + * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'. + * @param {Number|String} ch2 Color channel value. + * @param {Number|String} ch3 Color channel value. + * @param {Number|String} ch4 Color channel value. + * + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setFillColor */ @@ -3712,56 +3427,56 @@ }; var textColor = options.textColor || '0 g'; - /** - * Gets the text color for upcoming elements. - * - * @function - * @instance - * @returns {string} colorAsHex - * @memberOf jsPDF - * @name getTextColor + /** + * Gets the text color for upcoming elements. + * + * @function + * @instance + * @returns {string} colorAsHex + * @memberOf jsPDF + * @name getTextColor */ var getTextColor = API.__private__.getTextColor = API.getTextColor = function () { return decodeColorString(textColor); }; - /** - * Sets the text color for upcoming elements. - * - * Depending on the number of arguments given, Gray, RGB, or CMYK - * color space is implied. - * - * When only ch1 is given, "Gray" color space is implied and it - * must be a value in the range from 0.00 (solid black) to to 1.00 (white) - * if values are communicated as String types, or in range from 0 (black) - * to 255 (white) if communicated as Number type. - * The RGB-like 0-255 range is provided for backward compatibility. - * - * When only ch1,ch2,ch3 are given, "RGB" color space is implied and each - * value must be in the range from 0.00 (minimum intensity) to to 1.00 - * (max intensity) if values are communicated as String types, or - * from 0 (min intensity) to to 255 (max intensity) if values are communicated - * as Number types. - * The RGB-like 0-255 range is provided for backward compatibility. - * - * When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each - * value must be a in the range from 0.00 (0% concentration) to to - * 1.00 (100% concentration) - * - * Because JavaScript treats fixed point numbers badly (rounds to - * floating point nearest to binary representation) it is highly advised to - * communicate the fractional numbers as String types, not JavaScript Number type. - * - * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'. - * @param {Number|String} ch2 Color channel value. - * @param {Number|String} ch3 Color channel value. - * @param {Number|String} ch4 Color channel value. - * - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setTextColor + /** + * Sets the text color for upcoming elements. + * + * Depending on the number of arguments given, Gray, RGB, or CMYK + * color space is implied. + * + * When only ch1 is given, "Gray" color space is implied and it + * must be a value in the range from 0.00 (solid black) to to 1.00 (white) + * if values are communicated as String types, or in range from 0 (black) + * to 255 (white) if communicated as Number type. + * The RGB-like 0-255 range is provided for backward compatibility. + * + * When only ch1,ch2,ch3 are given, "RGB" color space is implied and each + * value must be in the range from 0.00 (minimum intensity) to to 1.00 + * (max intensity) if values are communicated as String types, or + * from 0 (min intensity) to to 255 (max intensity) if values are communicated + * as Number types. + * The RGB-like 0-255 range is provided for backward compatibility. + * + * When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each + * value must be a in the range from 0.00 (0% concentration) to to + * 1.00 (100% concentration) + * + * Because JavaScript treats fixed point numbers badly (rounds to + * floating point nearest to binary representation) it is highly advised to + * communicate the fractional numbers as String types, not JavaScript Number type. + * + * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'. + * @param {Number|String} ch2 Color channel value. + * @param {Number|String} ch3 Color channel value. + * @param {Number|String} ch4 Color channel value. + * + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setTextColor */ @@ -3779,28 +3494,28 @@ }; var activeCharSpace = options.charSpace || 0; - /** - * Get global value of CharSpace. - * - * @function - * @instance - * @returns {number} charSpace - * @memberOf jsPDF - * @name getCharSpace + /** + * Get global value of CharSpace. + * + * @function + * @instance + * @returns {number} charSpace + * @memberOf jsPDF + * @name getCharSpace */ var getCharSpace = API.__private__.getCharSpace = API.getCharSpace = function () { return activeCharSpace; }; - /** - * Set global value of CharSpace. - * - * @param {number} charSpace - * @function - * @instance - * @returns {jsPDF} jsPDF-instance - * @memberOf jsPDF - * @name setCharSpace + /** + * Set global value of CharSpace. + * + * @param {number} charSpace + * @function + * @instance + * @returns {jsPDF} jsPDF-instance + * @memberOf jsPDF + * @name setCharSpace */ @@ -3814,13 +3529,13 @@ }; var lineCapID = 0; - /** - * Is an Object providing a mapping from human-readable to - * integer flag values designating the varieties of line cap - * and join styles. - * - * @memberOf jsPDF - * @name CapJoinStyles + /** + * Is an Object providing a mapping from human-readable to + * integer flag values designating the varieties of line cap + * and join styles. + * + * @memberOf jsPDF + * @name CapJoinStyles */ API.CapJoinStyles = { @@ -3838,16 +3553,16 @@ 'square': 2, 'bevel': 2 }; - /** - * Sets the line cap styles. - * See {jsPDF.CapJoinStyles} for variants. - * - * @param {String|Number} style A string or number identifying the type of line cap. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setLineCap + /** + * Sets the line cap styles. + * See {jsPDF.CapJoinStyles} for variants. + * + * @param {String|Number} style A string or number identifying the type of line cap. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setLineCap */ var setLineCap = API.__private__.setLineCap = API.setLineCap = function (style) { @@ -3863,16 +3578,16 @@ }; var lineJoinID = 0; - /** - * Sets the line join styles. - * See {jsPDF.CapJoinStyles} for variants. - * - * @param {String|Number} style A string or number identifying the type of line join. - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setLineJoin + /** + * Sets the line join styles. + * See {jsPDF.CapJoinStyles} for variants. + * + * @param {String|Number} style A string or number identifying the type of line join. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setLineJoin */ var setLineJoin = API.__private__.setLineJoin = API.setLineJoin = function (style) { @@ -3888,15 +3603,15 @@ }; var miterLimit; - /** - * Sets the miterLimit property, which effects the maximum miter length. - * - * @param {number} length The length of the miter - * @function - * @instance - * @returns {jsPDF} - * @memberOf jsPDF - * @name setMiterLimit + /** + * Sets the miterLimit property, which effects the maximum miter length. + * + * @param {number} length The length of the miter + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setMiterLimit */ var setMiterLimit = API.__private__.setMiterLimit = API.setMiterLimit = function (length) { @@ -3910,17 +3625,17 @@ out(miterLimit + ' M'); return this; }; - /** - * Saves as PDF document. An alias of jsPDF.output('save', 'filename.pdf'). - * Uses FileSaver.js-method saveAs. - * - * @memberOf jsPDF - * @name save - * @function - * @instance - * @param {string} filename The filename including extension. - * @param {Object} options An Object with additional options, possible options: 'returnPromise'. - * @returns {jsPDF} jsPDF-instance + /** + * Saves as PDF document. An alias of jsPDF.output('save', 'filename.pdf'). + * Uses FileSaver.js-method saveAs. + * + * @memberOf jsPDF + * @name save + * @function + * @instance + * @param {string} filename The filename including extension. + * @param {Object} options An Object with additional options, possible options: 'returnPromise'. + * @returns {jsPDF} jsPDF-instance */ @@ -3986,10 +3701,10 @@ } } } - /** - * Object exposing internal API to plugins - * @public - * @ignore + /** + * Object exposing internal API to plugins + * @public + * @ignore */ @@ -4083,42 +3798,42 @@ events.publish('initialized'); return API; } - /** - * jsPDF.API is a STATIC property of jsPDF class. - * jsPDF.API is an object you can add methods and properties to. - * The methods / properties you add will show up in new jsPDF objects. - * - * One property is prepopulated. It is the 'events' Object. Plugin authors can add topics, - * callbacks to this object. These will be reassigned to all new instances of jsPDF. - * - * @static - * @public - * @memberOf jsPDF - * @name API - * - * @example - * jsPDF.API.mymethod = function(){ - * // 'this' will be ref to internal API object. see jsPDF source - * // , so you can refer to built-in methods like so: - * // this.line(....) - * // this.text(....) - * } - * var pdfdoc = new jsPDF() - * pdfdoc.mymethod() // <- !!!!!! + /** + * jsPDF.API is a STATIC property of jsPDF class. + * jsPDF.API is an object you can add methods and properties to. + * The methods / properties you add will show up in new jsPDF objects. + * + * One property is prepopulated. It is the 'events' Object. Plugin authors can add topics, + * callbacks to this object. These will be reassigned to all new instances of jsPDF. + * + * @static + * @public + * @memberOf jsPDF + * @name API + * + * @example + * jsPDF.API.mymethod = function(){ + * // 'this' will be ref to internal API object. see jsPDF source + * // , so you can refer to built-in methods like so: + * // this.line(....) + * // this.text(....) + * } + * var pdfdoc = new jsPDF() + * pdfdoc.mymethod() // <- !!!!!! */ jsPDF.API = { events: [] }; - /** - * The version of jsPDF. - * @name version - * @type {string} - * @memberOf jsPDF + /** + * The version of jsPDF. + * @name version + * @type {string} + * @memberOf jsPDF */ - jsPDF.version = '1.5.2'; + jsPDF.version = '1.5.3'; if (typeof define === 'function' && define.amd) { define('jsPDF', function () { @@ -4136,23 +3851,17 @@ // while `this` is nsIContentFrameMessageManager // with an attribute `content` that corresponds to the window - /*rollup-keeper-start*/ - - - window.tmp = jsPDF; - /*rollup-keeper-end*/ - - /** - * @license - * Copyright (c) 2016 Alexander Weidt, - * https://github.com/BiggA94 - * - * Licensed under the MIT License. http://opensource.org/licenses/mit-license + /** + * @license + * Copyright (c) 2016 Alexander Weidt, + * https://github.com/BiggA94 + * + * Licensed under the MIT License. http://opensource.org/licenses/mit-license */ - /** - * jsPDF AcroForm Plugin - * @module AcroForm + /** + * jsPDF AcroForm Plugin + * @module AcroForm */ (function (jsPDFAPI, globalObj) { @@ -4206,8 +3915,8 @@ xobj.BBox = [0, 0, Number(f2(width)), Number(f2(height))]; return xobj; }; - /** - * Bit-Operations + /** + * Bit-Operations */ @@ -4244,8 +3953,8 @@ return (number & 1 << bitPosition) === 0 ? 0 : 1; }; - /* - * Ff starts counting the bit position at 1 and not like javascript at 0 + /* + * Ff starts counting the bit position at 1 and not like javascript at 0 */ @@ -4464,12 +4173,12 @@ returnValue.fontSize = fontSize; return returnValue; }; - /** - * Small workaround for calculating the TextMetric approximately. - * - * @param text - * @param fontsize - * @returns {TextMetrics} (Has Height and Width) + /** + * Small workaround for calculating the TextMetric approximately. + * + * @param text + * @param fontsize + * @returns {TextMetrics} (Has Height and Width) */ @@ -4495,17 +4204,17 @@ fields: [], xForms: [], - /** - * acroFormDictionaryRoot contains information about the AcroForm - * Dictionary 0: The Event-Token, the AcroFormDictionaryCallback has - * 1: The Object ID of the Root + /** + * acroFormDictionaryRoot contains information about the AcroForm + * Dictionary 0: The Event-Token, the AcroFormDictionaryCallback has + * 1: The Object ID of the Root */ acroFormDictionaryRoot: null, - /** - * After the PDF gets evaluated, the reference to the root has to be - * reset, this indicates, whether the root has already been printed - * out + /** + * After the PDF gets evaluated, the reference to the root has to be + * reset, this indicates, whether the root has already been printed + * out */ printedOut: false, internal: null, @@ -4544,9 +4253,9 @@ scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(formObject); }; - /** - * Create the Reference to the widgetAnnotation, so that it gets referenced - * in the Annot[] int the+ (Requires the Annotation Plugin) + /** + * Create the Reference to the widgetAnnotation, so that it gets referenced + * in the Annot[] int the+ (Requires the Annotation Plugin) */ @@ -4575,9 +4284,9 @@ throw new Error('putCatalogCallback: Root missing.'); } }; - /** - * Adds /Acroform X 0 R to Document Catalog, and creates the AcroForm - * Dictionary + /** + * Adds /Acroform X 0 R to Document Catalog, and creates the AcroForm + * Dictionary */ @@ -4587,11 +4296,11 @@ delete scope.internal.acroformPlugin.acroFormDictionaryRoot._eventID; scope.internal.acroformPlugin.printedOut = true; }; - /** - * Creates the single Fields and writes them into the Document - * - * If fieldArray is set, use the fields that are inside it instead of the - * fields from the AcroRoot (for the FormXObjects...) + /** + * Creates the single Fields and writes them into the Document + * + * If fieldArray is set, use the fields that are inside it instead of the + * fields from the AcroRoot (for the FormXObjects...) */ @@ -4813,17 +4522,17 @@ // Classes // ########################## - /** - * @class AcroFormPDFObject - * @classdesc A AcroFormPDFObject + /** + * @class AcroFormPDFObject + * @classdesc A AcroFormPDFObject */ var AcroFormPDFObject = function AcroFormPDFObject() { var _objId; - /** * - * @name AcroFormPDFObject#objId - * @type {any} + /** * + * @name AcroFormPDFObject#objId + * @type {any} */ @@ -4845,8 +4554,8 @@ } }); }; - /** - * @function AcroFormPDFObject.toString + /** + * @function AcroFormPDFObject.toString */ @@ -4862,11 +4571,11 @@ }); scope.internal.out("endobj"); }; - /** - * Returns an key-value-List of all non-configurable Variables from the Object - * - * @name getKeyValueListForStream - * @returns {string} + /** + * Returns an key-value-List of all non-configurable Variables from the Object + * + * @name getKeyValueListForStream + * @returns {string} */ @@ -5006,11 +4715,11 @@ }; inherit(AcroFormDictionary, AcroFormPDFObject); - /** - * The Field Object contains the Variables, that every Field needs - * - * @class AcroFormField - * @classdesc An AcroForm FieldObject + /** + * The Field Object contains the Variables, that every Field needs + * + * @class AcroFormField + * @classdesc An AcroForm FieldObject */ var AcroFormField = function AcroFormField() { @@ -5031,13 +4740,13 @@ } } }); - /** - * (PDF 1.2) If set, print the annotation when the page is printed. If clear, never print the annotation, regardless of wether is is displayed on the screen. - * NOTE 2 This can be useful for annotations representing interactive pushbuttons, which would serve no meaningful purpose on the printed page. - * - * @name AcroFormField#showWhenPrinted - * @default true - * @type {boolean} + /** + * (PDF 1.2) If set, print the annotation when the page is printed. If clear, never print the annotation, regardless of wether is is displayed on the screen. + * NOTE 2 This can be useful for annotations representing interactive pushbuttons, which would serve no meaningful purpose on the printed page. + * + * @name AcroFormField#showWhenPrinted + * @default true + * @type {boolean} */ Object.defineProperty(this, 'showWhenPrinted', { @@ -5088,12 +4797,12 @@ } } }); - /** - * The x-position of the field. - * - * @name AcroFormField#x - * @default null - * @type {number} + /** + * The x-position of the field. + * + * @name AcroFormField#x + * @default null + * @type {number} */ Object.defineProperty(this, 'x', { @@ -5110,12 +4819,12 @@ _Rect[0] = scale(value); } }); - /** - * The y-position of the field. - * - * @name AcroFormField#y - * @default null - * @type {number} + /** + * The y-position of the field. + * + * @name AcroFormField#y + * @default null + * @type {number} */ Object.defineProperty(this, 'y', { @@ -5132,12 +4841,12 @@ _Rect[1] = scale(value); } }); - /** - * The width of the field. - * - * @name AcroFormField#width - * @default null - * @type {number} + /** + * The width of the field. + * + * @name AcroFormField#width + * @default null + * @type {number} */ Object.defineProperty(this, 'width', { @@ -5154,12 +4863,12 @@ _Rect[2] = scale(value); } }); - /** - * The height of the field. - * - * @name AcroFormField#height - * @default null - * @type {number} + /** + * The height of the field. + * + * @name AcroFormField#height + * @default null + * @type {number} */ Object.defineProperty(this, 'height', { @@ -5217,12 +4926,12 @@ _T = value.toString(); } }); - /** - * (Optional) The partial field name (see 12.7.3.2, “Field Names”). - * - * @name AcroFormField#fieldName - * @default null - * @type {string} + /** + * (Optional) The partial field name (see 12.7.3.2, “Field Names”). + * + * @name AcroFormField#fieldName + * @default null + * @type {string} */ Object.defineProperty(this, 'fieldName', { @@ -5236,12 +4945,12 @@ } }); var _fontName = 'helvetica'; - /** - * The fontName of the font to be used. - * - * @name AcroFormField#fontName - * @default 'helvetica' - * @type {string} + /** + * The fontName of the font to be used. + * + * @name AcroFormField#fontName + * @default 'helvetica' + * @type {string} */ Object.defineProperty(this, 'fontName', { @@ -5255,12 +4964,12 @@ } }); var _fontStyle = 'normal'; - /** - * The fontStyle of the font to be used. - * - * @name AcroFormField#fontStyle - * @default 'normal' - * @type {string} + /** + * The fontStyle of the font to be used. + * + * @name AcroFormField#fontStyle + * @default 'normal' + * @type {string} */ Object.defineProperty(this, 'fontStyle', { @@ -5274,12 +4983,12 @@ } }); var _fontSize = 0; - /** - * The fontSize of the font to be used. - * - * @name AcroFormField#fontSize - * @default 0 (for auto) - * @type {number} + /** + * The fontSize of the font to be used. + * + * @name AcroFormField#fontSize + * @default 0 (for auto) + * @type {number} */ Object.defineProperty(this, 'fontSize', { @@ -5293,12 +5002,12 @@ } }); var _maxFontSize = 50; - /** - * The maximum fontSize of the font to be used. - * - * @name AcroFormField#maxFontSize - * @default 0 (for auto) - * @type {number} + /** + * The maximum fontSize of the font to be used. + * + * @name AcroFormField#maxFontSize + * @default 0 (for auto) + * @type {number} */ Object.defineProperty(this, 'maxFontSize', { @@ -5312,12 +5021,12 @@ } }); var _color = 'black'; - /** - * The color of the text - * - * @name AcroFormField#color - * @default 'black' - * @type {string|rgba} + /** + * The color of the text + * + * @name AcroFormField#color + * @default 'black' + * @type {string|rgba} */ Object.defineProperty(this, 'color', { @@ -5376,12 +5085,12 @@ } } }); - /** - * (Optional; inheritable) The default value to which the field reverts when a reset-form action is executed (see 12.7.5.3, “Reset-Form Action”). The format of this value is the same as that of value. - * - * @name AcroFormField#defaultValue - * @default null - * @type {any} + /** + * (Optional; inheritable) The default value to which the field reverts when a reset-form action is executed (see 12.7.5.3, “Reset-Form Action”). The format of this value is the same as that of value. + * + * @name AcroFormField#defaultValue + * @default null + * @type {any} */ Object.defineProperty(this, 'defaultValue', { @@ -5433,12 +5142,12 @@ } } }); - /** - * (Optional; inheritable) The field’s value, whose format varies depending on the field type. See the descriptions of individual field types for further information. - * - * @name AcroFormField#value - * @default null - * @type {any} + /** + * (Optional; inheritable) The field’s value, whose format varies depending on the field type. See the descriptions of individual field types for further information. + * + * @name AcroFormField#value + * @default null + * @type {any} */ Object.defineProperty(this, 'value', { @@ -5461,12 +5170,12 @@ } } }); - /** - * Check if field has annotations - * - * @name AcroFormField#hasAnnotation - * @readonly - * @type {boolean} + /** + * Check if field has annotations + * + * @name AcroFormField#hasAnnotation + * @readonly + * @type {boolean} */ Object.defineProperty(this, 'hasAnnotation', { @@ -5491,12 +5200,12 @@ } }); var _hasAppearanceStream = false; - /** - * true if field has an appearanceStream - * - * @name AcroFormField#hasAppearanceStream - * @readonly - * @type {boolean} + /** + * true if field has an appearanceStream + * + * @name AcroFormField#hasAppearanceStream + * @readonly + * @type {boolean} */ Object.defineProperty(this, 'hasAppearanceStream', { @@ -5511,11 +5220,11 @@ _hasAppearanceStream = value; } }); - /** - * The page on which the AcroFormField is placed - * - * @name AcroFormField#page - * @type {number} + /** + * The page on which the AcroFormField is placed + * + * @name AcroFormField#page + * @type {number} */ var _page; @@ -5535,12 +5244,12 @@ _page = value; } }); - /** - * If set, the user may not change the value of the field. Any associated widget annotations will not interact with the user; that is, they will not respond to mouse clicks or change their appearance in response to mouse motions. This flag is useful for fields whose values are computed or imported from a database. - * - * @name AcroFormField#readOnly - * @default false - * @type {boolean} + /** + * If set, the user may not change the value of the field. Any associated widget annotations will not interact with the user; that is, they will not respond to mouse clicks or change their appearance in response to mouse motions. This flag is useful for fields whose values are computed or imported from a database. + * + * @name AcroFormField#readOnly + * @default false + * @type {boolean} */ Object.defineProperty(this, 'readOnly', { @@ -5557,12 +5266,12 @@ } } }); - /** - * If set, the field shall have a value at the time it is exported by a submitform action (see 12.7.5.2, “Submit-Form Action”). - * - * @name AcroFormField#required - * @default false - * @type {boolean} + /** + * If set, the field shall have a value at the time it is exported by a submitform action (see 12.7.5.2, “Submit-Form Action”). + * + * @name AcroFormField#required + * @default false + * @type {boolean} */ Object.defineProperty(this, 'required', { @@ -5579,12 +5288,12 @@ } } }); - /** - * If set, the field shall not be exported by a submit-form action (see 12.7.5.2, “Submit-Form Action”) - * - * @name AcroFormField#noExport - * @default false - * @type {boolean} + /** + * If set, the field shall not be exported by a submit-form action (see 12.7.5.2, “Submit-Form Action”) + * + * @name AcroFormField#noExport + * @default false + * @type {boolean} */ Object.defineProperty(this, 'noExport', { @@ -5620,13 +5329,13 @@ } } }); - /** - * (Optional; inheritable) A code specifying the form of quadding (justification) that shall be used in displaying the text: - * 'left', 'center', 'right' - * - * @name AcroFormField#textAlign - * @default 'left' - * @type {string} + /** + * (Optional; inheritable) A code specifying the form of quadding (justification) that shall be used in displaying the text: + * 'left', 'center', 'right' + * + * @name AcroFormField#textAlign + * @default 'left' + * @type {string} */ Object.defineProperty(this, 'textAlign', { @@ -5674,9 +5383,9 @@ }; inherit(AcroFormField, AcroFormPDFObject); - /** - * @class AcroFormChoiceField - * @extends AcroFormField + /** + * @class AcroFormChoiceField + * @extends AcroFormField */ var AcroFormChoiceField = function AcroFormChoiceField() { @@ -5698,12 +5407,12 @@ _TI = value; } }); - /** - * (Optional) For scrollable list boxes, the top index (the index in the Opt array of the first option visible in the list). Default value: 0. - * - * @name AcroFormChoiceField#topIndex - * @default 0 - * @type {number} + /** + * (Optional) For scrollable list boxes, the top index (the index in the Opt array of the first option visible in the list). Default value: 0. + * + * @name AcroFormChoiceField#topIndex + * @default 0 + * @type {number} */ Object.defineProperty(this, 'topIndex', { @@ -5727,23 +5436,23 @@ _Opt = pdfArrayToStringArray(value); } }); - /** - * @memberof AcroFormChoiceField - * @name getOptions - * @function - * @instance - * @returns {array} array of Options + /** + * @memberof AcroFormChoiceField + * @name getOptions + * @function + * @instance + * @returns {array} array of Options */ this.getOptions = function () { return _Opt; }; - /** - * @memberof AcroFormChoiceField - * @name setOptions - * @function - * @instance - * @param {array} value + /** + * @memberof AcroFormChoiceField + * @name setOptions + * @function + * @instance + * @param {array} value */ @@ -5754,12 +5463,12 @@ _Opt.sort(); } }; - /** - * @memberof AcroFormChoiceField - * @name addOption - * @function - * @instance - * @param {string} value + /** + * @memberof AcroFormChoiceField + * @name addOption + * @function + * @instance + * @param {string} value */ @@ -5773,13 +5482,13 @@ _Opt.sort(); } }; - /** - * @memberof AcroFormChoiceField - * @name removeOption - * @function - * @instance - * @param {string} value - * @param {boolean} allEntries (default: false) + /** + * @memberof AcroFormChoiceField + * @name removeOption + * @function + * @instance + * @param {string} value + * @param {boolean} allEntries (default: false) */ @@ -5796,12 +5505,12 @@ } } }; - /** - * If set, the field is a combo box; if clear, the field is a list box. - * - * @name AcroFormChoiceField#combo - * @default false - * @type {boolean} + /** + * If set, the field is a combo box; if clear, the field is a list box. + * + * @name AcroFormChoiceField#combo + * @default false + * @type {boolean} */ @@ -5819,12 +5528,12 @@ } } }); - /** - * If set, the combo box shall include an editable text box as well as a drop-down list; if clear, it shall include only a drop-down list. This flag shall be used only if the Combo flag is set. - * - * @name AcroFormChoiceField#edit - * @default false - * @type {boolean} + /** + * If set, the combo box shall include an editable text box as well as a drop-down list; if clear, it shall include only a drop-down list. This flag shall be used only if the Combo flag is set. + * + * @name AcroFormChoiceField#edit + * @default false + * @type {boolean} */ Object.defineProperty(this, 'edit', { @@ -5844,12 +5553,12 @@ } } }); - /** - * If set, the field’s option items shall be sorted alphabetically. This flag is intended for use by writers, not by readers. Conforming readers shall display the options in the order in which they occur in the Opt array (see Table 231). - * - * @name AcroFormChoiceField#sort - * @default false - * @type {boolean} + /** + * If set, the field’s option items shall be sorted alphabetically. This flag is intended for use by writers, not by readers. Conforming readers shall display the options in the order in which they occur in the Opt array (see Table 231). + * + * @name AcroFormChoiceField#sort + * @default false + * @type {boolean} */ Object.defineProperty(this, 'sort', { @@ -5868,12 +5577,12 @@ } } }); - /** - * (PDF 1.4) If set, more than one of the field’s option items may be selected simultaneously; if clear, at most one item shall be selected - * - * @name AcroFormChoiceField#multiSelect - * @default false - * @type {boolean} + /** + * (PDF 1.4) If set, more than one of the field’s option items may be selected simultaneously; if clear, at most one item shall be selected + * + * @name AcroFormChoiceField#multiSelect + * @default false + * @type {boolean} */ Object.defineProperty(this, 'multiSelect', { @@ -5890,12 +5599,12 @@ } } }); - /** - * (PDF 1.4) If set, text entered in the field shall not be spellchecked. This flag shall not be used unless the Combo and Edit flags are both set. - * - * @name AcroFormChoiceField#doNotSpellCheck - * @default false - * @type {boolean} + /** + * (PDF 1.4) If set, text entered in the field shall not be spellchecked. This flag shall not be used unless the Combo and Edit flags are both set. + * + * @name AcroFormChoiceField#doNotSpellCheck + * @default false + * @type {boolean} */ Object.defineProperty(this, 'doNotSpellCheck', { @@ -5912,13 +5621,13 @@ } } }); - /** - * (PDF 1.5) If set, the new value shall be committed as soon as a selection is made (commonly with the pointing device). In this case, supplying a value for a field involves three actions: selecting the field for fill-in, selecting a choice for the fill-in value, and leaving that field, which finalizes or “commits” the data choice and triggers any actions associated with the entry or changing of this data. If this flag is on, then processing does not wait for leaving the field action to occur, but immediately proceeds to the third step. - * This option enables applications to perform an action once a selection is made, without requiring the user to exit the field. If clear, the new value is not committed until the user exits the field. - * - * @name AcroFormChoiceField#commitOnSelChange - * @default false - * @type {boolean} + /** + * (PDF 1.5) If set, the new value shall be committed as soon as a selection is made (commonly with the pointing device). In this case, supplying a value for a field involves three actions: selecting the field for fill-in, selecting a choice for the fill-in value, and leaving that field, which finalizes or “commits” the data choice and triggers any actions associated with the entry or changing of this data. If this flag is on, then processing does not wait for leaving the field action to occur, but immediately proceeds to the third step. + * This option enables applications to perform an action once a selection is made, without requiring the user to exit the field. If clear, the new value is not committed until the user exits the field. + * + * @name AcroFormChoiceField#commitOnSelChange + * @default false + * @type {boolean} */ Object.defineProperty(this, 'commitOnSelChange', { @@ -5939,10 +5648,10 @@ }; inherit(AcroFormChoiceField, AcroFormField); - /** - * @class AcroFormListBox - * @extends AcroFormChoiceField - * @extends AcroFormField + /** + * @class AcroFormListBox + * @extends AcroFormChoiceField + * @extends AcroFormField */ var AcroFormListBox = function AcroFormListBox() { @@ -5953,11 +5662,11 @@ }; inherit(AcroFormListBox, AcroFormChoiceField); - /** - * @class AcroFormComboBox - * @extends AcroFormListBox - * @extends AcroFormChoiceField - * @extends AcroFormField + /** + * @class AcroFormComboBox + * @extends AcroFormListBox + * @extends AcroFormChoiceField + * @extends AcroFormField */ var AcroFormComboBox = function AcroFormComboBox() { @@ -5966,12 +5675,12 @@ }; inherit(AcroFormComboBox, AcroFormListBox); - /** - * @class AcroFormEditBox - * @extends AcroFormComboBox - * @extends AcroFormListBox - * @extends AcroFormChoiceField - * @extends AcroFormField + /** + * @class AcroFormEditBox + * @extends AcroFormComboBox + * @extends AcroFormListBox + * @extends AcroFormChoiceField + * @extends AcroFormField */ var AcroFormEditBox = function AcroFormEditBox() { @@ -5980,19 +5689,19 @@ }; inherit(AcroFormEditBox, AcroFormComboBox); - /** - * @class AcroFormButton - * @extends AcroFormField + /** + * @class AcroFormButton + * @extends AcroFormField */ var AcroFormButton = function AcroFormButton() { AcroFormField.call(this); this.FT = "/Btn"; - /** - * (Radio buttons only) If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. If clear, clicking the selected button deselects it, leaving no button selected. - * - * @name AcroFormButton#noToggleToOff - * @type {boolean} + /** + * (Radio buttons only) If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. If clear, clicking the selected button deselects it, leaving no button selected. + * + * @name AcroFormButton#noToggleToOff + * @type {boolean} */ Object.defineProperty(this, 'noToggleToOff', { @@ -6009,11 +5718,11 @@ } } }); - /** - * If set, the field is a set of radio buttons; if clear, the field is a checkbox. This flag may be set only if the Pushbutton flag is clear. - * - * @name AcroFormButton#radio - * @type {boolean} + /** + * If set, the field is a set of radio buttons; if clear, the field is a checkbox. This flag may be set only if the Pushbutton flag is clear. + * + * @name AcroFormButton#radio + * @type {boolean} */ Object.defineProperty(this, 'radio', { @@ -6030,11 +5739,11 @@ } } }); - /** - * If set, the field is a pushbutton that does not retain a permanent value. - * - * @name AcroFormButton#pushButton - * @type {boolean} + /** + * If set, the field is a pushbutton that does not retain a permanent value. + * + * @name AcroFormButton#pushButton + * @type {boolean} */ Object.defineProperty(this, 'pushButton', { @@ -6051,11 +5760,11 @@ } } }); - /** - * (PDF 1.5) If set, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If clear, the buttons are mutually exclusive (the same behavior as HTML radio buttons). - * - * @name AcroFormButton#radioIsUnison - * @type {boolean} + /** + * (PDF 1.5) If set, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If clear, the buttons are mutually exclusive (the same behavior as HTML radio buttons). + * + * @name AcroFormButton#radioIsUnison + * @type {boolean} */ Object.defineProperty(this, 'radioIsUnison', { @@ -6098,16 +5807,16 @@ } } }); - /** - * From the PDF reference: - * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user. - * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, "Button Fields"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, "Button Fields") and radio buttons (Radio Buttons in 12.7.4.2, "Button Fields"). - * - * - '8' = Cross, - * - 'l' = Circle, - * - '' = nothing - * @name AcroFormButton#caption - * @type {string} + /** + * From the PDF reference: + * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user. + * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, "Button Fields"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, "Button Fields") and radio buttons (Radio Buttons in 12.7.4.2, "Button Fields"). + * + * - '8' = Cross, + * - 'l' = Circle, + * - '' = nothing + * @name AcroFormButton#caption + * @type {string} */ Object.defineProperty(this, 'caption', { @@ -6135,11 +5844,11 @@ _AS = value; } }); - /** - * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, "Appearance Streams") - * - * @name AcroFormButton#appearanceState - * @type {any} + /** + * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, "Appearance Streams") + * + * @name AcroFormButton#appearanceState + * @type {any} */ Object.defineProperty(this, 'appearanceState', { @@ -6155,10 +5864,10 @@ }; inherit(AcroFormButton, AcroFormField); - /** - * @class AcroFormPushButton - * @extends AcroFormButton - * @extends AcroFormField + /** + * @class AcroFormPushButton + * @extends AcroFormButton + * @extends AcroFormField */ var AcroFormPushButton = function AcroFormPushButton() { @@ -6167,10 +5876,10 @@ }; inherit(AcroFormPushButton, AcroFormButton); - /** - * @class AcroFormRadioButton - * @extends AcroFormButton - * @extends AcroFormField + /** + * @class AcroFormRadioButton + * @extends AcroFormButton + * @extends AcroFormField */ var AcroFormRadioButton = function AcroFormRadioButton() { @@ -6195,12 +5904,12 @@ }; inherit(AcroFormRadioButton, AcroFormButton); - /** - * The Child class of a RadioButton (the radioGroup) -> The single Buttons - * - * @class AcroFormChildClass - * @extends AcroFormField - * @ignore + /** + * The Child class of a RadioButton (the radioGroup) -> The single Buttons + * + * @class AcroFormChildClass + * @extends AcroFormField + * @ignore */ var AcroFormChildClass = function AcroFormChildClass() { @@ -6253,16 +5962,16 @@ } } }); - /** - * From the PDF reference: - * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user. - * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, "Button Fields"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, "Button Fields") and radio buttons (Radio Buttons in 12.7.4.2, "Button Fields"). - * - * - '8' = Cross, - * - 'l' = Circle, - * - '' = nothing - * @name AcroFormButton#caption - * @type {string} + /** + * From the PDF reference: + * (Optional, button fields only) The widget annotation's normal caption which shall be displayed when it is not interacting with the user. + * Unlike the remaining entries listed in this Table which apply only to widget annotations associated with pushbutton fields (see Pushbuttons in 12.7.4.2, "Button Fields"), the CA entry may be used with any type of button field, including check boxes (see Check Boxes in 12.7.4.2, "Button Fields") and radio buttons (Radio Buttons in 12.7.4.2, "Button Fields"). + * + * - '8' = Cross, + * - 'l' = Circle, + * - '' = nothing + * @name AcroFormButton#caption + * @type {string} */ Object.defineProperty(this, 'caption', { @@ -6290,11 +5999,11 @@ _AS = value; } }); - /** - * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, "Appearance Streams") - * - * @name AcroFormButton#appearanceState - * @type {any} + /** + * (Required if the appearance dictionary AP contains one or more subdictionaries; PDF 1.2) The annotation's appearance state, which selects the applicable appearance stream from an appearance subdictionary (see Section 12.5.5, "Appearance Streams") + * + * @name AcroFormButton#appearanceState + * @type {any} */ Object.defineProperty(this, 'appearanceState', { @@ -6345,10 +6054,10 @@ addField.call(this, child); return child; }; - /** - * @class AcroFormCheckBox - * @extends AcroFormButton - * @extends AcroFormField + /** + * @class AcroFormCheckBox + * @extends AcroFormButton + * @extends AcroFormField */ @@ -6363,19 +6072,19 @@ }; inherit(AcroFormCheckBox, AcroFormButton); - /** - * @class AcroFormTextField - * @extends AcroFormField + /** + * @class AcroFormTextField + * @extends AcroFormField */ var AcroFormTextField = function AcroFormTextField() { AcroFormField.call(this); this.FT = '/Tx'; - /** - * If set, the field may contain multiple lines of text; if clear, the field’s text shall be restricted to a single line. - * - * @name AcroFormTextField#multiline - * @type {boolean} + /** + * If set, the field may contain multiple lines of text; if clear, the field’s text shall be restricted to a single line. + * + * @name AcroFormTextField#multiline + * @type {boolean} */ Object.defineProperty(this, 'multiline', { @@ -6392,11 +6101,11 @@ } } }); - /** - * (PDF 1.4) If set, the text entered in the field represents the pathname of a file whose contents shall be submitted as the value of the field. - * - * @name AcroFormTextField#fileSelect - * @type {boolean} + /** + * (PDF 1.4) If set, the text entered in the field represents the pathname of a file whose contents shall be submitted as the value of the field. + * + * @name AcroFormTextField#fileSelect + * @type {boolean} */ Object.defineProperty(this, 'fileSelect', { @@ -6413,11 +6122,11 @@ } } }); - /** - * (PDF 1.4) If set, text entered in the field shall not be spell-checked. - * - * @name AcroFormTextField#doNotSpellCheck - * @type {boolean} + /** + * (PDF 1.4) If set, text entered in the field shall not be spell-checked. + * + * @name AcroFormTextField#doNotSpellCheck + * @type {boolean} */ Object.defineProperty(this, 'doNotSpellCheck', { @@ -6434,11 +6143,11 @@ } } }); - /** - * (PDF 1.4) If set, the field shall not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text shall be accepted for interactive form filling; for noninteractive form filling, the filler should take care not to add more character than will visibly fit in the defined area. - * - * @name AcroFormTextField#doNotScroll - * @type {boolean} + /** + * (PDF 1.4) If set, the field shall not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text shall be accepted for interactive form filling; for noninteractive form filling, the filler should take care not to add more character than will visibly fit in the defined area. + * + * @name AcroFormTextField#doNotScroll + * @type {boolean} */ Object.defineProperty(this, 'doNotScroll', { @@ -6455,11 +6164,11 @@ } } }); - /** - * (PDF 1.5) May be set only if the MaxLen entry is present in the text field dictionary (see Table 229) and if the Multiline, Password, and FileSelect flags are clear. If set, the field shall be automatically divided into as many equally spaced positions, or combs, as the value of MaxLen, and the text is laid out into those combs. - * - * @name AcroFormTextField#comb - * @type {boolean} + /** + * (PDF 1.5) May be set only if the MaxLen entry is present in the text field dictionary (see Table 229) and if the Multiline, Password, and FileSelect flags are clear. If set, the field shall be automatically divided into as many equally spaced positions, or combs, as the value of MaxLen, and the text is laid out into those combs. + * + * @name AcroFormTextField#comb + * @type {boolean} */ Object.defineProperty(this, 'comb', { @@ -6476,11 +6185,11 @@ } } }); - /** - * (PDF 1.5) If set, the value of this field shall be a rich text string (see 12.7.3.4, “Rich Text Strings”). If the field has a value, the RV entry of the field dictionary (Table 222) shall specify the rich text string. - * - * @name AcroFormTextField#richText - * @type {boolean} + /** + * (PDF 1.5) If set, the value of this field shall be a rich text string (see 12.7.3.4, “Rich Text Strings”). If the field has a value, the RV entry of the field dictionary (Table 222) shall specify the rich text string. + * + * @name AcroFormTextField#richText + * @type {boolean} */ Object.defineProperty(this, 'richText', { @@ -6508,11 +6217,11 @@ _MaxLen = value; } }); - /** - * (Optional; inheritable) The maximum length of the field’s text, in characters. - * - * @name AcroFormTextField#maxLength - * @type {number} + /** + * (Optional; inheritable) The maximum length of the field’s text, in characters. + * + * @name AcroFormTextField#maxLength + * @type {number} */ Object.defineProperty(this, 'maxLength', { @@ -6537,20 +6246,20 @@ }; inherit(AcroFormTextField, AcroFormField); - /** - * @class AcroFormPasswordField - * @extends AcroFormTextField - * @extends AcroFormField + /** + * @class AcroFormPasswordField + * @extends AcroFormTextField + * @extends AcroFormField */ var AcroFormPasswordField = function AcroFormPasswordField() { AcroFormTextField.call(this); - /** - * If set, the field is intended for entering a secure password that should not be echoed visibly to the screen. Characters typed from the keyboard shall instead be echoed in some unreadable form, such as asterisks or bullet characters. - * NOTE To protect password confidentiality, readers should never store the value of the text field in the PDF file if this flag is set. - * - * @name AcroFormTextField#password - * @type {boolean} + /** + * If set, the field is intended for entering a secure password that should not be echoed visibly to the screen. Characters typed from the keyboard shall instead be echoed in some unreadable form, such as asterisks or bullet characters. + * NOTE To protect password confidentiality, readers should never store the value of the text field in the PDF file if this flag is set. + * + * @name AcroFormTextField#password + * @type {boolean} */ Object.defineProperty(this, 'password', { @@ -6587,10 +6296,10 @@ return appearance; }, - /** - * Returns the standard On Appearance for a CheckBox - * - * @returns {AcroFormXObject} + /** + * Returns the standard On Appearance for a CheckBox + * + * @returns {AcroFormXObject} */ YesPushDown: function YesPushDown(formObject) { var xobj = createFormXObject(formObject); @@ -6643,10 +6352,10 @@ return xobj; }, - /** - * Returns the standard Off Appearance for a CheckBox - * - * @returns {AcroFormXObject} + /** + * Returns the standard Off Appearance for a CheckBox + * + * @returns {AcroFormXObject} */ OffPushDown: function OffPushDown(formObject) { var xobj = createFormXObject(formObject); @@ -6683,8 +6392,8 @@ DotRadius = Number((DotRadius * 0.9).toFixed(5)); var c = AcroFormAppearance.internal.Bezier_C; var DotRadiusBezier = Number((DotRadius * c).toFixed(5)); - /* - * The Following is a Circle created with Bezier-Curves. + /* + * The Following is a Circle created with Bezier-Curves. */ stream.push("q"); @@ -6758,12 +6467,12 @@ } }, Cross: { - /** - * Creates the Actual AppearanceDictionary-References - * - * @param {string} name - * @returns {Object} - * @ignore + /** + * Creates the Actual AppearanceDictionary-References + * + * @param {string} name + * @returns {Object} + * @ignore */ createAppearanceStream: function createAppearanceStream(name) { var appearanceStreamContent = { @@ -6828,10 +6537,10 @@ } }, - /** - * Returns the standard Appearance - * - * @returns {AcroFormXObject} + /** + * Returns the standard Appearance + * + * @returns {AcroFormXObject} */ createDefaultAppearanceStream: function createDefaultAppearanceStream(formObject) { // Set Helvetica to Standard Font (size: auto) @@ -6902,14 +6611,14 @@ return result; }; // Public: - /** - * Add an AcroForm-Field to the jsPDF-instance - * - * @name addField - * @function - * @instance - * @param {Object} fieldObject - * @returns {jsPDF} + /** + * Add an AcroForm-Field to the jsPDF-instance + * + * @name addField + * @function + * @instance + * @param {Object} fieldObject + * @returns {jsPDF} */ @@ -6925,13 +6634,13 @@ fieldObject.page = scope.internal.getCurrentPageInfo().pageNumber; return this; }; - /** - * @name addButton - * @function - * @instance - * @param {AcroFormButton} options - * @returns {jsPDF} - * @deprecated + /** + * @name addButton + * @function + * @instance + * @param {AcroFormButton} options + * @returns {jsPDF} + * @deprecated */ @@ -6942,13 +6651,13 @@ return addField.call(this, button); }; - /** - * @name addTextField - * @function - * @instance - * @param {AcroFormTextField} textField - * @returns {jsPDF} - * @deprecated + /** + * @name addTextField + * @function + * @instance + * @param {AcroFormTextField} textField + * @returns {jsPDF} + * @deprecated */ @@ -6959,13 +6668,13 @@ return addField.call(this, textField); }; - /** - * @name addChoiceField - * @function - * @instance - * @param {AcroFormChoiceField} - * @returns {jsPDF} - * @deprecated + /** + * @name addChoiceField + * @function + * @instance + * @param {AcroFormChoiceField} + * @returns {jsPDF} + * @deprecated */ @@ -7022,22 +6731,22 @@ }; })(jsPDF.API, typeof window !== "undefined" && window || typeof global !== "undefined" && global); - /** @license - * jsPDF addImage plugin - * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/ - * 2013 Chris Dowling, https://github.com/gingerchris - * 2013 Trinh Ho, https://github.com/ineedfat - * 2013 Edwin Alejandro Perez, https://github.com/eaparango - * 2013 Norah Smith, https://github.com/burnburnrocket - * 2014 Diego Casorran, https://github.com/diegocr - * 2014 James Robb, https://github.com/jamesbrobb - * - * + /** @license + * jsPDF addImage plugin + * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/ + * 2013 Chris Dowling, https://github.com/gingerchris + * 2013 Trinh Ho, https://github.com/ineedfat + * 2013 Edwin Alejandro Perez, https://github.com/eaparango + * 2013 Norah Smith, https://github.com/burnburnrocket + * 2014 Diego Casorran, https://github.com/diegocr + * 2014 James Robb, https://github.com/jamesbrobb + * + * */ - /** - * @name addImage - * @module + /** + * @name addImage + * @module */ (function (jsPDFAPI) { @@ -7061,18 +6770,18 @@ [0x50, 0x54] //PT - OS/2 pointer ] }; - /** - * Recognize filetype of Image by magic-bytes - * - * https://en.wikipedia.org/wiki/List_of_file_signatures - * - * @name getImageFileTypeByImageData - * @public - * @function - * @param {string|arraybuffer} imageData imageData as binary String or arraybuffer - * @param {string} format format of file if filetype-recognition fails, e.g. 'JPEG' - * - * @returns {string} filetype of Image + /** + * Recognize filetype of Image by magic-bytes + * + * https://en.wikipedia.org/wiki/List_of_file_signatures + * + * @name getImageFileTypeByImageData + * @public + * @function + * @param {string|arraybuffer} imageData imageData as binary String or arraybuffer + * @param {string} format format of file if filetype-recognition fails, e.g. 'JPEG' + * + * @returns {string} filetype of Image */ var getImageFileTypeByImageData = jsPDFAPI.getImageFileTypeByImageData = function (imageData, fallbackFormat) { @@ -7419,8 +7128,8 @@ this.internal.write('Q'); //Restore graphics state }; - /** - * COLOR SPACES + /** + * COLOR SPACES */ @@ -7437,8 +7146,8 @@ SEPARATION: 'Separation', DEVICE_N: 'DeviceN' }; - /** - * DECODE METHODS + /** + * DECODE METHODS */ jsPDFAPI.decode = { @@ -7452,8 +7161,8 @@ RUN_LENGTH_DECODE: 'RunLengthDecode', CCITT_FAX_DECODE: 'CCITTFaxDecode' }; - /** - * IMAGE COMPRESSION TYPES + /** + * IMAGE COMPRESSION TYPES */ jsPDFAPI.image_compression = { @@ -7462,11 +7171,11 @@ MEDIUM: 'MEDIUM', SLOW: 'SLOW' }; - /** - * @name sHashCode - * @function - * @param {string} str - * @returns {string} + /** + * @name sHashCode + * @function + * @param {string} str + * @returns {string} */ jsPDFAPI.sHashCode = function (str) { @@ -7484,26 +7193,26 @@ return hash; }; - /** - * @name isString - * @function - * @param {any} object - * @returns {boolean} + /** + * @name isString + * @function + * @param {any} object + * @returns {boolean} */ jsPDFAPI.isString = function (object) { return typeof object === 'string'; }; - /** - * Validates if given String is a valid Base64-String - * - * @name validateStringAsBase64 - * @public - * @function - * @param {String} possible Base64-String - * - * @returns {boolean} + /** + * Validates if given String is a valid Base64-String + * + * @name validateStringAsBase64 + * @public + * @function + * @param {String} possible Base64-String + * + * @returns {boolean} */ @@ -7530,34 +7239,34 @@ return result; }; - /** - * Strips out and returns info from a valid base64 data URI - * - * @name extractInfoFromBase64DataURI - * @function - * @param {string} dataUrl a valid data URI of format 'data:[][;base64],' - * @returns {Array}an Array containing the following - * [0] the complete data URI - * [1] - * [2] format - the second part of the mime-type i.e 'png' in 'image/png' - * [4] + /** + * Strips out and returns info from a valid base64 data URI + * + * @name extractInfoFromBase64DataURI + * @function + * @param {string} dataUrl a valid data URI of format 'data:[][;base64],' + * @returns {Array}an Array containing the following + * [0] the complete data URI + * [1] + * [2] format - the second part of the mime-type i.e 'png' in 'image/png' + * [4] */ jsPDFAPI.extractInfoFromBase64DataURI = function (dataURI) { return /^data:([\w]+?\/([\w]+?));\S*;*base64,(.+)$/g.exec(dataURI); }; - /** - * Strips out and returns info from a valid base64 data URI - * - * @name extractImageFromDataUrl - * @function - * @param {string} dataUrl a valid data URI of format 'data:[][;base64],' - * @returns {Array}an Array containing the following - * [0] the complete data URI - * [1] - * [2] format - the second part of the mime-type i.e 'png' in 'image/png' - * [4] + /** + * Strips out and returns info from a valid base64 data URI + * + * @name extractImageFromDataUrl + * @function + * @param {string} dataUrl a valid data URI of format 'data:[][;base64],' + * @returns {Array}an Array containing the following + * [0] the complete data URI + * [1] + * [2] format - the second part of the mime-type i.e 'png' in 'image/png' + * [4] */ @@ -7580,26 +7289,26 @@ return result; }; - /** - * Check to see if ArrayBuffer is supported - * - * @name supportsArrayBuffer - * @function - * @returns {boolean} + /** + * Check to see if ArrayBuffer is supported + * + * @name supportsArrayBuffer + * @function + * @returns {boolean} */ jsPDFAPI.supportsArrayBuffer = function () { return typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined'; }; - /** - * Tests supplied object to determine if ArrayBuffer - * - * @name isArrayBuffer - * @function - * @param {Object} object an Object - * - * @returns {boolean} + /** + * Tests supplied object to determine if ArrayBuffer + * + * @name isArrayBuffer + * @function + * @param {Object} object an Object + * + * @returns {boolean} */ @@ -7607,13 +7316,13 @@ if (!this.supportsArrayBuffer()) return false; return object instanceof ArrayBuffer; }; - /** - * Tests supplied object to determine if it implements the ArrayBufferView (TypedArray) interface - * - * @name isArrayBufferView - * @function - * @param {Object} object an Object - * @returns {boolean} + /** + * Tests supplied object to determine if it implements the ArrayBufferView (TypedArray) interface + * + * @name isArrayBufferView + * @function + * @param {Object} object an Object + * @returns {boolean} */ @@ -7622,21 +7331,21 @@ if (typeof Uint32Array === 'undefined') return false; return object instanceof Int8Array || object instanceof Uint8Array || typeof Uint8ClampedArray !== 'undefined' && object instanceof Uint8ClampedArray || object instanceof Int16Array || object instanceof Uint16Array || object instanceof Int32Array || object instanceof Uint32Array || object instanceof Float32Array || object instanceof Float64Array; }; - /** - * Convert the Buffer to a Binary String - * - * @name binaryStringToUint8Array - * @public - * @function - * @param {ArrayBuffer} BinaryString with ImageData - * - * @returns {Uint8Array} + /** + * Convert the Buffer to a Binary String + * + * @name binaryStringToUint8Array + * @public + * @function + * @param {ArrayBuffer} BinaryString with ImageData + * + * @returns {Uint8Array} */ jsPDFAPI.binaryStringToUint8Array = function (binary_string) { - /* - * not sure how efficient this will be will bigger files. Is there a native method? + /* + * not sure how efficient this will be will bigger files. Is there a native method? */ var len = binary_string.length; var bytes = new Uint8Array(len); @@ -7647,15 +7356,15 @@ return bytes; }; - /** - * Convert the Buffer to a Binary String - * - * @name arrayBufferToBinaryString - * @public - * @function - * @param {ArrayBuffer} ArrayBuffer with ImageData - * - * @returns {String} + /** + * Convert the Buffer to a Binary String + * + * @name arrayBufferToBinaryString + * @public + * @function + * @param {ArrayBuffer} ArrayBuffer with ImageData + * + * @returns {String} */ @@ -7669,19 +7378,19 @@ return atob(this.arrayBufferToBase64(buffer)); } }; - /** - * Converts an ArrayBuffer directly to base64 - * - * Taken from http://jsperf.com/encoding-xhr-image-data/31 - * - * Need to test if this is a better solution for larger files - * - * @name arrayBufferToBase64 - * @param {arraybuffer} arrayBuffer - * @public - * @function - * - * @returns {string} + /** + * Converts an ArrayBuffer directly to base64 + * + * Taken from http://jsperf.com/encoding-xhr-image-data/31 + * + * Need to test if this is a better solution for larger files + * + * @name arrayBufferToBase64 + * @param {arraybuffer} arrayBuffer + * @public + * @function + * + * @returns {string} */ @@ -7734,26 +7443,26 @@ return base64; }; - /** - * - * @name createImageInfo - * @param {Object} data - * @param {number} wd width - * @param {number} ht height - * @param {Object} cs colorSpace - * @param {number} bpc bits per channel - * @param {any} f - * @param {number} imageIndex - * @param {string} alias - * @param {any} dp - * @param {any} trns - * @param {any} pal - * @param {any} smask - * @param {any} p - * @public - * @function - * - * @returns {Object} + /** + * + * @name createImageInfo + * @param {Object} data + * @param {number} wd width + * @param {number} ht height + * @param {Object} cs colorSpace + * @param {number} bpc bits per channel + * @param {any} f + * @param {number} imageIndex + * @param {string} alias + * @param {any} dp + * @param {any} trns + * @param {any} pal + * @param {any} smask + * @param {any} p + * @public + * @function + * + * @returns {Object} */ @@ -7777,23 +7486,23 @@ return info; }; - /** - * Adds an Image to the PDF. - * - * @name addImage - * @public - * @function - * @param {string/Image-Element/Canvas-Element/Uint8Array} imageData imageData as base64 encoded DataUrl or Image-HTMLElement or Canvas-HTMLElement - * @param {string} format format of file if filetype-recognition fails, e.g. 'JPEG' - * @param {number} x x Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y y Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {number} width width of the image (in units declared at inception of PDF document) - * @param {number} height height of the Image (in units declared at inception of PDF document) - * @param {string} alias alias of the image (if used multiple times) - * @param {string} compression compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW' - * @param {number} rotation rotation of the image in degrees (0-359) - * - * @returns jsPDF + /** + * Adds an Image to the PDF. + * + * @name addImage + * @public + * @function + * @param {string/Image-Element/Canvas-Element/Uint8Array} imageData imageData as base64 encoded DataUrl or Image-HTMLElement or Canvas-HTMLElement + * @param {string} format format of file if filetype-recognition fails, e.g. 'JPEG' + * @param {number} x x Coordinate (in units declared at inception of PDF document) against left edge of the page + * @param {number} y y Coordinate (in units declared at inception of PDF document) against upper edge of the page + * @param {number} width width of the image (in units declared at inception of PDF document) + * @param {number} height height of the Image (in units declared at inception of PDF document) + * @param {string} alias alias of the image (if used multiple times) + * @param {string} compression compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW' + * @param {number} rotation rotation of the image in degrees (0-359) + * + * @returns jsPDF */ @@ -7864,9 +7573,9 @@ format = this.getImageFileTypeByImageData(imageData, format); if (!isImageTypeSupported(format)) throw new Error('addImage does not support files of type \'' + format + '\', please ensure that a plugin for \'' + format + '\' support is added.'); - /** - * need to test if it's more efficient to convert all binary strings - * to TypedArray - or should we just leave and process as string? + /** + * need to test if it's more efficient to convert all binary strings + * to TypedArray - or should we just leave and process as string? */ if (this.supportsArrayBuffer()) { @@ -7888,11 +7597,11 @@ writeImageToPDF.call(this, x, y, w, h, info, info.i, images, rotation); return this; }; - /** - * @name convertStringToImageData - * @function - * @param {string} stringData - * @returns {string} binary data + /** + * @name convertStringToImageData + * @function + * @param {string} stringData + * @returns {string} binary data */ @@ -7918,8 +7627,8 @@ return imageData; }; - /** - * JPEG SUPPORT + /** + * JPEG SUPPORT **/ //takes a string imgData containing the raw bytes of //a jpeg image and returns [width, height] @@ -7999,8 +7708,8 @@ readBytes = function readBytes(data, offset) { return data.subarray(offset, offset + 5); }; - /** - * @ignore + /** + * @ignore */ @@ -8047,8 +7756,8 @@ return this.createImageInfo(data, dims.width, dims.height, colorSpace, bpc, filter, index, alias); }; - /** - * @ignore + /** + * @ignore */ @@ -8057,11 +7766,11 @@ { return this.processJPEG.apply(this, arguments); }; - /** - * @name getImageProperties - * @function - * @param {Object} imageData - * @returns {Object} + /** + * @name getImageProperties + * @function + * @param {Object} imageData + * @returns {Object} */ @@ -8093,9 +7802,9 @@ if (!isImageTypeSupported(format)) { throw new Error('addImage does not support files of type \'' + format + '\', please ensure that a plugin for \'' + format + '\' support is added.'); } - /** - * need to test if it's more efficient to convert all binary strings - * to TypedArray - or should we just leave and process as string? + /** + * need to test if it's more efficient to convert all binary strings + * to TypedArray - or should we just leave and process as string? */ @@ -8123,59 +7832,59 @@ }; })(jsPDF.API); - /** - * @license - * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * @license + * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ - /** - * jsPDF Annotations PlugIn - * - * There are many types of annotations in a PDF document. Annotations are placed - * on a page at a particular location. They are not 'attached' to an object. - *
    - * This plugin current supports
    - *
  • Goto Page (set pageNumber and top in options) - *
  • Goto Name (set name and top in options) - *
  • Goto URL (set url in options) - *

    - * The destination magnification factor can also be specified when goto is a page number or a named destination. (see documentation below) - * (set magFactor in options). XYZ is the default. - *

    - *

    - * Links, Text, Popup, and FreeText are supported. - *

    - *

    - * Options In PDF spec Not Implemented Yet - *

  • link border - *
  • named target - *
  • page coordinates - *
  • destination page scaling and layout - *
  • actions other than URL and GotoPage - *
  • background / hover actions - *

    - * @name annotations - * @module + /** + * jsPDF Annotations PlugIn + * + * There are many types of annotations in a PDF document. Annotations are placed + * on a page at a particular location. They are not 'attached' to an object. + *
    + * This plugin current supports
    + *
  • Goto Page (set pageNumber and top in options) + *
  • Goto Name (set name and top in options) + *
  • Goto URL (set url in options) + *

    + * The destination magnification factor can also be specified when goto is a page number or a named destination. (see documentation below) + * (set magFactor in options). XYZ is the default. + *

    + *

    + * Links, Text, Popup, and FreeText are supported. + *

    + *

    + * Options In PDF spec Not Implemented Yet + *

  • link border + *
  • named target + *
  • page coordinates + *
  • destination page scaling and layout + *
  • actions other than URL and GotoPage + *
  • background / hover actions + *

    + * @name annotations + * @module */ - /* - Destination Magnification Factors - See PDF 1.3 Page 386 for meanings and options - - [supported] - XYZ (options; left top zoom) - Fit (no options) - FitH (options: top) - FitV (options: left) - - [not supported] - FitR - FitB - FitBH - FitBV + /* + Destination Magnification Factors + See PDF 1.3 Page 386 for meanings and options + + [supported] + XYZ (options; left top zoom) + Fit (no options) + FitH (options: top) + FitV (options: left) + + [not supported] + FitR + FitB + FitBH + FitBV */ (function (jsPDFAPI) { @@ -8329,10 +8038,10 @@ this.internal.write("]"); }]); - /** - * @name createAnnotation - * @function - * @param {Object} options + /** + * @name createAnnotation + * @function + * @param {Object} options */ jsPDFAPI.createAnnotation = function (options) { @@ -8349,19 +8058,19 @@ break; } }; - /** - * Create a link - * - * valid options - *
  • pageNumber or url [required] - *

    If pageNumber is specified, top and zoom may also be specified

    - * @name link - * @function - * @param {number} x - * @param {number} y - * @param {number} w - * @param {number} h - * @param {Object} options + /** + * Create a link + * + * valid options + *
  • pageNumber or url [required] + *

    If pageNumber is specified, top and zoom may also be specified

    + * @name link + * @function + * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @param {Object} options */ @@ -8376,17 +8085,17 @@ type: 'link' }); }; - /** - * Currently only supports single line text. - * Returns the width of the text/link - * - * @name textWithLink - * @function - * @param {string} text - * @param {number} x - * @param {number} y - * @param {Object} options - * @returns {number} width the width of the text/link + /** + * Currently only supports single line text. + * Returns the width of the text/link + * + * @name textWithLink + * @function + * @param {string} text + * @param {number} x + * @param {number} y + * @param {Object} options + * @returns {number} width the width of the text/link */ @@ -8401,11 +8110,11 @@ return width; }; //TODO move into external library - /** - * @name getTextWidth - * @function - * @param {string} text - * @returns {number} txtWidth + /** + * @name getTextWidth + * @function + * @param {string} text + * @returns {number} txtWidth */ @@ -8418,24 +8127,24 @@ return this; })(jsPDF.API); - /** - * @license - * Copyright (c) 2017 Aras Abbasi - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * @license + * Copyright (c) 2017 Aras Abbasi + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ - /** - * jsPDF arabic parser PlugIn - * - * @name arabic - * @module + /** + * jsPDF arabic parser PlugIn + * + * @name arabic + * @module */ (function (jsPDFAPI) { - /** - * Arabic shape substitutions: char code => (isolated, final, initial, medial). - * Arabic Substition A + /** + * Arabic shape substitutions: char code => (isolated, final, initial, medial). + * Arabic Substition A */ var arabicSubstitionA = { @@ -8751,12 +8460,12 @@ return initialForm; }; - /** - * @name processArabic - * @function - * @param {string} text - * @param {boolean} reverse - * @returns {string} + /** + * @name processArabic + * @function + * @param {string} text + * @param {boolean} reverse + * @returns {string} */ @@ -8830,31 +8539,31 @@ jsPDFAPI.events.push(['preProcessText', arabicParserFunction]); })(jsPDF.API); - /** @license - * jsPDF Autoprint Plugin - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** @license + * jsPDF Autoprint Plugin + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ - /** - * @name autoprint - * @module + /** + * @name autoprint + * @module */ (function (jsPDFAPI) { - /** - * Makes the PDF automatically print. This works in Chrome, Firefox, Acrobat - * Reader. - * - * @name autoPrint - * @function - * @param {Object} options (optional) Set the attribute variant to 'non-conform' (default) or 'javascript' to activate different methods of automatic printing when opening in a PDF-viewer . - * @returns {jsPDF} - * @example - * var doc = new jsPDF(); - * doc.text(10, 10, 'This is a test'); - * doc.autoPrint({variant: 'non-conform'}); - * doc.save('autoprint.pdf'); + /** + * Makes the PDF automatically print. This works in Chrome, Firefox, Acrobat + * Reader. + * + * @name autoPrint + * @function + * @param {Object} options (optional) Set the attribute variant to 'non-conform' (default) or 'javascript' to activate different methods of automatic printing when opening in a PDF-viewer . + * @returns {jsPDF} + * @example + * var doc = new jsPDF(); + * doc.text(10, 10, 'This is a test'); + * doc.autoPrint({variant: 'non-conform'}); + * doc.save('autoprint.pdf'); */ jsPDFAPI.autoPrint = function (options) { @@ -8890,26 +8599,26 @@ }; })(jsPDF.API); - /** - * @license - * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * @license + * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ - /** - * jsPDF Canvas PlugIn - * This plugin mimics the HTML5 Canvas - * - * The goal is to provide a way for current canvas users to print directly to a PDF. - * @name canvas - * @module + /** + * jsPDF Canvas PlugIn + * This plugin mimics the HTML5 Canvas + * + * The goal is to provide a way for current canvas users to print directly to a PDF. + * @name canvas + * @module */ (function (jsPDFAPI) { - /** - * @class Canvas - * @classdesc A Canvas Wrapper for jsPDF + /** + * @class Canvas + * @classdesc A Canvas Wrapper for jsPDF */ var Canvas = function Canvas() { @@ -8923,11 +8632,11 @@ } }); var _width = 150; - /** - * The height property is a positive integer reflecting the height HTML attribute of the element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used. - * This is one of the two properties, the other being width, that controls the size of the canvas. - * - * @name width + /** + * The height property is a positive integer reflecting the height HTML attribute of the element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used. + * This is one of the two properties, the other being width, that controls the size of the canvas. + * + * @name width */ Object.defineProperty(this, 'width', { @@ -8947,11 +8656,11 @@ } }); var _height = 300; - /** - * The width property is a positive integer reflecting the width HTML attribute of the element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used. - * This is one of the two properties, the other being height, that controls the size of the canvas. - * - * @name height + /** + * The width property is a positive integer reflecting the width HTML attribute of the element interpreted in CSS pixels. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used. + * This is one of the two properties, the other being height, that controls the size of the canvas. + * + * @name height */ Object.defineProperty(this, 'height', { @@ -8994,13 +8703,13 @@ } }); }; - /** - * The getContext() method returns a drawing context on the canvas, or null if the context identifier is not supported. - * - * @name getContext - * @function - * @param {string} contextType Is a String containing the context identifier defining the drawing context associated to the canvas. Possible value is "2d", leading to the creation of a Context2D object representing a two-dimensional rendering context. - * @param {object} contextAttributes + /** + * The getContext() method returns a drawing context on the canvas, or null if the context identifier is not supported. + * + * @name getContext + * @function + * @param {string} contextType Is a String containing the context identifier defining the drawing context associated to the canvas. Possible value is "2d", leading to the creation of a Context2D object representing a two-dimensional rendering context. + * @param {object} contextAttributes */ @@ -9021,11 +8730,11 @@ this.pdf.context2d._canvas = this; return this.pdf.context2d; }; - /** - * The toDataURL() method is just a stub to throw an error if accidently called. - * - * @name toDataURL - * @function + /** + * The toDataURL() method is just a stub to throw an error if accidently called. + * + * @name toDataURL + * @function */ @@ -9040,23 +8749,23 @@ return this; })(jsPDF.API); - /** - * @license - * ==================================================================== - * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com - * 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br - * 2013 Lee Driscoll, https://github.com/lsdriscoll - * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria - * 2014 James Hall, james@parall.ax - * 2014 Diego Casorran, https://github.com/diegocr - * - * - * ==================================================================== + /** + * @license + * ==================================================================== + * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com + * 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br + * 2013 Lee Driscoll, https://github.com/lsdriscoll + * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria + * 2014 James Hall, james@parall.ax + * 2014 Diego Casorran, https://github.com/diegocr + * + * + * ==================================================================== */ - /** - * @name cell - * @module + /** + * @name cell + * @module */ (function (jsPDFAPI) { /*jslint browser:true */ @@ -9091,21 +8800,21 @@ top: 0, bottom: 0 }; - /** - * @name setHeaderFunction - * @function - * @param {function} func + /** + * @name setHeaderFunction + * @function + * @param {function} func */ jsPDFAPI.setHeaderFunction = function (func) { headerFunction = func; }; - /** - * @name getTextDimensions - * @function - * @param {string} txt - * @returns {Object} dimensions + /** + * @name getTextDimensions + * @function + * @param {string} txt + * @returns {Object} dimensions */ @@ -9148,9 +8857,9 @@ h: height }; }; - /** - * @name cellAddPage - * @function + /** + * @name cellAddPage + * @function */ @@ -9161,9 +8870,9 @@ pages += 1; }; - /** - * @name cellInitialize - * @function + /** + * @name cellInitialize + * @function */ @@ -9177,17 +8886,17 @@ }; pages = 1; }; - /** - * @name cell - * @function - * @param {number} x - * @param {number} y - * @param {number} w - * @param {number} h - * @param {string} txt - * @param {number} ln lineNumber - * @param {string} align - * @return {jsPDF} jsPDF-instance + /** + * @name cell + * @function + * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @param {string} txt + * @param {number} ln lineNumber + * @param {string} align + * @return {jsPDF} jsPDF-instance */ @@ -9233,7 +8942,7 @@ for (var i = 0; i < txt.length; i++) { var currentLine = txt[i]; - var textSize = this.getStringUnitWidth(currentLine) * this.internal.getFontSize(); + var textSize = this.getStringUnitWidth(currentLine) * this.internal.getFontSize() / this.internal.scaleFactor; this.text(currentLine, x + w - textSize - padding, y + this.internal.getLineHeight() * (i + 1)); } } else { @@ -9244,14 +8953,14 @@ setLastCellPosition(x, y, w, h, ln); return this; }; - /** - * Return the maximum value from an array - * - * @name arrayMax - * @function - * @param {Array} array - * @param comparisonFn - * @returns {number} + /** + * Return the maximum value from an array + * + * @name arrayMax + * @function + * @param {Array} array + * @param comparisonFn + * @returns {number} */ @@ -9277,19 +8986,19 @@ return max; }; - /** - * Create a table from a set of data. - * @name table - * @function - * @param {Integer} [x] : left-position for top-left corner of table - * @param {Integer} [y] top-position for top-left corner of table - * @param {Object[]} [data] As array of objects containing key-value pairs corresponding to a row of data. - * @param {String[]} [headers] Omit or null to auto-generate headers at a performance cost - * @param {Object} [config.printHeaders] True to print column headers at the top of every page - * @param {Object} [config.autoSize] True to dynamically set the column widths to match the widest cell value - * @param {Object} [config.margins] margin values for left, top, bottom, and width - * @param {Object} [config.fontSize] Integer fontSize to use (optional) - * @returns {jsPDF} jsPDF-instance + /** + * Create a table from a set of data. + * @name table + * @function + * @param {Integer} [x] : left-position for top-left corner of table + * @param {Integer} [y] top-position for top-left corner of table + * @param {Object[]} [data] As array of objects containing key-value pairs corresponding to a row of data. + * @param {String[]} [headers] Omit or null to auto-generate headers at a performance cost + * @param {Object} [config.printHeaders] True to print column headers at the top of every page + * @param {Object} [config.autoSize] True to dynamically set the column widths to match the widest cell value + * @param {Object} [config.margins] margin values for left, top, bottom, and width + * @param {Object} [config.fontSize] Integer fontSize to use (optional) + * @returns {jsPDF} jsPDF-instance */ @@ -9343,9 +9052,9 @@ margins = config.margins; } } - /** - * @property {Number} lnMod - * Keep track of the current line number modifier used when creating cells + /** + * @property {Number} lnMod + * Keep track of the current line number modifier used when creating cells */ @@ -9439,15 +9148,15 @@ this.table_y = y; return this; }; - /** - * Calculate the height for containing the highest column - * - * @name calculateLineHeight - * @function - * @param {String[]} headerNames is the header, used as keys to the data - * @param {Integer[]} columnWidths is size of each column - * @param {Object[]} model is the line of data we want to calculate the height of - * @returns {number} lineHeight + /** + * Calculate the height for containing the highest column + * + * @name calculateLineHeight + * @function + * @param {String[]} headerNames is the header, used as keys to the data + * @param {Integer[]} columnWidths is size of each column + * @param {Object[]} model is the line of data we want to calculate the height of + * @returns {number} lineHeight */ @@ -9464,27 +9173,27 @@ return lineHeight; }; - /** - * Store the config for outputting a table header - * - * @name setTableHeaderRow - * @function - * @param {Object[]} config - * An array of cell configs that would define a header row: Each config matches the config used by jsPDFAPI.cell - * except the ln parameter is excluded + /** + * Store the config for outputting a table header + * + * @name setTableHeaderRow + * @function + * @param {Object[]} config + * An array of cell configs that would define a header row: Each config matches the config used by jsPDFAPI.cell + * except the ln parameter is excluded */ jsPDFAPI.setTableHeaderRow = function (config) { this.tableHeaderRow = config; }; - /** - * Output the store header row - * - * @name printHeaderRow - * @function - * @param {number} lineNumber The line number to output the header at - * @param {boolean} new_page + /** + * Output the store header row + * + * @name printHeaderRow + * @function + * @param {number} lineNumber The line number to output the header at + * @param {boolean} new_page */ @@ -9527,19 +9236,19 @@ }; })(jsPDF.API); - /** - * jsPDF Context2D PlugIn Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv - * - * Licensed under the MIT License. http://opensource.org/licenses/mit-license + /** + * jsPDF Context2D PlugIn Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv + * + * Licensed under the MIT License. http://opensource.org/licenses/mit-license */ - /** - * This plugin mimics the HTML5 CanvasRenderingContext2D. - * - * The goal is to provide a way for current canvas implementations to print directly to a PDF. - * - * @name context2d - * @module + /** + * This plugin mimics the HTML5 CanvasRenderingContext2D. + * + * The goal is to provide a way for current canvas implementations to print directly to a PDF. + * + * @name context2d + * @module */ (function (jsPDFAPI, globalObj) { @@ -9596,10 +9305,10 @@ } }); var _pageWrapXEnabled = false; - /** - * @name pageWrapXEnabled - * @type {boolean} - * @default false + /** + * @name pageWrapXEnabled + * @type {boolean} + * @default false */ Object.defineProperty(this, 'pageWrapXEnabled', { @@ -9611,10 +9320,10 @@ } }); var _pageWrapYEnabled = false; - /** - * @name pageWrapYEnabled - * @type {boolean} - * @default true + /** + * @name pageWrapYEnabled + * @type {boolean} + * @default true */ Object.defineProperty(this, 'pageWrapYEnabled', { @@ -9626,10 +9335,10 @@ } }); var _posX = 0; - /** - * @name posX - * @type {number} - * @default 0 + /** + * @name posX + * @type {number} + * @default 0 */ Object.defineProperty(this, 'posX', { @@ -9643,10 +9352,10 @@ } }); var _posY = 0; - /** - * @name posY - * @type {number} - * @default 0 + /** + * @name posY + * @type {number} + * @default 0 */ Object.defineProperty(this, 'posY', { @@ -9660,10 +9369,10 @@ } }); var _autoPaging = false; - /** - * @name autoPaging - * @type {boolean} - * @default true + /** + * @name autoPaging + * @type {boolean} + * @default true */ Object.defineProperty(this, 'autoPaging', { @@ -9675,10 +9384,10 @@ } }); var lastBreak = 0; - /** - * @name lastBreak - * @type {number} - * @default 0 + /** + * @name lastBreak + * @type {number} + * @default 0 */ Object.defineProperty(this, 'lastBreak', { @@ -9690,11 +9399,11 @@ } }); var pageBreaks = []; - /** - * Y Position of page breaks. - * @name pageBreaks - * @type {number} - * @default 0 + /** + * Y Position of page breaks. + * @name pageBreaks + * @type {number} + * @default 0 */ Object.defineProperty(this, 'pageBreaks', { @@ -9707,10 +9416,10 @@ }); var _ctx = new ContextLayer(); - /** - * @name ctx - * @type {object} - * @default {} + /** + * @name ctx + * @type {object} + * @default {} */ @@ -9724,10 +9433,10 @@ } } }); - /** - * @name path - * @type {array} - * @default [] + /** + * @name path + * @type {array} + * @default [] */ Object.defineProperty(this, 'path', { @@ -9738,10 +9447,10 @@ _ctx.path = value; } }); - /** - * @name ctxStack - * @type {array} - * @default [] + /** + * @name ctxStack + * @type {array} + * @default [] */ var _ctxStack = []; @@ -9753,14 +9462,14 @@ _ctxStack = value; } }); - /** - * Sets or returns the color, gradient, or pattern used to fill the drawing - * - * @name fillStyle - * @default #000000 - * @property {(color|gradient|pattern)} value The color of the drawing. Default value is #000000
    - * A gradient object (linear or radial) used to fill the drawing (not supported by context2d)
    - * A pattern object to use to fill the drawing (not supported by context2d) + /** + * Sets or returns the color, gradient, or pattern used to fill the drawing + * + * @name fillStyle + * @default #000000 + * @property {(color|gradient|pattern)} value The color of the drawing. Default value is #000000
    + * A gradient object (linear or radial) used to fill the drawing (not supported by context2d)
    + * A pattern object to use to fill the drawing (not supported by context2d) */ Object.defineProperty(this, 'fillStyle', { @@ -9781,14 +9490,14 @@ }); } }); - /** - * Sets or returns the color, gradient, or pattern used for strokes - * - * @name strokeStyle - * @default #000000 - * @property {color} color A CSS color value that indicates the stroke color of the drawing. Default value is #000000 (not supported by context2d) - * @property {gradient} gradient A gradient object (linear or radial) used to create a gradient stroke (not supported by context2d) - * @property {pattern} pattern A pattern object used to create a pattern stroke (not supported by context2d) + /** + * Sets or returns the color, gradient, or pattern used for strokes + * + * @name strokeStyle + * @default #000000 + * @property {color} color A CSS color value that indicates the stroke color of the drawing. Default value is #000000 (not supported by context2d) + * @property {gradient} gradient A gradient object (linear or radial) used to create a gradient stroke (not supported by context2d) + * @property {pattern} pattern A pattern object used to create a pattern stroke (not supported by context2d) */ Object.defineProperty(this, 'strokeStyle', { @@ -9810,14 +9519,14 @@ } } }); - /** - * Sets or returns the style of the end caps for a line - * - * @name lineCap - * @default butt - * @property {(butt|round|square)} lineCap butt A flat edge is added to each end of the line
    - * round A rounded end cap is added to each end of the line
    - * square A square end cap is added to each end of the line
    + /** + * Sets or returns the style of the end caps for a line + * + * @name lineCap + * @default butt + * @property {(butt|round|square)} lineCap butt A flat edge is added to each end of the line
    + * round A rounded end cap is added to each end of the line
    + * square A square end cap is added to each end of the line
    */ Object.defineProperty(this, 'lineCap', { @@ -9831,12 +9540,12 @@ } } }); - /** - * Sets or returns the current line width - * - * @name lineWidth - * @default 1 - * @property {number} lineWidth The current line width, in pixels + /** + * Sets or returns the current line width + * + * @name lineWidth + * @default 1 + * @property {number} lineWidth The current line width, in pixels */ Object.defineProperty(this, 'lineWidth', { @@ -9850,8 +9559,8 @@ } } }); - /** - * Sets or returns the type of corner created, when two lines meet + /** + * Sets or returns the type of corner created, when two lines meet */ Object.defineProperty(this, 'lineJoin', { @@ -9865,11 +9574,11 @@ } } }); - /** - * A number specifying the miter limit ratio in coordinate space units. Zero, negative, Infinity, and NaN values are ignored. The default value is 10.0. - * - * @name miterLimit - * @default 10 + /** + * A number specifying the miter limit ratio in coordinate space units. Zero, negative, Infinity, and NaN values are ignored. The default value is 10.0. + * + * @name miterLimit + * @default 10 */ Object.defineProperty(this, 'miterLimit', { @@ -10029,24 +9738,24 @@ Context2D.prototype.fill = function () { pathPreProcess.call(this, 'fill', false); }; - /** - * Actually draws the path you have defined - * - * @name stroke - * @function - * @description The stroke() method actually draws the path you have defined with all those moveTo() and lineTo() methods. The default color is black. + /** + * Actually draws the path you have defined + * + * @name stroke + * @function + * @description The stroke() method actually draws the path you have defined with all those moveTo() and lineTo() methods. The default color is black. */ Context2D.prototype.stroke = function () { pathPreProcess.call(this, 'stroke', false); }; - /** - * Begins a path, or resets the current - * - * @name beginPath - * @function - * @description The beginPath() method begins a path, or resets the current path. + /** + * Begins a path, or resets the current + * + * @name beginPath + * @function + * @description The beginPath() method begins a path, or resets the current path. */ @@ -10055,13 +9764,13 @@ type: 'begin' }]; }; - /** - * Moves the path to the specified point in the canvas, without creating a line - * - * @name moveTo - * @function - * @param x {Number} The x-coordinate of where to move the path to - * @param y {Number} The y-coordinate of where to move the path to + /** + * Moves the path to the specified point in the canvas, without creating a line + * + * @name moveTo + * @function + * @param x {Number} The x-coordinate of where to move the path to + * @param y {Number} The y-coordinate of where to move the path to */ @@ -10079,12 +9788,12 @@ }); this.ctx.lastPoint = new Point(x, y); }; - /** - * Creates a path from the current point back to the starting point - * - * @name closePath - * @function - * @description The closePath() method creates a path from the current point back to the starting point. + /** + * Creates a path from the current point back to the starting point + * + * @name closePath + * @function + * @description The closePath() method creates a path from the current point back to the starting point. */ @@ -10115,14 +9824,14 @@ }); this.ctx.lastPoint = new Point(pathBegin.x, pathBegin.y); }; - /** - * Adds a new point and creates a line to that point from the last specified point in the canvas - * - * @name lineTo - * @function - * @param x The x-coordinate of where to create the line to - * @param y The y-coordinate of where to create the line to - * @description The lineTo() method adds a new point and creates a line TO that point FROM the last specified point in the canvas (this method does not draw the line). + /** + * Adds a new point and creates a line to that point from the last specified point in the canvas + * + * @name lineTo + * @function + * @param x The x-coordinate of where to create the line to + * @param y The y-coordinate of where to create the line to + * @description The lineTo() method adds a new point and creates a line TO that point FROM the last specified point in the canvas (this method does not draw the line). */ @@ -10140,12 +9849,12 @@ }); this.ctx.lastPoint = new Point(pt.x, pt.y); }; - /** - * Clips a region of any shape and size from the original canvas - * - * @name clip - * @function - * @description The clip() method clips a region of any shape and size from the original canvas. + /** + * Clips a region of any shape and size from the original canvas + * + * @name clip + * @function + * @description The clip() method clips a region of any shape and size from the original canvas. */ @@ -10153,16 +9862,16 @@ this.ctx.clip_path = JSON.parse(JSON.stringify(this.path)); pathPreProcess.call(this, null, true); }; - /** - * Creates a cubic Bézier curve - * - * @name quadraticCurveTo - * @function - * @param cpx {Number} The x-coordinate of the Bézier control point - * @param cpy {Number} The y-coordinate of the Bézier control point - * @param x {Number} The x-coordinate of the ending point - * @param y {Number} The y-coordinate of the ending point - * @description The quadraticCurveTo() method adds a point to the current path by using the specified control points that represent a quadratic Bézier curve.

    A quadratic Bézier curve requires two points. The first point is a control point that is used in the quadratic Bézier calculation and the second point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point. + /** + * Creates a cubic Bézier curve + * + * @name quadraticCurveTo + * @function + * @param cpx {Number} The x-coordinate of the Bézier control point + * @param cpy {Number} The y-coordinate of the Bézier control point + * @param x {Number} The x-coordinate of the ending point + * @param y {Number} The y-coordinate of the ending point + * @description The quadraticCurveTo() method adds a point to the current path by using the specified control points that represent a quadratic Bézier curve.

    A quadratic Bézier curve requires two points. The first point is a control point that is used in the quadratic Bézier calculation and the second point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point. */ @@ -10183,18 +9892,18 @@ }); this.ctx.lastPoint = new Point(pt0.x, pt0.y); }; - /** - * Creates a cubic Bézier curve - * - * @name bezierCurveTo - * @function - * @param cp1x {Number} The x-coordinate of the first Bézier control point - * @param cp1y {Number} The y-coordinate of the first Bézier control point - * @param cp2x {Number} The x-coordinate of the second Bézier control point - * @param cp2y {Number} The y-coordinate of the second Bézier control point - * @param x {Number} The x-coordinate of the ending point - * @param y {Number} The y-coordinate of the ending point - * @description The bezierCurveTo() method adds a point to the current path by using the specified control points that represent a cubic Bézier curve.

    A cubic bezier curve requires three points. The first two points are control points that are used in the cubic Bézier calculation and the last point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point. + /** + * Creates a cubic Bézier curve + * + * @name bezierCurveTo + * @function + * @param cp1x {Number} The x-coordinate of the first Bézier control point + * @param cp1y {Number} The y-coordinate of the first Bézier control point + * @param cp2x {Number} The x-coordinate of the second Bézier control point + * @param cp2y {Number} The y-coordinate of the second Bézier control point + * @param x {Number} The x-coordinate of the ending point + * @param y {Number} The y-coordinate of the ending point + * @description The bezierCurveTo() method adds a point to the current path by using the specified control points that represent a cubic Bézier curve.

    A cubic bezier curve requires three points. The first two points are control points that are used in the cubic Bézier calculation and the last point is the ending point for the curve. The starting point for the curve is the last point in the current path. If a path does not exist, use the beginPath() and moveTo() methods to define a starting point. */ @@ -10218,18 +9927,18 @@ }); this.ctx.lastPoint = new Point(pt0.x, pt0.y); }; - /** - * Creates an arc/curve (used to create circles, or parts of circles) - * - * @name arc - * @function - * @param x {Number} The x-coordinate of the center of the circle - * @param y {Number} The y-coordinate of the center of the circle - * @param radius {Number} The radius of the circle - * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) - * @param endAngle {Number} The ending angle, in radians - * @param counterclockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. - * @description The arc() method creates an arc/curve (used to create circles, or parts of circles). + /** + * Creates an arc/curve (used to create circles, or parts of circles) + * + * @name arc + * @function + * @param x {Number} The x-coordinate of the center of the circle + * @param y {Number} The y-coordinate of the center of the circle + * @param radius {Number} The radius of the circle + * @param startAngle {Number} The starting angle, in radians (0 is at the 3 o'clock position of the arc's circle) + * @param endAngle {Number} The ending angle, in radians + * @param counterclockwise {Boolean} Optional. Specifies whether the drawing should be counterclockwise or clockwise. False is default, and indicates clockwise, while true indicates counter-clockwise. + * @description The arc() method creates an arc/curve (used to create circles, or parts of circles). */ @@ -10265,33 +9974,33 @@ counterclockwise: counterclockwise }); // this.ctx.lastPoint(new Point(pt.x,pt.y)); }; - /** - * Creates an arc/curve between two tangents - * - * @name arcTo - * @function - * @param x1 {Number} The x-coordinate of the first tangent - * @param y1 {Number} The y-coordinate of the first tangent - * @param x2 {Number} The x-coordinate of the second tangent - * @param y2 {Number} The y-coordinate of the second tangent - * @param radius The radius of the arc - * @description The arcTo() method creates an arc/curve between two tangents on the canvas. + /** + * Creates an arc/curve between two tangents + * + * @name arcTo + * @function + * @param x1 {Number} The x-coordinate of the first tangent + * @param y1 {Number} The y-coordinate of the first tangent + * @param x2 {Number} The x-coordinate of the second tangent + * @param y2 {Number} The y-coordinate of the second tangent + * @param radius The radius of the arc + * @description The arcTo() method creates an arc/curve between two tangents on the canvas. */ Context2D.prototype.arcTo = function (x1, y1, x2, y2, radius) { throw new Error('arcTo not implemented.'); }; - /** - * Creates a rectangle - * - * @name rect - * @function - * @param x {Number} The x-coordinate of the upper-left corner of the rectangle - * @param y {Number} The y-coordinate of the upper-left corner of the rectangle - * @param w {Number} The width of the rectangle, in pixels - * @param h {Number} The height of the rectangle, in pixels - * @description The rect() method creates a rectangle. + /** + * Creates a rectangle + * + * @name rect + * @function + * @param x {Number} The x-coordinate of the upper-left corner of the rectangle + * @param y {Number} The y-coordinate of the upper-left corner of the rectangle + * @param w {Number} The width of the rectangle, in pixels + * @param h {Number} The height of the rectangle, in pixels + * @description The rect() method creates a rectangle. */ @@ -10309,16 +10018,16 @@ this.lineTo(x + w, y); this.lineTo(x, y); }; - /** - * Draws a "filled" rectangle - * - * @name fillRect - * @function - * @param x {Number} The x-coordinate of the upper-left corner of the rectangle - * @param y {Number} The y-coordinate of the upper-left corner of the rectangle - * @param w {Number} The width of the rectangle, in pixels - * @param h {Number} The height of the rectangle, in pixels - * @description The fillRect() method draws a "filled" rectangle. The default color of the fill is black. + /** + * Draws a "filled" rectangle + * + * @name fillRect + * @function + * @param x {Number} The x-coordinate of the upper-left corner of the rectangle + * @param y {Number} The y-coordinate of the upper-left corner of the rectangle + * @param w {Number} The width of the rectangle, in pixels + * @param h {Number} The height of the rectangle, in pixels + * @description The fillRect() method draws a "filled" rectangle. The default color of the fill is black. */ @@ -10356,16 +10065,16 @@ this.lineJoin = tmp.lineJoin; } }; - /** - * Draws a rectangle (no fill) - * - * @name strokeRect - * @function - * @param x {Number} The x-coordinate of the upper-left corner of the rectangle - * @param y {Number} The y-coordinate of the upper-left corner of the rectangle - * @param w {Number} The width of the rectangle, in pixels - * @param h {Number} The height of the rectangle, in pixels - * @description The strokeRect() method draws a rectangle (no fill). The default color of the stroke is black. + /** + * Draws a rectangle (no fill) + * + * @name strokeRect + * @function + * @param x {Number} The x-coordinate of the upper-left corner of the rectangle + * @param y {Number} The y-coordinate of the upper-left corner of the rectangle + * @param w {Number} The width of the rectangle, in pixels + * @param h {Number} The height of the rectangle, in pixels + * @description The strokeRect() method draws a rectangle (no fill). The default color of the stroke is black. */ @@ -10383,20 +10092,20 @@ this.rect(x, y, w, h); this.stroke(); }; - /** - * Clears the specified pixels within a given rectangle - * - * @name clearRect - * @function - * @param x {Number} The x-coordinate of the upper-left corner of the rectangle - * @param y {Number} The y-coordinate of the upper-left corner of the rectangle - * @param w {Number} The width of the rectangle to clear, in pixels - * @param h {Number} The height of the rectangle to clear, in pixels - * @description We cannot clear PDF commands that were already written to PDF, so we use white instead.
    - * As a special case, read a special flag (ignoreClearRect) and do nothing if it is set. - * This results in all calls to clearRect() to do nothing, and keep the canvas transparent. - * This flag is stored in the save/restore context and is managed the same way as other drawing states. - * + /** + * Clears the specified pixels within a given rectangle + * + * @name clearRect + * @function + * @param x {Number} The x-coordinate of the upper-left corner of the rectangle + * @param y {Number} The y-coordinate of the upper-left corner of the rectangle + * @param w {Number} The width of the rectangle to clear, in pixels + * @param h {Number} The height of the rectangle to clear, in pixels + * @description We cannot clear PDF commands that were already written to PDF, so we use white instead.
    + * As a special case, read a special flag (ignoreClearRect) and do nothing if it is set. + * This results in all calls to clearRect() to do nothing, and keep the canvas transparent. + * This flag is stored in the save/restore context and is managed the same way as other drawing states. + * */ @@ -10413,11 +10122,11 @@ this.fillStyle = '#ffffff'; this.fillRect(x, y, w, h); }; - /** - * Saves the state of the current context - * - * @name save - * @function + /** + * Saves the state of the current context + * + * @name save + * @function */ @@ -10439,11 +10148,11 @@ this.ctx = ctx; } }; - /** - * Returns previously saved path state and attributes - * - * @name restore - * @function + /** + * Returns previously saved path state and attributes + * + * @name restore + * @function */ @@ -10468,9 +10177,9 @@ this.lineJoin = this.ctx.lineJoin; } }; - /** - * @name toDataURL - * @function + /** + * @name toDataURL + * @function */ @@ -10478,13 +10187,13 @@ throw new Error('toDataUrl not implemented.'); }; //helper functions - /** - * Get the decimal values of r, g, b and a - * - * @name getRGBA - * @function - * @private - * @ignore + /** + * Get the decimal values of r, g, b and a + * + * @name getRGBA + * @function + * @private + * @ignore */ @@ -10498,8 +10207,6 @@ style = style.getColor(); } - var rgbColor = new RGBColor(style); - if (!style) { return { r: 0, @@ -10534,7 +10241,9 @@ } else { a = 1; - if (style.charAt(0) !== '#') { + if (typeof style === "string" && style.charAt(0) !== '#') { + var rgbColor = new RGBColor(style); + if (rgbColor.ok) { style = rgbColor.toHex(); } else { @@ -10570,40 +10279,40 @@ style: style }; }; - /** - * @name isFillTransparent - * @function - * @private - * @ignore - * @returns {Boolean} + /** + * @name isFillTransparent + * @function + * @private + * @ignore + * @returns {Boolean} */ var isFillTransparent = function isFillTransparent() { return this.ctx.isFillTransparent || this.globalAlpha == 0; }; - /** - * @name isStrokeTransparent - * @function - * @private - * @ignore - * @returns {Boolean} + /** + * @name isStrokeTransparent + * @function + * @private + * @ignore + * @returns {Boolean} */ var isStrokeTransparent = function isStrokeTransparent() { return Boolean(this.ctx.isStrokeTransparent || this.globalAlpha == 0); }; - /** - * Draws "filled" text on the canvas - * - * @name fillText - * @function - * @param text {String} Specifies the text that will be written on the canvas - * @param x {Number} The x coordinate where to start painting the text (relative to the canvas) - * @param y {Number} The y coordinate where to start painting the text (relative to the canvas) - * @param maxWidth {Number} Optional. The maximum allowed width of the text, in pixels - * @description The fillText() method draws filled text on the canvas. The default color of the text is black. + /** + * Draws "filled" text on the canvas + * + * @name fillText + * @function + * @param text {String} Specifies the text that will be written on the canvas + * @param x {Number} The x coordinate where to start painting the text (relative to the canvas) + * @param y {Number} The y coordinate where to start painting the text (relative to the canvas) + * @param maxWidth {Number} Optional. The maximum allowed width of the text, in pixels + * @description The fillText() method draws filled text on the canvas. The default color of the text is black. */ @@ -10633,16 +10342,16 @@ maxWidth: maxWidth }); }; - /** - * Draws text on the canvas (no fill) - * - * @name strokeText - * @function - * @param text {String} Specifies the text that will be written on the canvas - * @param x {Number} The x coordinate where to start painting the text (relative to the canvas) - * @param y {Number} The y coordinate where to start painting the text (relative to the canvas) - * @param maxWidth {Number} Optional. The maximum allowed width of the text, in pixels - * @description The strokeText() method draws text (with no fill) on the canvas. The default color of the text is black. + /** + * Draws text on the canvas (no fill) + * + * @name strokeText + * @function + * @param text {String} Specifies the text that will be written on the canvas + * @param x {Number} The x coordinate where to start painting the text (relative to the canvas) + * @param y {Number} The y coordinate where to start painting the text (relative to the canvas) + * @param maxWidth {Number} Optional. The maximum allowed width of the text, in pixels + * @description The strokeText() method draws text (with no fill) on the canvas. The default color of the text is black. */ @@ -10671,14 +10380,14 @@ maxWidth: maxWidth }); }; - /** - * Returns an object that contains the width of the specified text - * - * @name measureText - * @function - * @param text {String} The text to be measured - * @description The measureText() method returns an object that contains the width of the specified text, in pixels. - * @returns {Number} + /** + * Returns an object that contains the width of the specified text + * + * @name measureText + * @function + * @param text {String} The text to be measured + * @description The measureText() method returns an object that contains the width of the specified text, in pixels. + * @returns {Number} */ @@ -10712,14 +10421,14 @@ }); }; //Transformations - /** - * Scales the current drawing bigger or smaller - * - * @name scale - * @function - * @param scalewidth {Number} Scales the width of the current drawing (1=100%, 0.5=50%, 2=200%, etc.) - * @param scaleheight {Number} Scales the height of the current drawing (1=100%, 0.5=50%, 2=200%, etc.) - * @description The scale() method scales the current drawing, bigger or smaller. + /** + * Scales the current drawing bigger or smaller + * + * @name scale + * @function + * @param scalewidth {Number} Scales the width of the current drawing (1=100%, 0.5=50%, 2=200%, etc.) + * @param scaleheight {Number} Scales the height of the current drawing (1=100%, 0.5=50%, 2=200%, etc.) + * @description The scale() method scales the current drawing, bigger or smaller. */ @@ -10732,14 +10441,14 @@ var matrix = new Matrix(scalewidth, 0.0, 0.0, scaleheight, 0.0, 0.0); this.ctx.transform = this.ctx.transform.multiply(matrix); }; - /** - * Rotates the current drawing - * - * @name rotate - * @function - * @param angle {Number} The rotation angle, in radians. - * @description To calculate from degrees to radians: degrees*Math.PI/180.
    - * Example: to rotate 5 degrees, specify the following: 5*Math.PI/180 + /** + * Rotates the current drawing + * + * @name rotate + * @function + * @param angle {Number} The rotation angle, in radians. + * @description To calculate from degrees to radians: degrees*Math.PI/180.
    + * Example: to rotate 5 degrees, specify the following: 5*Math.PI/180 */ @@ -10752,14 +10461,14 @@ var matrix = new Matrix(Math.cos(angle), Math.sin(angle), -Math.sin(angle), Math.cos(angle), 0.0, 0.0); this.ctx.transform = this.ctx.transform.multiply(matrix); }; - /** - * Remaps the (0,0) position on the canvas - * - * @name translate - * @function - * @param x {Number} The value to add to horizontal (x) coordinates - * @param y {Number} The value to add to vertical (y) coordinates - * @description The translate() method remaps the (0,0) position on the canvas. + /** + * Remaps the (0,0) position on the canvas + * + * @name translate + * @function + * @param x {Number} The value to add to horizontal (x) coordinates + * @param y {Number} The value to add to vertical (y) coordinates + * @description The translate() method remaps the (0,0) position on the canvas. */ @@ -10772,18 +10481,18 @@ var matrix = new Matrix(1.0, 0.0, 0.0, 1.0, x, y); this.ctx.transform = this.ctx.transform.multiply(matrix); }; - /** - * Replaces the current transformation matrix for the drawing - * - * @name transform - * @function - * @param a {Number} Horizontal scaling - * @param b {Number} Horizontal skewing - * @param c {Number} Vertical skewing - * @param d {Number} Vertical scaling - * @param e {Number} Horizontal moving - * @param f {Number} Vertical moving - * @description Each object on the canvas has a current transformation matrix.

    The transform() method replaces the current transformation matrix. It multiplies the current transformation matrix with the matrix described by:



    a c e

    b d f

    0 0 1

    In other words, the transform() method lets you scale, rotate, move, and skew the current context. + /** + * Replaces the current transformation matrix for the drawing + * + * @name transform + * @function + * @param a {Number} Horizontal scaling + * @param b {Number} Horizontal skewing + * @param c {Number} Vertical skewing + * @param d {Number} Vertical scaling + * @param e {Number} Horizontal moving + * @param f {Number} Vertical moving + * @description Each object on the canvas has a current transformation matrix.

    The transform() method replaces the current transformation matrix. It multiplies the current transformation matrix with the matrix described by:



    a c e

    b d f

    0 0 1

    In other words, the transform() method lets you scale, rotate, move, and skew the current context. */ @@ -10796,18 +10505,18 @@ var matrix = new Matrix(a, b, c, d, e, f); this.ctx.transform = this.ctx.transform.multiply(matrix); }; - /** - * Resets the current transform to the identity matrix. Then runs transform() - * - * @name setTransform - * @function - * @param a {Number} Horizontal scaling - * @param b {Number} Horizontal skewing - * @param c {Number} Vertical skewing - * @param d {Number} Vertical scaling - * @param e {Number} Horizontal moving - * @param f {Number} Vertical moving - * @description Each object on the canvas has a current transformation matrix.

    The setTransform() method resets the current transform to the identity matrix, and then runs transform() with the same arguments.

    In other words, the setTransform() method lets you scale, rotate, move, and skew the current context. + /** + * Resets the current transform to the identity matrix. Then runs transform() + * + * @name setTransform + * @function + * @param a {Number} Horizontal scaling + * @param b {Number} Horizontal skewing + * @param c {Number} Vertical skewing + * @param d {Number} Vertical scaling + * @param e {Number} Horizontal moving + * @param f {Number} Vertical moving + * @description Each object on the canvas has a current transformation matrix.

    The setTransform() method resets the current transform to the identity matrix, and then runs transform() with the same arguments.

    In other words, the setTransform() method lets you scale, rotate, move, and skew the current context. */ @@ -10820,19 +10529,19 @@ f = isNaN(f) ? 0 : f; this.ctx.transform = new Matrix(a, b, c, d, e, f); }; - /** - * Draws an image, canvas, or video onto the canvas - * - * @function - * @param img {} Specifies the image, canvas, or video element to use - * @param sx {Number} Optional. The x coordinate where to start clipping - * @param sy {Number} Optional. The y coordinate where to start clipping - * @param swidth {Number} Optional. The width of the clipped image - * @param sheight {Number} Optional. The height of the clipped image - * @param x {Number} The x coordinate where to place the image on the canvas - * @param y {Number} The y coordinate where to place the image on the canvas - * @param width {Number} Optional. The width of the image to use (stretch or reduce the image) - * @param height {Number} Optional. The height of the image to use (stretch or reduce the image) + /** + * Draws an image, canvas, or video onto the canvas + * + * @function + * @param img {} Specifies the image, canvas, or video element to use + * @param sx {Number} Optional. The x coordinate where to start clipping + * @param sy {Number} Optional. The y coordinate where to start clipping + * @param swidth {Number} Optional. The width of the clipped image + * @param sheight {Number} Optional. The height of the clipped image + * @param x {Number} The x coordinate where to place the image on the canvas + * @param y {Number} The y coordinate where to place the image on the canvas + * @param width {Number} Optional. The width of the image to use (stretch or reduce the image) + * @param height {Number} Optional. The height of the image to use (stretch or reduce the image) */ @@ -11063,14 +10772,14 @@ this.path = origPath; }; - /** - * Processes the paths - * - * @function - * @param rule {String} - * @param isClip {Boolean} - * @private - * @ignore + /** + * Processes the paths + * + * @function + * @param rule {String} + * @param isClip {Boolean} + * @private + * @ignore */ @@ -11270,16 +10979,16 @@ Context2D.prototype.createRadialGradient = function createRadialGradient() { return this.createLinearGradient(); }; - /** - * - * @param x Edge point X - * @param y Edge point Y - * @param r Radius - * @param a1 start angle - * @param a2 end angle - * @param counterclockwise - * @param style - * @param isClip + /** + * + * @param x Edge point X + * @param y Edge point Y + * @param r Radius + * @param a1 start angle + * @param a2 end angle + * @param counterclockwise + * @param style + * @param isClip */ @@ -11432,11 +11141,11 @@ var drawCurve = function drawCurve(x, y, x1, y1, x2, y2, x3, y3) { this.pdf.internal.out([f2(getHorizontalCoordinate(x1 + x)), f2(getVerticalCoordinate(y1 + y)), f2(getHorizontalCoordinate(x2 + x)), f2(getVerticalCoordinate(y2 + y)), f2(getHorizontalCoordinate(x3 + x)), f2(getVerticalCoordinate(y3 + y)), 'c'].join(' ')); }; - /** - * Return a array of objects that represent bezier curves which approximate the circular arc centered at the origin, from startAngle to endAngle (radians) with the specified radius. - * - * Each bezier curve is an object with four points, where x1,y1 and x4,y4 are the arc's end points and x2,y2 and x3,y3 are the cubic bezier's control points. - * @function createArc + /** + * Return a array of objects that represent bezier curves which approximate the circular arc centered at the origin, from startAngle to endAngle (radians) with the specified radius. + * + * Each bezier curve is an object with four points, where x1,y1 and x4,y4 are the arc's end points and x2,y2 and x3,y3 are the cubic bezier's control points. + * @function createArc */ @@ -11472,12 +11181,12 @@ return curves; }; - /** - * Cubic bezier approximation of a circular arc centered at the origin, from (radians) a1 to a2, where a2-a1 < pi/2. The arc's radius is r. - * - * Returns an object with four points, where x1,y1 and x4,y4 are the arc's end points and x2,y2 and x3,y3 are the cubic bezier's control points. - * - * This algorithm is based on the approach described in: A. Riškus, "Approximation of a Cubic Bezier Curve by Circular Arcs and Vice Versa," Information Technology and Control, 35(4), 2006 pp. 371-378. + /** + * Cubic bezier approximation of a circular arc centered at the origin, from (radians) a1 to a2, where a2-a1 < pi/2. The arc's radius is r. + * + * Returns an object with four points, where x1,y1 and x4,y4 are the arc's end points and x2,y2 and x3,y3 are the cubic bezier's control points. + * + * This algorithm is based on the approach described in: A. Riškus, "Approximation of a Cubic Bezier Curve by Circular Arcs and Vice Versa," Information Technology and Control, 35(4), 2006 pp. 371-378. */ @@ -11754,14 +11463,14 @@ this.ty = !isNaN(ty) ? ty : 0; return this; }; - /** - * Multiply the matrix with given Matrix - * - * @function multiply - * @param matrix - * @returns {Matrix} - * @private - * @ignore + /** + * Multiply the matrix with given Matrix + * + * @function multiply + * @param matrix + * @returns {Matrix} + * @private + * @ignore */ @@ -11774,10 +11483,10 @@ var ty = matrix.tx * this.shy + matrix.ty * this.sy + this.ty; return new Matrix(sx, shy, shx, sy, tx, ty); }; - /** - * @function decompose - * @private - * @ignore + /** + * @function decompose + * @private + * @ignore */ @@ -11813,10 +11522,10 @@ skew: new Matrix(1, 0, shear, 1, 0, 0) }; }; - /** - * @function applyToPoint - * @private - * @ignore + /** + * @function applyToPoint + * @private + * @ignore */ @@ -11825,10 +11534,10 @@ var y = pt.x * this.shy + pt.y * this.sy + this.ty; return new Point(x, y); }; - /** - * @function applyToRectangle - * @private - * @ignore + /** + * @function applyToRectangle + * @private + * @ignore */ @@ -11837,10 +11546,10 @@ var pt2 = this.applyToPoint(new Point(rect.x + rect.w, rect.y + rect.h)); return new Rectangle(pt1.x, pt1.y, pt2.x - pt1.x, pt2.y - pt1.y); }; - /** - * @function clone - * @private - * @ignore + /** + * @function clone + * @private + * @ignore */ @@ -11855,12 +11564,12 @@ }; })(jsPDF.API, typeof self !== 'undefined' && self || typeof window !== 'undefined' && window || typeof global !== 'undefined' && global || Function('return typeof this === "object" && this.content')() || Function('return this')()); - /** - * jsPDF filters PlugIn - * Copyright (c) 2014 Aras Abbasi - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * jsPDF filters PlugIn + * Copyright (c) 2014 Aras Abbasi + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ (function (jsPDFAPI) { @@ -11901,74 +11610,74 @@ } }(e, c[l]), h.fromCharCode.apply(h, e); }; - /** - * TODO: Not Tested: - //https://gist.github.com/revolunet/843889 - // LZW-compress a string - var LZWEncode = function(s, options) { - options = Object.assign({ - predictor: 1, - colors: 1, - bitsPerComponent: 8, - columns: 1, - earlyChange: 1 - }, options); - var dict = {}; - var data = (s + "").split(""); - var out = []; - var currChar; - var phrase = data[0]; - var code = 256; //0xe000 - for (var i=1; i 1 ? dict['_'+phrase] : phrase.charCodeAt(0)); - dict['_' + phrase + currChar] = code; - code++; - phrase=currChar; - } - } - out.push(phrase.length > 1 ? dict['_'+phrase] : phrase.charCodeAt(0)); - for (var i=0; i 1 ? dict['_'+phrase] : phrase.charCodeAt(0)); + dict['_' + phrase + currChar] = code; + code++; + phrase=currChar; + } + } + out.push(phrase.length > 1 ? dict['_'+phrase] : phrase.charCodeAt(0)); + for (var i=0; i>> pbl & 0xff; } } - /* - * processes 16 bit RGBA and grayscale + alpha images + /* + * processes 16 bit RGBA and grayscale + alpha images */ @@ -13734,8 +13449,8 @@ decode = null; } } - /* - * Indexed png. Each pixel is a palette index. + /* + * Indexed png. Each pixel is a palette index. */ @@ -13754,16 +13469,16 @@ } total = total / 255; - /* - * a single color is specified as 100% transparent (0), - * so we set trns to use a /Mask with that index + /* + * a single color is specified as 100% transparent (0), + * so we set trns to use a /Mask with that index */ if (total === len - 1 && trans.indexOf(0) !== -1) { trns = [trans.indexOf(0)]; - /* - * there's more than one colour within the palette that specifies - * a transparency value less than 255, so we unroll the pixels to create an image sMask + /* + * there's more than one colour within the palette that specifies + * a transparency value less than 255, so we unroll the pixels to create an image sMask */ } else if (total !== len) { var pixels = img.decodePixels(), @@ -13792,19 +13507,19 @@ }; })(jsPDF.API); - /** - * @license - * Copyright (c) 2017 Aras Abbasi - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * @license + * Copyright (c) 2017 Aras Abbasi + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ - /** - * jsPDF gif Support PlugIn - * - * @name gif_support - * @module + /** + * jsPDF gif Support PlugIn + * + * @name gif_support + * @module */ (function (jsPDFAPI) { @@ -13828,17 +13543,17 @@ jsPDFAPI.processGIF87A = jsPDFAPI.processGIF89A; })(jsPDF.API); - /** - * Copyright (c) 2018 Aras Abbasi - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * Copyright (c) 2018 Aras Abbasi + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ - /** - * jsPDF bmp Support PlugIn - * @name bmp_support - * @module + /** + * jsPDF bmp Support PlugIn + * @name bmp_support + * @module */ (function (jsPDFAPI) { @@ -13859,31 +13574,31 @@ }; })(jsPDF.API); - /** - * @license - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * @license + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ - /** - * jsPDF setLanguage Plugin - * - * @name setLanguage - * @module + /** + * jsPDF setLanguage Plugin + * + * @name setLanguage + * @module */ (function (jsPDFAPI) { - /** - * Add Language Tag to the generated PDF - * - * @name setLanguage - * @function - * @param {string} langCode The Language code as ISO-639-1 (e.g. 'en') or as country language code (e.g. 'en-GB'). - * @returns {jsPDF} - * @example - * var doc = new jsPDF() - * doc.text(10, 10, 'This is a test') - * doc.setLanguage("en-US") - * doc.save('english.pdf') + /** + * Add Language Tag to the generated PDF + * + * @name setLanguage + * @function + * @param {string} langCode The Language code as ISO-639-1 (e.g. 'en') or as country language code (e.g. 'en-GB'). + * @returns {jsPDF} + * @example + * var doc = new jsPDF() + * doc.text(10, 10, 'This is a test') + * doc.setLanguage("en-US") + * doc.save('english.pdf') */ jsPDFAPI.setLanguage = function (langCode) { @@ -14107,31 +13822,31 @@ }; })(jsPDF.API); - /** @license - * MIT license. - * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com - * 2014 Diego Casorran, https://github.com/diegocr - * - * - * ==================================================================== + /** @license + * MIT license. + * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com + * 2014 Diego Casorran, https://github.com/diegocr + * + * + * ==================================================================== */ - /** - * jsPDF split_text_to_size plugin - * - * @name split_text_to_size - * @module + /** + * jsPDF split_text_to_size plugin + * + * @name split_text_to_size + * @module */ (function (API) { - /** - * Returns an array of length matching length of the 'word' string, with each - * cell occupied by the width of the char in that position. - * - * @name getCharWidthsArray - * @function - * @param {string} text - * @param {Object} options - * @returns {Array} + /** + * Returns an array of length matching length of the 'word' string, with each + * cell occupied by the width of the char in that position. + * + * @name getCharWidthsArray + * @function + * @param {string} text + * @param {Object} options + * @returns {Array} */ var getCharWidthsArray = API.getCharWidthsArray = function (text, options) { @@ -14165,14 +13880,14 @@ return output; }; - /** - * Calculate the sum of a number-array - * - * @name getArraySum - * @public - * @function - * @param {Array} array Array of numbers - * @returns {number} + /** + * Calculate the sum of a number-array + * + * @name getArraySum + * @public + * @function + * @param {Array} array Array of numbers + * @returns {number} */ @@ -14187,21 +13902,21 @@ return output; }; - /** - * Returns a widths of string in a given font, if the font size is set as 1 point. - * - * In other words, this is "proportional" value. For 1 unit of font size, the length - * of the string will be that much. - * - * Multiply by font size to get actual width in *points* - * Then divide by 72 to get inches or divide by (72/25.6) to get 'mm' etc. - * - * @name getStringUnitWidth - * @public - * @function - * @param {string} text - * @param {string} options - * @returns {number} result + /** + * Returns a widths of string in a given font, if the font size is set as 1 point. + * + * In other words, this is "proportional" value. For 1 unit of font size, the length + * of the string will be that much. + * + * Multiply by font size to get actual width in *points* + * Then divide by 72 to get inches or divide by (72/25.6) to get 'mm' etc. + * + * @name getStringUnitWidth + * @public + * @function + * @param {string} text + * @param {string} options + * @returns {number} result */ @@ -14220,8 +13935,8 @@ return result; }; - /** - returns array of lines + /** + returns array of lines */ @@ -14364,22 +14079,22 @@ return lines.map(postProcess); }; - /** - * Splits a given string into an array of strings. Uses 'size' value - * (in measurement units declared as default for the jsPDF instance) - * and the font's "widths" and "Kerning" tables, where available, to - * determine display length of a given string for a given font. - * - * We use character's 100% of unit size (height) as width when Width - * table or other default width is not available. - * - * @name splitTextToSize - * @public - * @function - * @param {string} text Unencoded, regular JavaScript (Unicode, UTF-16 / UCS-2) string. - * @param {number} size Nominal number, measured in units default to this instance of jsPDF. - * @param {Object} options Optional flags needed for chopper to do the right thing. - * @returns {Array} array Array with strings chopped to size. + /** + * Splits a given string into an array of strings. Uses 'size' value + * (in measurement units declared as default for the jsPDF instance) + * and the font's "widths" and "Kerning" tables, where available, to + * determine display length of a given string for a given font. + * + * We use character's 100% of unit size (height) as width when Width + * table or other default width is not available. + * + * @name splitTextToSize + * @public + * @function + * @param {string} text Unencoded, regular JavaScript (Unicode, UTF-16 / UCS-2) string. + * @param {number} size Nominal number, measured in units default to this instance of jsPDF. + * @param {Object} options Optional flags needed for chopper to do the right thing. + * @returns {Array} array Array with strings chopped to size. */ @@ -14460,149 +14175,149 @@ }; })(jsPDF.API); - /** @license - jsPDF standard_fonts_metrics plugin - * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com - * MIT license. - * - * ==================================================================== + /** @license + jsPDF standard_fonts_metrics plugin + * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com + * MIT license. + * + * ==================================================================== */ (function (API) { - /* - # reference (Python) versions of 'compress' and 'uncompress' - # only 'uncompress' function is featured lower as JavaScript - # if you want to unit test "roundtrip", just transcribe the reference - # 'compress' function from Python into JavaScript - - def compress(data): - - keys = '0123456789abcdef' - values = 'klmnopqrstuvwxyz' - mapping = dict(zip(keys, values)) - vals = [] - for key in data.keys(): - value = data[key] - try: - keystring = hex(key)[2:] - keystring = keystring[:-1] + mapping[keystring[-1:]] - except: - keystring = key.join(["'","'"]) - #print('Keystring is %s' % keystring) - - try: - if value < 0: - valuestring = hex(value)[3:] - numberprefix = '-' - else: - valuestring = hex(value)[2:] - numberprefix = '' - valuestring = numberprefix + valuestring[:-1] + mapping[valuestring[-1:]] - except: - if type(value) == dict: - valuestring = compress(value) - else: - raise Exception("Don't know what to do with value type %s" % type(value)) - - vals.append(keystring+valuestring) - - return '{' + ''.join(vals) + '}' - - def uncompress(data): - - decoded = '0123456789abcdef' - encoded = 'klmnopqrstuvwxyz' - mapping = dict(zip(encoded, decoded)) - - sign = +1 - stringmode = False - stringparts = [] - - output = {} - - activeobject = output - parentchain = [] - - keyparts = '' - valueparts = '' - - key = None - - ending = set(encoded) - - i = 1 - l = len(data) - 1 # stripping starting, ending {} - while i != l: # stripping {} - # -, {, }, ' are special. - - ch = data[i] - i += 1 - - if ch == "'": - if stringmode: - # end of string mode - stringmode = False - key = ''.join(stringparts) - else: - # start of string mode - stringmode = True - stringparts = [] - elif stringmode == True: - #print("Adding %s to stringpart" % ch) - stringparts.append(ch) - - elif ch == '{': - # start of object - parentchain.append( [activeobject, key] ) - activeobject = {} - key = None - #DEBUG = True - elif ch == '}': - # end of object - parent, key = parentchain.pop() - parent[key] = activeobject - key = None - activeobject = parent - #DEBUG = False - - elif ch == '-': - sign = -1 - else: - # must be number - if key == None: - #debug("In Key. It is '%s', ch is '%s'" % (keyparts, ch)) - if ch in ending: - #debug("End of key") - keyparts += mapping[ch] - key = int(keyparts, 16) * sign - sign = +1 - keyparts = '' - else: - keyparts += ch - else: - #debug("In value. It is '%s', ch is '%s'" % (valueparts, ch)) - if ch in ending: - #debug("End of value") - valueparts += mapping[ch] - activeobject[key] = int(valueparts, 16) * sign - sign = +1 - key = None - valueparts = '' - else: - valueparts += ch - - #debug(activeobject) - - return output - + /* + # reference (Python) versions of 'compress' and 'uncompress' + # only 'uncompress' function is featured lower as JavaScript + # if you want to unit test "roundtrip", just transcribe the reference + # 'compress' function from Python into JavaScript + + def compress(data): + + keys = '0123456789abcdef' + values = 'klmnopqrstuvwxyz' + mapping = dict(zip(keys, values)) + vals = [] + for key in data.keys(): + value = data[key] + try: + keystring = hex(key)[2:] + keystring = keystring[:-1] + mapping[keystring[-1:]] + except: + keystring = key.join(["'","'"]) + #print('Keystring is %s' % keystring) + + try: + if value < 0: + valuestring = hex(value)[3:] + numberprefix = '-' + else: + valuestring = hex(value)[2:] + numberprefix = '' + valuestring = numberprefix + valuestring[:-1] + mapping[valuestring[-1:]] + except: + if type(value) == dict: + valuestring = compress(value) + else: + raise Exception("Don't know what to do with value type %s" % type(value)) + + vals.append(keystring+valuestring) + + return '{' + ''.join(vals) + '}' + + def uncompress(data): + + decoded = '0123456789abcdef' + encoded = 'klmnopqrstuvwxyz' + mapping = dict(zip(encoded, decoded)) + + sign = +1 + stringmode = False + stringparts = [] + + output = {} + + activeobject = output + parentchain = [] + + keyparts = '' + valueparts = '' + + key = None + + ending = set(encoded) + + i = 1 + l = len(data) - 1 # stripping starting, ending {} + while i != l: # stripping {} + # -, {, }, ' are special. + + ch = data[i] + i += 1 + + if ch == "'": + if stringmode: + # end of string mode + stringmode = False + key = ''.join(stringparts) + else: + # start of string mode + stringmode = True + stringparts = [] + elif stringmode == True: + #print("Adding %s to stringpart" % ch) + stringparts.append(ch) + + elif ch == '{': + # start of object + parentchain.append( [activeobject, key] ) + activeobject = {} + key = None + #DEBUG = True + elif ch == '}': + # end of object + parent, key = parentchain.pop() + parent[key] = activeobject + key = None + activeobject = parent + #DEBUG = False + + elif ch == '-': + sign = -1 + else: + # must be number + if key == None: + #debug("In Key. It is '%s', ch is '%s'" % (keyparts, ch)) + if ch in ending: + #debug("End of key") + keyparts += mapping[ch] + key = int(keyparts, 16) * sign + sign = +1 + keyparts = '' + else: + keyparts += ch + else: + #debug("In value. It is '%s', ch is '%s'" % (valueparts, ch)) + if ch in ending: + #debug("End of value") + valueparts += mapping[ch] + activeobject[key] = int(valueparts, 16) * sign + sign = +1 + key = None + valueparts = '' + else: + valueparts += ch + + #debug(activeobject) + + return output + */ - /** - Uncompresses data compressed into custom, base16-like format. - @public - @function - @param - @returns {Type} + /** + Uncompresses data compressed into custom, base16-like format. + @public + @function + @param + @returns {Type} */ var uncompress = function uncompress(data) { @@ -14746,16 +14461,16 @@ 'Helvetica-Oblique': uncompress("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}") } }; - /* - This event handler is fired when a new jsPDF object is initialized - This event handler appends metrics data to standard fonts within - that jsPDF instance. The metrics are mapped over Unicode character - codes, NOT CIDs or other codes matching the StandardEncoding table of the - standard PDF fonts. - Future: - Also included is the encoding maping table, converting Unicode (UCS-2, UTF-16) - char codes to StandardEncoding character codes. The encoding table is to be used - somewhere around "pdfEscape" call. + /* + This event handler is fired when a new jsPDF object is initialized + This event handler appends metrics data to standard fonts within + that jsPDF instance. The metrics are mapped over Unicode character + codes, NOT CIDs or other codes matching the StandardEncoding table of the + standard PDF fonts. + Future: + Also included is the encoding maping table, converting Unicode (UCS-2, UTF-16) + char codes to StandardEncoding character codes. The encoding table is to be used + somewhere around "pdfEscape" call. */ API.events.push(['addFont', function (data) { @@ -14795,15 +14510,15 @@ }]); // end of adding event handler })(jsPDF.API); - /** - * @license - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * @license + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ - /** - * @name ttfsupport - * @module + /** + * @name ttfsupport + * @module */ (function (jsPDF, global) { @@ -14812,7 +14527,13 @@ var instance = data.instance; if (typeof instance !== "undefined" && instance.existsFileInVFS(font.postScriptName)) { - font.metadata = jsPDF.API.TTFFont.open(font.postScriptName, font.fontName, instance.getFileFromVFS(font.postScriptName), font.encoding); + var file = instance.getFileFromVFS(font.postScriptName); + + if (typeof file !== "string") { + throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('" + font.postScriptName + "')."); + } + + font.metadata = jsPDF.API.TTFFont.open(font.postScriptName, font.fontName, file, font.encoding); font.metadata.Unicode = font.metadata.Unicode || { encoding: {}, kerning: {}, @@ -14820,35 +14541,35 @@ }; font.metadata.glyIdsUsed = [0]; } else if (font.isStandardFont === false) { - throw new Error("Font does not exist in FileInVFS, import fonts or remove declaration doc.addFont('" + font.postScriptName + "')."); + throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('" + font.postScriptName + "')."); } }]); // end of adding event handler })(jsPDF, typeof self !== "undefined" && self || typeof global !== "undefined" && global || typeof window !== "undefined" && window || Function("return this")()); - /** @license - * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com - * - * - * ==================================================================== + /** @license + * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com + * + * + * ==================================================================== */ (function (jsPDFAPI) { - /** - * Parses SVG XML and converts only some of the SVG elements into - * PDF elements. - * - * Supports: - * paths - * - * @name addSvg - * @public - * @function - * @param {string} SVG-Data as Text - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {number} width of SVG (in units declared at inception of PDF document) - * @param {number} height of SVG (in units declared at inception of PDF document) - * @returns {Object} jsPDF-instance + /** + * Parses SVG XML and converts only some of the SVG elements into + * PDF elements. + * + * Supports: + * paths + * + * @name addSvg + * @public + * @function + * @param {string} SVG-Data as Text + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page + * @param {number} width of SVG (in units declared at inception of PDF document) + * @param {number} height of SVG (in units declared at inception of PDF document) + * @returns {Object} jsPDF-instance */ jsPDFAPI.addSvg = function (svgtext, x, y, w, h) { @@ -14976,24 +14697,24 @@ jsPDFAPI.addSVG = jsPDFAPI.addSvg; - /** - * Parses SVG XML and saves it as image into the PDF. - * - * Depends on canvas-element and canvg - * - * @name addSvgAsImage - * @public - * @function - * @param {string} SVG-Data as Text - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {number} width of SVG-Image (in units declared at inception of PDF document) - * @param {number} height of SVG-Image (in units declared at inception of PDF document) - * @param {string} alias of SVG-Image (if used multiple times) - * @param {string} compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW' - * @param {number} rotation of the image in degrees (0-359) - * - * @returns jsPDF jsPDF-instance + /** + * Parses SVG XML and saves it as image into the PDF. + * + * Depends on canvas-element and canvg + * + * @name addSvgAsImage + * @public + * @function + * @param {string} SVG-Data as Text + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page + * @param {number} width of SVG-Image (in units declared at inception of PDF document) + * @param {number} height of SVG-Image (in units declared at inception of PDF document) + * @param {string} alias of SVG-Image (if used multiple times) + * @param {string} compression of the generated JPEG, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW' + * @param {number} rotation of the image in degrees (0-359) + * + * @returns jsPDF jsPDF-instance */ jsPDFAPI.addSvgAsImage = function (svg, x, y, w, h, alias, compression, rotation) { @@ -15026,26 +14747,26 @@ }; })(jsPDF.API); - /** - * @license - * ==================================================================== - * Copyright (c) 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br - * - * - * ==================================================================== + /** + * @license + * ==================================================================== + * Copyright (c) 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br + * + * + * ==================================================================== */ - /** - * jsPDF total_pages plugin - * @name total_pages - * @module + /** + * jsPDF total_pages plugin + * @name total_pages + * @module */ (function (jsPDFAPI) { - /** - * @name putTotalPages - * @function - * @param {string} pageExpression Regular Expression - * @returns {jsPDF} jsPDF-instance + /** + * @name putTotalPages + * @function + * @param {string} pageExpression Regular Expression + * @returns {jsPDF} jsPDF-instance */ jsPDFAPI.putTotalPages = function (pageExpression) { @@ -15071,109 +14792,109 @@ }; })(jsPDF.API); - /** - * jsPDF viewerPreferences Plugin - * @author Aras Abbasi (github.com/arasabbasi) - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * jsPDF viewerPreferences Plugin + * @author Aras Abbasi (github.com/arasabbasi) + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ - /** - * Adds the ability to set ViewerPreferences and by thus - * controlling the way the document is to be presented on the - * screen or in print. - * @name viewerpreferences - * @module + /** + * Adds the ability to set ViewerPreferences and by thus + * controlling the way the document is to be presented on the + * screen or in print. + * @name viewerpreferences + * @module */ (function (jsPDFAPI) { - /** - * Set the ViewerPreferences of the generated PDF - * - * @name viewerPreferences - * @function - * @public - * @param {Object} options Array with the ViewerPreferences
    - * Example: doc.viewerPreferences({"FitWindow":true});
    - *
    - * You can set following preferences:
    - *
    - * HideToolbar (boolean)
    - * Default value: false
    - *
    - * HideMenubar (boolean)
    - * Default value: false.
    - *
    - * HideWindowUI (boolean)
    - * Default value: false.
    - *
    - * FitWindow (boolean)
    - * Default value: false.
    - *
    - * CenterWindow (boolean)
    - * Default value: false
    - *
    - * DisplayDocTitle (boolean)
    - * Default value: false.
    - *
    - * NonFullScreenPageMode (string)
    - * Possible values: UseNone, UseOutlines, UseThumbs, UseOC
    - * Default value: UseNone
    - *
    - * Direction (string)
    - * Possible values: L2R, R2L
    - * Default value: L2R.
    - *
    - * ViewArea (string)
    - * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    - * Default value: CropBox.
    - *
    - * ViewClip (string)
    - * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    - * Default value: CropBox
    - *
    - * PrintArea (string)
    - * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    - * Default value: CropBox
    - *
    - * PrintClip (string)
    - * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    - * Default value: CropBox.
    - *
    - * PrintScaling (string)
    - * Possible values: AppDefault, None
    - * Default value: AppDefault.
    - *
    - * Duplex (string)
    - * Possible values: Simplex, DuplexFlipLongEdge, DuplexFlipShortEdge - * Default value: none
    - *
    - * PickTrayByPDFSize (boolean)
    - * Default value: false
    - *
    - * PrintPageRange (Array)
    - * Example: [[1,5], [7,9]]
    - * Default value: as defined by PDF viewer application
    - *
    - * NumCopies (Number)
    - * Possible values: 1, 2, 3, 4, 5
    - * Default value: 1
    - *
    - * For more information see the PDF Reference, sixth edition on Page 577 - * @param {boolean} doReset True to reset the settings - * @function - * @returns jsPDF jsPDF-instance - * @example - * var doc = new jsPDF() - * doc.text('This is a test', 10, 10) - * doc.viewerPreferences({'FitWindow': true}, true) - * doc.save("viewerPreferences.pdf") - * - * // Example printing 10 copies, using cropbox, and hiding UI. - * doc.viewerPreferences({ - * 'HideWindowUI': true, - * 'PrintArea': 'CropBox', - * 'NumCopies': 10 - * }) + /** + * Set the ViewerPreferences of the generated PDF + * + * @name viewerPreferences + * @function + * @public + * @param {Object} options Array with the ViewerPreferences
    + * Example: doc.viewerPreferences({"FitWindow":true});
    + *
    + * You can set following preferences:
    + *
    + * HideToolbar (boolean)
    + * Default value: false
    + *
    + * HideMenubar (boolean)
    + * Default value: false.
    + *
    + * HideWindowUI (boolean)
    + * Default value: false.
    + *
    + * FitWindow (boolean)
    + * Default value: false.
    + *
    + * CenterWindow (boolean)
    + * Default value: false
    + *
    + * DisplayDocTitle (boolean)
    + * Default value: false.
    + *
    + * NonFullScreenPageMode (string)
    + * Possible values: UseNone, UseOutlines, UseThumbs, UseOC
    + * Default value: UseNone
    + *
    + * Direction (string)
    + * Possible values: L2R, R2L
    + * Default value: L2R.
    + *
    + * ViewArea (string)
    + * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    + * Default value: CropBox.
    + *
    + * ViewClip (string)
    + * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    + * Default value: CropBox
    + *
    + * PrintArea (string)
    + * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    + * Default value: CropBox
    + *
    + * PrintClip (string)
    + * Possible values: MediaBox, CropBox, TrimBox, BleedBox, ArtBox
    + * Default value: CropBox.
    + *
    + * PrintScaling (string)
    + * Possible values: AppDefault, None
    + * Default value: AppDefault.
    + *
    + * Duplex (string)
    + * Possible values: Simplex, DuplexFlipLongEdge, DuplexFlipShortEdge + * Default value: none
    + *
    + * PickTrayByPDFSize (boolean)
    + * Default value: false
    + *
    + * PrintPageRange (Array)
    + * Example: [[1,5], [7,9]]
    + * Default value: as defined by PDF viewer application
    + *
    + * NumCopies (Number)
    + * Possible values: 1, 2, 3, 4, 5
    + * Default value: 1
    + *
    + * For more information see the PDF Reference, sixth edition on Page 577 + * @param {boolean} doReset True to reset the settings + * @function + * @returns jsPDF jsPDF-instance + * @example + * var doc = new jsPDF() + * doc.text('This is a test', 10, 10) + * doc.viewerPreferences({'FitWindow': true}, true) + * doc.save("viewerPreferences.pdf") + * + * // Example printing 10 copies, using cropbox, and hiding UI. + * doc.viewerPreferences({ + * 'HideWindowUI': true, + * 'PrintArea': 'CropBox', + * 'NumCopies': 10 + * }) */ jsPDFAPI.viewerPreferences = function (options, doReset) { @@ -15424,33 +15145,33 @@ }; })(jsPDF.API); - /** ==================================================================== - * jsPDF XMP metadata plugin - * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi - * - * - * ==================================================================== + /** ==================================================================== + * jsPDF XMP metadata plugin + * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi + * + * + * ==================================================================== */ /*global jsPDF */ - /** - * @name xmp_metadata - * @module + /** + * @name xmp_metadata + * @module */ (function (jsPDFAPI) { var xmpmetadata = ""; var xmpnamespaceuri = ""; var metadata_object_number = ""; - /** - * Adds XMP formatted metadata to PDF - * - * @name addMetadata - * @function - * @param {String} metadata The actual metadata to be added. The metadata shall be stored as XMP simple value. Note that if the metadata string contains XML markup characters "<", ">" or "&", those characters should be written using XML entities. - * @param {String} namespaceuri Sets the namespace URI for the metadata. Last character should be slash or hash. - * @returns {jsPDF} jsPDF-instance + /** + * Adds XMP formatted metadata to PDF + * + * @name addMetadata + * @function + * @param {String} metadata The actual metadata to be added. The metadata shall be stored as XMP simple value. Note that if the metadata string contains XML markup characters "<", ">" or "&", those characters should be written using XML entities. + * @param {String} namespaceuri Sets the namespace URI for the metadata. Last character should be slash or hash. + * @returns {jsPDF} jsPDF-instance */ jsPDFAPI.addMetadata = function (metadata, namespaceuri) { @@ -15488,9 +15209,9 @@ }; })(jsPDF.API); - /** - * @name utf8 - * @module + /** + * @name utf8 + * @module */ (function (jsPDF, global) { @@ -15746,19 +15467,19 @@ for (s = 0; s < strText.length; s += 1) { if (fonts[key].metadata.hasOwnProperty('cmap')) { cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s].charCodeAt(0)]; - /* - if (Object.prototype.toString.call(text) === '[object Array]') { - var i = 0; - // for (i = 0; i < text.length; i += 1) { - if (Object.prototype.toString.call(text[s]) === '[object Array]') { - cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s][0].charCodeAt(0)]; //Make sure the cmap has the corresponding glyph id - } else { - - } - //} - - } else { - cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s].charCodeAt(0)]; //Make sure the cmap has the corresponding glyph id + /* + if (Object.prototype.toString.call(text) === '[object Array]') { + var i = 0; + // for (i = 0; i < text.length; i += 1) { + if (Object.prototype.toString.call(text[s]) === '[object Array]') { + cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s][0].charCodeAt(0)]; //Make sure the cmap has the corresponding glyph id + } else { + + } + //} + + } else { + cmapConfirm = fonts[key].metadata.cmap.unicode.codeMap[strText[s].charCodeAt(0)]; //Make sure the cmap has the corresponding glyph id }*/ } @@ -15840,18 +15561,18 @@ jsPDFAPI.events.push(['postProcessText', utf8EscapeFunction]); })(jsPDF, typeof self !== "undefined" && self || typeof global !== "undefined" && global || typeof window !== "undefined" && window || Function("return this")()); - /** - * jsPDF virtual FileSystem functionality - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * jsPDF virtual FileSystem functionality + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ - /** - * Use the vFS to handle files - * - * @name vFS - * @module + /** + * Use the vFS to handle files + * + * @name vFS + * @module */ (function (jsPDFAPI) { @@ -15866,15 +15587,15 @@ return true; }; - /** - * Check if the file exists in the vFS - * - * @name existsFileInVFS - * @function - * @param {string} Possible filename in the vFS. - * @returns {boolean} - * @example - * doc.existsFileInVFS("someFile.txt"); + /** + * Check if the file exists in the vFS + * + * @name existsFileInVFS + * @function + * @param {string} Possible filename in the vFS. + * @returns {boolean} + * @example + * doc.existsFileInVFS("someFile.txt"); */ @@ -15885,16 +15606,16 @@ return false; }; - /** - * Add a file to the vFS - * - * @name addFileToVFS - * @function - * @param {string} filename The name of the file which should be added. - * @param {string} filecontent The content of the file. - * @returns {jsPDF} - * @example - * doc.addFileToVFS("someFile.txt", "BADFACE1"); + /** + * Add a file to the vFS + * + * @name addFileToVFS + * @function + * @param {string} filename The name of the file which should be added. + * @param {string} filecontent The content of the file. + * @returns {jsPDF} + * @example + * doc.addFileToVFS("someFile.txt", "BADFACE1"); */ @@ -15904,15 +15625,15 @@ this.internal.vFS[filename] = filecontent; return this; }; - /** - * Get the file from the vFS - * - * @name getFileFromVFS - * @function - * @param {string} The name of the file which gets requested. - * @returns {string} - * @example - * doc.getFileFromVFS("someFile.txt"); + /** + * Get the file from the vFS + * + * @name getFileFromVFS + * @function + * @param {string} The name of the file which gets requested. + * @returns {string} + * @example + * doc.getFileFromVFS("someFile.txt"); */ @@ -15927,32 +15648,32 @@ }; })(jsPDF.API); - /** - * jsPDF addHTML PlugIn - * Copyright (c) 2014 Diego Casorran - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * jsPDF addHTML PlugIn + * Copyright (c) 2014 Diego Casorran + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ (function (jsPDFAPI) { - /** - * Renders an HTML element to canvas object which added to the PDF - * - * This feature requires [html2canvas](https://github.com/niklasvh/html2canvas) - * or [rasterizeHTML](https://github.com/cburgmer/rasterizeHTML.js) - * - * @returns {jsPDF} - * @name addHTML - * @param element {Mixed} HTML Element, or anything supported by html2canvas. - * @param x {Number} starting X coordinate in jsPDF instance's declared units. - * @param y {Number} starting Y coordinate in jsPDF instance's declared units. - * @param options {Object} Additional options, check the code below. - * @param callback {Function} to call when the rendering has finished. - * NOTE: Every parameter is optional except 'element' and 'callback', in such - * case the image is positioned at 0x0 covering the whole PDF document - * size. Ie, to easily take screenshots of webpages saving them to PDF. - * @deprecated This is being replace with a vector-supporting API. See - * [this link](https://cdn.rawgit.com/MrRio/jsPDF/master/examples/html2pdf/showcase_supported_html.html) + /** + * Renders an HTML element to canvas object which added to the PDF + * + * This feature requires [html2canvas](https://github.com/niklasvh/html2canvas) + * or [rasterizeHTML](https://github.com/cburgmer/rasterizeHTML.js) + * + * @returns {jsPDF} + * @name addHTML + * @param element {Mixed} HTML Element, or anything supported by html2canvas. + * @param x {Number} starting X coordinate in jsPDF instance's declared units. + * @param y {Number} starting Y coordinate in jsPDF instance's declared units. + * @param options {Object} Additional options, check the code below. + * @param callback {Function} to call when the rendering has finished. + * NOTE: Every parameter is optional except 'element' and 'callback', in such + * case the image is positioned at 0x0 covering the whole PDF document + * size. Ie, to easily take screenshots of webpages saving them to PDF. + * @deprecated This is being replace with a vector-supporting API. See + * [this link](https://cdn.rawgit.com/MrRio/jsPDF/master/examples/html2pdf/showcase_supported_html.html) */ jsPDFAPI.addHTML = function (element, x, y, options, callback) { @@ -16119,18 +15840,18 @@ }; })(jsPDF.API); - /** - * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser - * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com - * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria - * 2014 Diego Casorran, https://github.com/diegocr - * 2014 Daniel Husar, https://github.com/danielhusar - * 2014 Wolfgang Gassler, https://github.com/woolfg - * 2014 Steven Spungin, https://github.com/flamenco - * - * @license - * - * ==================================================================== + /** + * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser + * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com + * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria + * 2014 Diego Casorran, https://github.com/diegocr + * 2014 Daniel Husar, https://github.com/danielhusar + * 2014 Wolfgang Gassler, https://github.com/woolfg + * 2014 Steven Spungin, https://github.com/flamenco + * + * @license + * + * ==================================================================== */ (function (jsPDFAPI) { var clone, _DrillForContent, FontNameDB, FontStyleMap, TextAlignMap, FontWeightMap, FloatMap, ClearMap, GetCSS, PurgeWhiteSpace, Renderer, ResolveFont, ResolveUnitedNumber, UnitedNumberMap, elementHandledElsewhere, images, loadImgs, checkForFooter, process, tableToJson; @@ -16971,7 +16692,6 @@ Renderer.prototype.getPdfColor = function (style) { var textColor; var r, g, b; - var rgbColor = new RGBColor(style); var rx = /rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/; var m = rx.exec(style); @@ -16980,7 +16700,9 @@ g = parseInt(m[2]); b = parseInt(m[3]); } else { - if (style.charAt(0) != '#') { + if (typeof style === "string" && style.charAt(0) != '#') { + var rgbColor = new RGBColor(style); + if (rgbColor.ok) { style = rgbColor.toHex(); } else { @@ -17193,24 +16915,24 @@ UnitedNumberMap = { normal: 1 }; - /** - * Converts HTML-formatted text into formatted PDF text. - * - * Notes: - * 2012-07-18 - * Plugin relies on having browser, DOM around. The HTML is pushed into dom and traversed. - * Plugin relies on jQuery for CSS extraction. - * Targeting HTML output from Markdown templating, which is a very simple - * markup - div, span, em, strong, p. No br-based paragraph separation supported explicitly (but still may work.) - * Images, tables are NOT supported. - * - * @public - * @function - * @param HTML {String|Object} HTML-formatted text, or pointer to DOM element that is to be rendered into PDF. - * @param x {Number} starting X coordinate in jsPDF instance's declared units. - * @param y {Number} starting Y coordinate in jsPDF instance's declared units. - * @param settings {Object} Additional / optional variables controlling parsing, rendering. - * @returns {Object} jsPDF instance + /** + * Converts HTML-formatted text into formatted PDF text. + * + * Notes: + * 2012-07-18 + * Plugin relies on having browser, DOM around. The HTML is pushed into dom and traversed. + * Plugin relies on jQuery for CSS extraction. + * Targeting HTML output from Markdown templating, which is a very simple + * markup - div, span, em, strong, p. No br-based paragraph separation supported explicitly (but still may work.) + * Images, tables are NOT supported. + * + * @public + * @function + * @param HTML {String|Object} HTML-formatted text, or pointer to DOM element that is to be rendered into PDF. + * @param x {Number} starting X coordinate in jsPDF instance's declared units. + * @param y {Number} starting Y coordinate in jsPDF instance's declared units. + * @param settings {Object} Additional / optional variables controlling parsing, rendering. + * @returns {Object} jsPDF instance */ jsPDFAPI.fromHTML = function (HTML, x, y, settings, callback, margins) { @@ -17225,12 +16947,12 @@ }; })(jsPDF.API); - /** - * html2pdf.js - * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /** + * html2pdf.js + * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ (function (jsPDFAPI, globalObj) { globalObj.html2pdf = function (html, pdf, callback) { @@ -17353,416 +17075,630 @@ }); }; })(jsPDF.API, typeof window !== "undefined" && window || typeof global !== "undefined" && global); - /*rollup-keeper-start*/ - - - window.tmp = html2pdf; - /*rollup-keeper-end*/ /* Blob.js - * A Blob implementation. - * 2014-07-24 + * A Blob, File, FileReader & URL implementation. + * 2018-08-09 * * By Eli Grey, http://eligrey.com - * By Devin Samarin, https://github.com/dsamarin - * License: X11/MIT + * By Jimmy Wärting, https://github.com/jimmywarting + * License: MIT * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md */ - /*global self, unescape */ + (function (global) { + var BlobBuilder = global.BlobBuilder || global.WebKitBlobBuilder || global.MSBlobBuilder || global.MozBlobBuilder; - /*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true, - plusplus: true */ + global.URL = global.URL || global.webkitURL || function (href, a) { + a = document.createElement('a'); + a.href = href; + return a; + }; - /*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */ - (function (view) { + var origBlob = global.Blob; + var createObjectURL = URL.createObjectURL; + var revokeObjectURL = URL.revokeObjectURL; + var strTag = global.Symbol && global.Symbol.toStringTag; + var blobSupported = false; + var blobSupportsArrayBufferView = false; + var arrayBufferSupported = !!global.ArrayBuffer; + var blobBuilderSupported = BlobBuilder && BlobBuilder.prototype.append && BlobBuilder.prototype.getBlob; - view.URL = view.URL || view.webkitURL; + try { + // Check if Blob constructor is supported + blobSupported = new Blob(['ä']).size === 2; // Check if Blob constructor supports ArrayBufferViews + // Fails in Safari 6, so we need to map to ArrayBuffers there. + + blobSupportsArrayBufferView = new Blob([new Uint8Array([1, 2])]).size === 2; + } catch (e) {} + /** + * Helper function that maps ArrayBufferViews to ArrayBuffers + * Used by BlobBuilder constructor and old browsers that didn't + * support it in the Blob constructor. + */ - if (view.Blob && view.URL) { - try { - new Blob(); - return; - } catch (e) {} - } // Internally we use a BlobBuilder implementation to base Blob off of - // in order to support older browsers that only have BlobBuilder + function mapArrayBufferViews(ary) { + return ary.map(function (chunk) { + if (chunk.buffer instanceof ArrayBuffer) { + var buf = chunk.buffer; // if this is a subarray, make a copy so we only + // include the subarray region from the underlying buffer - var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || function (view) { - var get_class = function (object) { - return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1]; - }, - FakeBlobBuilder = function BlobBuilder() { - this.data = []; - }, - FakeBlob = function Blob(data, type, encoding) { - this.data = data; - this.size = data.length; - this.type = type; - this.encoding = encoding; - }, - FBB_proto = FakeBlobBuilder.prototype, - FB_proto = FakeBlob.prototype, - FileReaderSync = view.FileReaderSync, - FileException = function (type) { - this.code = this[this.name = type]; - }, - file_ex_codes = ("NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR " + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR").split(" "), - file_ex_code = file_ex_codes.length, - real_URL = view.URL || view.webkitURL || view, - real_create_object_URL = real_URL.createObjectURL, - real_revoke_object_URL = real_URL.revokeObjectURL, - URL = real_URL, - btoa = view.btoa, - atob = view.atob, - ArrayBuffer = view.ArrayBuffer, - Uint8Array = view.Uint8Array, - origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/; - - FakeBlob.fake = FB_proto.fake = true; - - while (file_ex_code--) { - FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1; - } // Polyfill URL - - - if (!real_URL.createObjectURL) { - URL = view.URL = function (uri) { - var uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a"), - uri_origin; - uri_info.href = uri; - - if (!("origin" in uri_info)) { - if (uri_info.protocol.toLowerCase() === "data:") { - uri_info.origin = null; - } else { - uri_origin = uri.match(origin); - uri_info.origin = uri_origin && uri_origin[1]; - } + if (chunk.byteLength !== buf.byteLength) { + var copy = new Uint8Array(chunk.byteLength); + copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength)); + buf = copy.buffer; } - return uri_info; - }; - } + return buf; + } - URL.createObjectURL = function (blob) { - var type = blob.type, - data_URI_header; + return chunk; + }); + } - if (type === null) { - type = "application/octet-stream"; - } + function BlobBuilderConstructor(ary, options) { + options = options || {}; + var bb = new BlobBuilder(); + mapArrayBufferViews(ary).forEach(function (part) { + bb.append(part); + }); + return options.type ? bb.getBlob(options.type) : bb.getBlob(); + } - if (blob instanceof FakeBlob) { - data_URI_header = "data:" + type; + function BlobConstructor(ary, options) { + return new origBlob(mapArrayBufferViews(ary), options || {}); + } - if (blob.encoding === "base64") { - return data_URI_header + ";base64," + blob.data; - } else if (blob.encoding === "URI") { - return data_URI_header + "," + decodeURIComponent(blob.data); - } + if (global.Blob) { + BlobBuilderConstructor.prototype = Blob.prototype; + BlobConstructor.prototype = Blob.prototype; + } - if (btoa) { - return data_URI_header + ";base64," + btoa(blob.data); - } else { - return data_URI_header + "," + encodeURIComponent(blob.data); - } - } else if (real_create_object_URL) { - return real_create_object_URL.call(real_URL, blob); + function FakeBlobBuilder() { + function toUTF8Array(str) { + var utf8 = []; + + for (var i = 0; i < str.length; i++) { + var charcode = str.charCodeAt(i); + if (charcode < 0x80) utf8.push(charcode);else if (charcode < 0x800) { + utf8.push(0xc0 | charcode >> 6, 0x80 | charcode & 0x3f); + } else if (charcode < 0xd800 || charcode >= 0xe000) { + utf8.push(0xe0 | charcode >> 12, 0x80 | charcode >> 6 & 0x3f, 0x80 | charcode & 0x3f); + } // surrogate pair + else { + i++; // UTF-16 encodes 0x10000-0x10FFFF by + // subtracting 0x10000 and splitting the + // 20 bits of 0x0-0xFFFFF into two halves + + charcode = 0x10000 + ((charcode & 0x3ff) << 10 | str.charCodeAt(i) & 0x3ff); + utf8.push(0xf0 | charcode >> 18, 0x80 | charcode >> 12 & 0x3f, 0x80 | charcode >> 6 & 0x3f, 0x80 | charcode & 0x3f); + } } - }; - URL.revokeObjectURL = function (object_URL) { - if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) { - real_revoke_object_URL.call(real_URL, object_URL); - } - }; + return utf8; + } - FBB_proto.append = function (data - /*, endings*/ - ) { - var bb = this.data; // decode data to a binary string + function fromUtf8Array(array) { + var out, i, len, c; + var char2, char3; + out = ""; + len = array.length; + i = 0; - if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) { - var str = "", - buf = new Uint8Array(data), - i = 0, - buf_len = buf.length; + while (i < len) { + c = array[i++]; - for (; i < buf_len; i++) { - str += String.fromCharCode(buf[i]); - } + switch (c >> 4) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + // 0xxxxxxx + out += String.fromCharCode(c); + break; - bb.push(str); - } else if (get_class(data) === "Blob" || get_class(data) === "File") { - if (FileReaderSync) { - var fr = new FileReaderSync(); - bb.push(fr.readAsBinaryString(data)); - } else { - // async FileReader won't work as BlobBuilder is sync - throw new FileException("NOT_READABLE_ERR"); - } - } else if (data instanceof FakeBlob) { - if (data.encoding === "base64" && atob) { - bb.push(atob(data.data)); - } else if (data.encoding === "URI") { - bb.push(decodeURIComponent(data.data)); - } else if (data.encoding === "raw") { - bb.push(data.data); + case 12: + case 13: + // 110x xxxx 10xx xxxx + char2 = array[i++]; + out += String.fromCharCode((c & 0x1F) << 6 | char2 & 0x3F); + break; + + case 14: + // 1110 xxxx 10xx xxxx 10xx xxxx + char2 = array[i++]; + char3 = array[i++]; + out += String.fromCharCode((c & 0x0F) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0); + break; } - } else { - if (typeof data !== "string") { - data += ""; // convert unsupported types to strings - } // decode UTF-16 to binary string + } + + return out; + } + function isDataView(obj) { + return obj && DataView.prototype.isPrototypeOf(obj); + } - bb.push(unescape(encodeURIComponent(data))); - } - }; + function bufferClone(buf) { + var view = new Array(buf.byteLength); + var array = new Uint8Array(buf); + var i = view.length; - FBB_proto.getBlob = function (type) { - if (!arguments.length) { - type = null; + while (i--) { + view[i] = array[i]; } - return new FakeBlob(this.data.join(""), type, "raw"); - }; + return view; + } - FBB_proto.toString = function () { - return "[object BlobBuilder]"; - }; + function encodeByteArray(input) { + var byteToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + var output = []; + + for (var i = 0; i < input.length; i += 3) { + var byte1 = input[i]; + var haveByte2 = i + 1 < input.length; + var byte2 = haveByte2 ? input[i + 1] : 0; + var haveByte3 = i + 2 < input.length; + var byte3 = haveByte3 ? input[i + 2] : 0; + var outByte1 = byte1 >> 2; + var outByte2 = (byte1 & 0x03) << 4 | byte2 >> 4; + var outByte3 = (byte2 & 0x0F) << 2 | byte3 >> 6; + var outByte4 = byte3 & 0x3F; - FB_proto.slice = function (start, end, type) { - var args = arguments.length; + if (!haveByte3) { + outByte4 = 64; - if (args < 3) { - type = null; + if (!haveByte2) { + outByte3 = 64; + } + } + + output.push(byteToCharMap[outByte1], byteToCharMap[outByte2], byteToCharMap[outByte3], byteToCharMap[outByte4]); } - return new FakeBlob(this.data.slice(start, args > 1 ? end : this.data.length), type, this.encoding); - }; + return output.join(''); + } - FB_proto.toString = function () { - return "[object Blob]"; - }; + var create = Object.create || function (a) { + function c() {} - FB_proto.close = function () { - this.size = 0; - delete this.data; + c.prototype = a; + return new c(); }; - return FakeBlobBuilder; - }(view); + if (arrayBufferSupported) { + var viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]']; + + var isArrayBufferView = ArrayBuffer.isView || function (obj) { + return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1; + }; + } + /********************************************************/ + + /* Blob constructor */ + + /********************************************************/ + - view.Blob = function (blobParts, options) { - var type = options ? options.type || "" : ""; - var builder = new BlobBuilder(); + function Blob(chunks, opts) { + chunks = chunks || []; - if (blobParts) { - for (var i = 0, len = blobParts.length; i < len; i++) { - if (Uint8Array && blobParts[i] instanceof Uint8Array) { - builder.append(blobParts[i].buffer); + for (var i = 0, len = chunks.length; i < len; i++) { + var chunk = chunks[i]; + + if (chunk instanceof Blob) { + chunks[i] = chunk._buffer; + } else if (typeof chunk === 'string') { + chunks[i] = toUTF8Array(chunk); + } else if (arrayBufferSupported && (ArrayBuffer.prototype.isPrototypeOf(chunk) || isArrayBufferView(chunk))) { + chunks[i] = bufferClone(chunk); + } else if (arrayBufferSupported && isDataView(chunk)) { + chunks[i] = bufferClone(chunk.buffer); } else { - builder.append(blobParts[i]); + chunks[i] = toUTF8Array(String(chunk)); } } + + this._buffer = [].concat.apply([], chunks); + this.size = this._buffer.length; + this.type = opts ? opts.type || '' : ''; } - var blob = builder.getBlob(type); + Blob.prototype.slice = function (start, end, type) { + var slice = this._buffer.slice(start || 0, end || this._buffer.length); - if (!blob.slice && blob.webkitSlice) { - blob.slice = blob.webkitSlice; - } + return new Blob([slice], { + type: type + }); + }; - return blob; - }; + Blob.prototype.toString = function () { + return '[object Blob]'; + }; + /********************************************************/ - var getPrototypeOf = Object.getPrototypeOf || function (object) { - return object.__proto__; - }; + /* File constructor */ - view.Blob.prototype = getPrototypeOf(new view.Blob()); - })(typeof self !== "undefined" && self || typeof window !== "undefined" && window || window.content || window); + /********************************************************/ - (function (global, factory) { - if (typeof define === "function" && define.amd) { - define([], factory); - } else if (typeof exports !== "undefined") { - factory(); - } else { - var mod = { - exports: {} + + function File(chunks, name, opts) { + opts = opts || {}; + var a = Blob.call(this, chunks, opts) || this; + a.name = name; + a.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date(); + a.lastModified = +a.lastModifiedDate; + return a; + } + + File.prototype = create(Blob.prototype); + File.prototype.constructor = File; + if (Object.setPrototypeOf) Object.setPrototypeOf(File, Blob);else { + try { + File.__proto__ = Blob; + } catch (e) {} + } + + File.prototype.toString = function () { + return '[object File]'; }; - factory(); - global.FileSaver = mod.exports; - } - })(window, function () { - /* - * FileSaver.js - * A saveAs() FileSaver implementation. - * - * By Eli Grey, http://eligrey.com - * - * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT) - * source : http://purl.eligrey.com/github/FileSaver.js - */ - // The one and only way of getting global scope in all environments - // https://stackoverflow.com/q/3277182/1008999 - - var _global = typeof window === 'object' && window.window === window ? window : typeof self === 'object' && self.self === self ? self : typeof global === 'object' && global.global === global ? global : void 0; - - function bom(blob, opts) { - if (typeof opts === 'undefined') opts = { - autoBom: false - };else if (typeof opts !== 'object') { - console.warn('Depricated: Expected third argument to be a object'); - opts = { - autoBom: !opts + /********************************************************/ + + /* FileReader constructor */ + + /********************************************************/ + + + function FileReader() { + if (!(this instanceof FileReader)) throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function."); + var delegate = document.createDocumentFragment(); + this.addEventListener = delegate.addEventListener; + + this.dispatchEvent = function (evt) { + var local = this['on' + evt.type]; + if (typeof local === 'function') local(evt); + delegate.dispatchEvent(evt); }; - } // prepend BOM for UTF-8 XML and text/* types (including HTML) - // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF - if (opts.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { - return new Blob([String.fromCharCode(0xFEFF), blob], { - type: blob.type + this.removeEventListener = delegate.removeEventListener; + } + + function _read(fr, blob, kind) { + if (!(blob instanceof Blob)) throw new TypeError("Failed to execute '" + kind + "' on 'FileReader': parameter 1 is not of type 'Blob'."); + fr.result = ''; + setTimeout(function () { + this.readyState = FileReader.LOADING; + fr.dispatchEvent(new Event('load')); + fr.dispatchEvent(new Event('loadend')); }); } - return blob; - } + FileReader.EMPTY = 0; + FileReader.LOADING = 1; + FileReader.DONE = 2; + FileReader.prototype.error = null; + FileReader.prototype.onabort = null; + FileReader.prototype.onerror = null; + FileReader.prototype.onload = null; + FileReader.prototype.onloadend = null; + FileReader.prototype.onloadstart = null; + FileReader.prototype.onprogress = null; + + FileReader.prototype.readAsDataURL = function (blob) { + _read(this, blob, 'readAsDataURL'); + + this.result = 'data:' + blob.type + ';base64,' + encodeByteArray(blob._buffer); + }; + + FileReader.prototype.readAsText = function (blob) { + _read(this, blob, 'readAsText'); + + this.result = fromUtf8Array(blob._buffer); + }; + + FileReader.prototype.readAsArrayBuffer = function (blob) { + _read(this, blob, 'readAsText'); + + this.result = blob._buffer.slice(); + }; + + FileReader.prototype.abort = function () {}; + /********************************************************/ - function download(url, name, opts) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url); - xhr.responseType = 'blob'; + /* URL */ - xhr.onload = function () { - saveAs(xhr.response, name, opts); + /********************************************************/ + + + URL.createObjectURL = function (blob) { + return blob instanceof Blob ? 'data:' + blob.type + ';base64,' + encodeByteArray(blob._buffer) : createObjectURL.call(URL, blob); }; - xhr.onerror = function () { - console.error('could not download file'); + URL.revokeObjectURL = function (url) { + revokeObjectURL && revokeObjectURL.call(URL, url); }; + /********************************************************/ + + /* XHR */ + + /********************************************************/ + + + var _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send; + + if (_send) { + XMLHttpRequest.prototype.send = function (data) { + if (data instanceof Blob) { + this.setRequestHeader('Content-Type', data.type); + + _send.call(this, fromUtf8Array(data._buffer)); + } else { + _send.call(this, data); + } + }; + } - xhr.send(); + global.FileReader = FileReader; + global.File = File; + global.Blob = Blob; } - function corsEnabled(url) { - var xhr = new XMLHttpRequest(); // use sync to avoid popup blocker + if (strTag) { + try { + File.prototype[strTag] = 'File'; + Blob.prototype[strTag] = 'Blob'; + FileReader.prototype[strTag] = 'FileReader'; + } catch (e) {} + } + + function fixFileAndXHR() { + var isIE = !!global.ActiveXObject || '-ms-scroll-limit' in document.documentElement.style && '-ms-ime-align' in document.documentElement.style; // Monkey patched + // IE don't set Content-Type header on XHR whose body is a typed Blob + // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/6047383 - xhr.open('HEAD', url, false); - xhr.send(); - return xhr.status >= 200 && xhr.status <= 299; - } // `a.click()` doesn't work for all browsers (#465) + var _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send; + if (isIE && _send) { + XMLHttpRequest.prototype.send = function (data) { + if (data instanceof Blob) { + this.setRequestHeader('Content-Type', data.type); + + _send.call(this, data); + } else { + _send.call(this, data); + } + }; + } - function click(node) { try { - node.dispatchEvent(new MouseEvent('click')); + new File([], ''); } catch (e) { - var evt = document.createEvent('MouseEvents'); - evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); - node.dispatchEvent(evt); + try { + var klass = new Function('class File extends Blob {' + 'constructor(chunks, name, opts) {' + 'opts = opts || {};' + 'super(chunks, opts || {});' + 'this.name = name;' + 'this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date;' + 'this.lastModified = +this.lastModifiedDate;' + '}};' + 'return new File([], ""), File')(); + global.File = klass; + } catch (e) { + var klass = function klass(b, d, c) { + var blob = new Blob(b, c); + var t = c && void 0 !== c.lastModified ? new Date(c.lastModified) : new Date(); + blob.name = d; + blob.lastModifiedDate = t; + blob.lastModified = +t; + + blob.toString = function () { + return '[object File]'; + }; + + if (strTag) blob[strTag] = 'File'; + return blob; + }; + + global.File = klass; + } } } - var saveAs = _global.saveAs || // probably in some web worker - typeof window !== 'object' || window !== _global ? function saveAs() {} - /* noop */ - // Use download attribute first if possible (#193 Lumia mobile) - : 'download' in HTMLAnchorElement.prototype ? function saveAs(blob, name, opts) { - var URL = _global.URL || _global.webkitURL; - var a = document.createElement('a'); - name = name || blob.name || 'download'; - a.download = name; - a.rel = 'noopener'; // tabnabbing - // TODO: detect chrome extensions & packaged apps - // a.target = '_blank' - - if (typeof blob === 'string') { - // Support regular links - a.href = blob; - - if (a.origin !== location.origin) { - corsEnabled(a.href) ? download(blob, name, opts) : click(a, a.target = '_blank'); + if (blobSupported) { + fixFileAndXHR(); + global.Blob = blobSupportsArrayBufferView ? global.Blob : BlobConstructor; + } else if (blobBuilderSupported) { + fixFileAndXHR(); + global.Blob = BlobBuilderConstructor; + } else { + FakeBlobBuilder(); + } + })(typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || Function('return typeof this === "object" && this.content')() || Function('return this')()); + + /* FileSaver.js + * A saveAs() FileSaver implementation. + * 1.3.8 + * 2018-03-22 14:03:47 + * + * By Eli Grey, https://eligrey.com + * License: MIT + * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md + */ + + /*global self */ + + /*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */ + + /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/src/FileSaver.js */ + var saveAs = saveAs || function (view) { + + if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) { + return; + } + + var doc = view.document // only get URL when necessary in case Blob.js hasn't overridden it yet + , + get_URL = function () { + return view.URL || view.webkitURL || view; + }, + save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a"), + can_use_save_link = "download" in save_link, + click = function (node) { + var event = new MouseEvent("click"); + node.dispatchEvent(event); + }, + is_safari = /constructor/i.test(view.HTMLElement) || view.safari, + is_chrome_ios = /CriOS\/[\d]+/.test(navigator.userAgent), + setImmediate = view.setImmediate || view.setTimeout, + throw_outside = function (ex) { + setImmediate(function () { + throw ex; + }, 0); + }, + force_saveable_type = "application/octet-stream" // the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to + , + arbitrary_revoke_timeout = 1000 * 40 // in ms + , + revoke = function (file) { + var revoker = function () { + if (typeof file === "string") { + // file is an object URL + get_URL().revokeObjectURL(file); } else { - click(a); + // file is a File + file.remove(); } - } else { - // Support blobs - a.href = URL.createObjectURL(blob); - setTimeout(function () { - URL.revokeObjectURL(a.href); - }, 4E4); // 40s + }; - setTimeout(function () { - click(a); - }, 0); + setTimeout(revoker, arbitrary_revoke_timeout); + }, + dispatch = function (filesaver, event_types, event) { + event_types = [].concat(event_types); + var i = event_types.length; + + while (i--) { + var listener = filesaver["on" + event_types[i]]; + + if (typeof listener === "function") { + try { + listener.call(filesaver, event || filesaver); + } catch (ex) { + throw_outside(ex); + } + } + } + }, + auto_bom = function (blob) { + // prepend BOM for UTF-8 XML and text/* types (including HTML) + // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF + if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { + return new Blob([String.fromCharCode(0xFEFF), blob], { + type: blob.type + }); } - } // Use msSaveOrOpenBlob as a second approach - : 'msSaveOrOpenBlob' in navigator ? function saveAs(blob, name, opts) { - name = name || blob.name || 'download'; - if (typeof blob === 'string') { - if (corsEnabled(blob)) { - download(blob, name, opts); + return blob; + }, + FileSaver = function (blob, name, no_auto_bom) { + if (!no_auto_bom) { + blob = auto_bom(blob); + } // First try a.download, then web filesystem, then object URLs + + + var filesaver = this, + type = blob.type, + force = type === force_saveable_type, + object_url, + dispatch_all = function () { + dispatch(filesaver, "writestart progress write writeend".split(" ")); + } // on any filesys errors revert to saving with object URLs + , + fs_error = function () { + if ((is_chrome_ios || force && is_safari) && view.FileReader) { + // Safari doesn't allow downloading of blob urls + var reader = new FileReader(); + + reader.onloadend = function () { + var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;'); + var popup = view.open(url, '_blank'); + if (!popup) view.location.href = url; + url = undefined; // release reference before dispatching + + filesaver.readyState = filesaver.DONE; + dispatch_all(); + }; + + reader.readAsDataURL(blob); + filesaver.readyState = filesaver.INIT; + return; + } // don't create more object URLs than needed + + + if (!object_url) { + object_url = get_URL().createObjectURL(blob); + } + + if (force) { + view.location.href = object_url; } else { - var a = document.createElement('a'); - a.href = blob; - a.target = '_blank'; - setTimeout(function () { - click(a); - }); + var opened = view.open(object_url, "_blank"); + + if (!opened) { + // Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html + view.location.href = object_url; + } } - } else { - navigator.msSaveOrOpenBlob(bom(blob, opts), name); - } - } // Fallback to using FileReader and a popup - : function saveAs(blob, name, opts, popup) { - // Open a popup immediately do go around popup blocker - // Mostly only avalible on user interaction and the fileReader is async so... - popup = popup || open('', '_blank'); - if (popup) { - popup.document.title = popup.document.body.innerText = 'downloading...'; + filesaver.readyState = filesaver.DONE; + dispatch_all(); + revoke(object_url); + }; + + filesaver.readyState = filesaver.INIT; + + if (can_use_save_link) { + object_url = get_URL().createObjectURL(blob); + setImmediate(function () { + save_link.href = object_url; + save_link.download = name; + click(save_link); + dispatch_all(); + revoke(object_url); + filesaver.readyState = filesaver.DONE; + }, 0); + return; } - if (typeof blob === 'string') return download(blob, name, opts); - var force = blob.type === 'application/octet-stream'; + fs_error(); + }, + FS_proto = FileSaver.prototype, + saveAs = function (blob, name, no_auto_bom) { + return new FileSaver(blob, name || blob.name || "download", no_auto_bom); + }; // IE 10+ (native saveAs) - var isSafari = /constructor/i.test(_global.HTMLElement) || _global.safari; - var isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); + if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) { + return function (blob, name, no_auto_bom) { + name = name || blob.name || "download"; - if ((isChromeIOS || force && isSafari) && typeof FileReader === 'object') { - // Safari doesn't allow downloading of blob urls - var reader = new FileReader(); + if (!no_auto_bom) { + blob = auto_bom(blob); + } - reader.onloadend = function () { - var url = reader.result; - url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); - if (popup) popup.location.href = url;else location = url; - popup = null; // reverse-tabnabbing #460 - }; + return navigator.msSaveOrOpenBlob(blob, name); + }; + } // todo: detect chrome extensions & packaged apps + //save_link.target = "_blank"; - reader.readAsDataURL(blob); - } else { - var URL = _global.URL || _global.webkitURL; - var url = URL.createObjectURL(blob); - if (popup) popup.location = url;else location.href = url; - popup = null; // reverse-tabnabbing #460 - setTimeout(function () { - URL.revokeObjectURL(url); - }, 4E4); // 40s - } - }; - _global.saveAs = saveAs.saveAs = saveAs; + FS_proto.abort = function () {}; - if (typeof module !== 'undefined') { - module.exports = saveAs; - } - }); + FS_proto.readyState = FS_proto.INIT = 0; + FS_proto.WRITING = 1; + FS_proto.DONE = 2; + FS_proto.error = FS_proto.onwritestart = FS_proto.onprogress = FS_proto.onwrite = FS_proto.onabort = FS_proto.onerror = FS_proto.onwriteend = null; + return saveAs; + }(typeof self !== "undefined" && self || typeof window !== "undefined" && window || undefined); // (c) Dean McNamee , 2013. // @@ -18576,17 +18512,11 @@ exports.GifReader = GifReader; } catch (e) {} // CommonJS. - /*rollup-keeper-start*/ - - - window.tmp = GifReader; - /*rollup-keeper-end*/ - - /* - * Copyright (c) 2012 chick307 - * - * Licensed under the MIT License. - * http://opensource.org/licenses/mit-license + /* + * Copyright (c) 2012 chick307 + * + * Licensed under the MIT License. + * http://opensource.org/licenses/mit-license */ (function (jsPDF, callback) { jsPDF.API.adler32cs = callback(); @@ -18599,6 +18529,11 @@ return false; }; + try { + var buffer = {}; + if (typeof buffer.Buffer === 'function') _Buffer = buffer.Buffer; + } catch (error) {} + return function _isBuffer(value) { return value instanceof ArrayBuffer || _Buffer !== null && value instanceof _Buffer; }; @@ -18755,58 +18690,58 @@ return exports; }); - /** - * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis) - * MIT License + /** + * Unicode Bidi Engine based on the work of Alex Shensis (@asthensis) + * MIT License */ (function (jsPDF) { - /** - * Table of Unicode types. - * - * Generated by: - * - * var bidi = require("./bidi/index"); - * var bidi_accumulate = bidi.slice(0, 256).concat(bidi.slice(0x0500, 0x0500 + 256 * 3)). - * concat(bidi.slice(0x2000, 0x2000 + 256)).concat(bidi.slice(0xFB00, 0xFB00 + 256)). - * concat(bidi.slice(0xFE00, 0xFE00 + 2 * 256)); - * - * for( var i = 0; i < bidi_accumulate.length; i++) { - * if(bidi_accumulate[i] === undefined || bidi_accumulate[i] === 'ON') - * bidi_accumulate[i] = 'N'; //mark as neutral to conserve space and substitute undefined - * } - * var bidiAccumulateStr = 'return [ "' + bidi_accumulate.toString().replace(/,/g, '", "') + '" ];'; - * require("fs").writeFile('unicode-types.js', bidiAccumulateStr); - * - * Based on: - * https://github.com/mathiasbynens/unicode-8.0.0 + /** + * Table of Unicode types. + * + * Generated by: + * + * var bidi = require("./bidi/index"); + * var bidi_accumulate = bidi.slice(0, 256).concat(bidi.slice(0x0500, 0x0500 + 256 * 3)). + * concat(bidi.slice(0x2000, 0x2000 + 256)).concat(bidi.slice(0xFB00, 0xFB00 + 256)). + * concat(bidi.slice(0xFE00, 0xFE00 + 2 * 256)); + * + * for( var i = 0; i < bidi_accumulate.length; i++) { + * if(bidi_accumulate[i] === undefined || bidi_accumulate[i] === 'ON') + * bidi_accumulate[i] = 'N'; //mark as neutral to conserve space and substitute undefined + * } + * var bidiAccumulateStr = 'return [ "' + bidi_accumulate.toString().replace(/,/g, '", "') + '" ];'; + * require("fs").writeFile('unicode-types.js', bidiAccumulateStr); + * + * Based on: + * https://github.com/mathiasbynens/unicode-8.0.0 */ var bidiUnicodeTypes = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "N", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "L", "N", "N", "BN", "N", "N", "ET", "ET", "EN", "EN", "N", "L", "N", "N", "N", "EN", "L", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "N", "N", "N", "N", "N", "ET", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "NSM", "R", "NSM", "NSM", "R", "NSM", "NSM", "R", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AN", "AN", "AN", "AN", "AN", "AN", "N", "N", "AL", "ET", "ET", "AL", "CS", "AL", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "N", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "R", "N", "N", "N", "N", "R", "N", "N", "N", "N", "N", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "BN", "BN", "BN", "L", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "B", "LRE", "RLE", "PDF", "LRO", "RLO", "CS", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "BN", "BN", "BN", "BN", "BN", "N", "LRI", "RLI", "FSI", "PDI", "BN", "BN", "BN", "BN", "BN", "BN", "EN", "L", "N", "N", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "L", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "R", "NSM", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "ES", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "R", "R", "R", "R", "R", "N", "R", "N", "R", "R", "N", "R", "R", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "CS", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "ET", "N", "N", "ES", "ES", "N", "N", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "BN", "N", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "N", "N", "N", "ET", "ET", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N"]; - /** - * Unicode Bidi algorithm compliant Bidi engine. - * For reference see http://unicode.org/reports/tr9/ + /** + * Unicode Bidi algorithm compliant Bidi engine. + * For reference see http://unicode.org/reports/tr9/ */ - /** - * constructor ( options ) - * - * Initializes Bidi engine - * - * @param {Object} See 'setOptions' below for detailed description. - * options are cashed between invocation of 'doBidiReorder' method - * - * sample usage pattern of BidiEngine: - * var opt = { - * isInputVisual: true, - * isInputRtl: false, - * isOutputVisual: false, - * isOutputRtl: false, - * isSymmetricSwapping: true - * } - * var sourceToTarget = [], levels = []; - * var bidiEng = Globalize.bidiEngine(opt); - * var src = "text string to be reordered"; - * var ret = bidiEng.doBidiReorder(src, sourceToTarget, levels); + /** + * constructor ( options ) + * + * Initializes Bidi engine + * + * @param {Object} See 'setOptions' below for detailed description. + * options are cashed between invocation of 'doBidiReorder' method + * + * sample usage pattern of BidiEngine: + * var opt = { + * isInputVisual: true, + * isInputRtl: false, + * isOutputVisual: false, + * isOutputRtl: false, + * isSymmetricSwapping: true + * } + * var sourceToTarget = [], levels = []; + * var bidiEng = Globalize.bidiEngine(opt); + * var src = "text string to be reordered"; + * var ret = bidiEng.doBidiReorder(src, sourceToTarget, levels); */ jsPDF.__bidiEngine__ = jsPDF.prototype.__bidiEngine__ = function (options) { @@ -19136,1314 +19071,298 @@ // - var _invertByLevel = function _invertByLevel(level, charArray, sourceToTargetMap, levels, params) { - if (params.hiLevel < level) { - return; - } - - if (level === 1 && _dir === DIR_RTL && !_hasUbatB) { - charArray.reverse(); - sourceToTargetMap && sourceToTargetMap.reverse(); - return; - } - - var ch, - high, - end, - low, - len = charArray.length, - start = 0; - - while (start < len) { - if (levels[start] >= level) { - end = start + 1; - - while (end < len && levels[end] >= level) { - end++; - } - - for (low = start, high = end - 1; low < high; low++, high--) { - ch = charArray[low]; - charArray[low] = charArray[high]; - charArray[high] = ch; - - if (sourceToTargetMap) { - ch = sourceToTargetMap[low]; - sourceToTargetMap[low] = sourceToTargetMap[high]; - sourceToTargetMap[high] = ch; - } - } - - start = end; - } - - start++; - } - }; // for reference see 7 & BD16 in http://unicode.org/reports/tr9/ - // - - - var _symmetricSwap = function _symmetricSwap(charArray, levels, params) { - if (params.hiLevel !== 0 && _isSymmetricSwapping) { - for (var i = 0, index; i < charArray.length; i++) { - if (levels[i] === 1) { - index = _SWAP_TABLE.indexOf(charArray[i]); - - if (index >= 0) { - charArray[i] = _SWAP_TABLE[index + 1]; - } - } - } - } - }; - - var _reorder = function _reorder(text, sourceToTargetMap, levels) { - var charArray = text.split(""), - params = { - hiLevel: _dir - }; - - if (!levels) { - levels = []; - } - - _computeLevels(charArray, levels, params); - - _symmetricSwap(charArray, levels, params); - - _invertByLevel(DIR_RTL + 1, charArray, sourceToTargetMap, levels, params); - - _invertByLevel(DIR_RTL, charArray, sourceToTargetMap, levels, params); - - return charArray.join(""); - }; // doBidiReorder( text, sourceToTargetMap, levels ) - // Performs Bidi reordering by implementing Unicode Bidi algorithm. - // Returns reordered string - // @text [String]: - // - input string to be reordered, this is input parameter - // $sourceToTargetMap [Array] (optional) - // - resultant mapping between input and output strings, this is output parameter - // $levels [Array] (optional) - // - array of calculated Bidi levels, , this is output parameter - - - this.__bidiEngine__.doBidiReorder = function (text, sourceToTargetMap, levels) { - _init(text, sourceToTargetMap); - - if (!_isInVisual && _isOutVisual && !_isOutRtl) { - // LLTR->VLTR, LRTL->VLTR - _dir = _isInRtl ? DIR_RTL : DIR_LTR; - text = _reorder(text, sourceToTargetMap, levels); - } else if (_isInVisual && _isOutVisual && _isInRtl ^ _isOutRtl) { - // VRTL->VLTR, VLTR->VRTL - _dir = _isInRtl ? DIR_RTL : DIR_LTR; - text = _invertString(text, sourceToTargetMap, levels); - } else if (!_isInVisual && _isOutVisual && _isOutRtl) { - // LLTR->VRTL, LRTL->VRTL - _dir = _isInRtl ? DIR_RTL : DIR_LTR; - text = _reorder(text, sourceToTargetMap, levels); - text = _invertString(text, sourceToTargetMap); - } else if (_isInVisual && !_isInRtl && !_isOutVisual && !_isOutRtl) { - // VLTR->LLTR - _dir = DIR_LTR; - text = _reorder(text, sourceToTargetMap, levels); - } else if (_isInVisual && !_isOutVisual && _isInRtl ^ _isOutRtl) { - // VLTR->LRTL, VRTL->LLTR - text = _invertString(text, sourceToTargetMap); - - if (_isInRtl) { - //LLTR -> VLTR - _dir = DIR_LTR; - text = _reorder(text, sourceToTargetMap, levels); - } else { - //LRTL -> VRTL - _dir = DIR_RTL; - text = _reorder(text, sourceToTargetMap, levels); - text = _invertString(text, sourceToTargetMap); - } - } else if (_isInVisual && _isInRtl && !_isOutVisual && _isOutRtl) { - // VRTL->LRTL - _dir = DIR_RTL; - text = _reorder(text, sourceToTargetMap, levels); - text = _invertString(text, sourceToTargetMap); - } else if (!_isInVisual && !_isOutVisual && _isInRtl ^ _isOutRtl) { - // LRTL->LLTR, LLTR->LRTL - var isSymmetricSwappingOrig = _isSymmetricSwapping; - - if (_isInRtl) { - //LRTL->LLTR - _dir = DIR_RTL; - text = _reorder(text, sourceToTargetMap, levels); - _dir = DIR_LTR; - _isSymmetricSwapping = false; - text = _reorder(text, sourceToTargetMap, levels); - _isSymmetricSwapping = isSymmetricSwappingOrig; - } else { - //LLTR->LRTL - _dir = DIR_LTR; - text = _reorder(text, sourceToTargetMap, levels); - text = _invertString(text, sourceToTargetMap); - _dir = DIR_RTL; - _isSymmetricSwapping = false; - text = _reorder(text, sourceToTargetMap, levels); - _isSymmetricSwapping = isSymmetricSwappingOrig; - text = _invertString(text, sourceToTargetMap); - } - } - - return text; - }; - /** - * @name setOptions( options ) - * @function - * Sets options for Bidi conversion - * @param {Object}: - * - isInputVisual {boolean} (defaults to false): allowed values: true(Visual mode), false(Logical mode) - * - isInputRtl {boolean}: allowed values true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong character of input string) - * - isOutputVisual {boolean} (defaults to false): allowed values: true(Visual mode), false(Logical mode) - * - isOutputRtl {boolean}: allowed values true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong characterof input string) - * - isSymmetricSwapping {boolean} (defaults to false): allowed values true(needs symmetric swapping), false (no need in symmetric swapping), - */ - - - this.__bidiEngine__.setOptions = function (options) { - if (options) { - _isInVisual = options.isInputVisual; - _isOutVisual = options.isOutputVisual; - _isInRtl = options.isInputRtl; - _isOutRtl = options.isOutputRtl; - _isSymmetricSwapping = options.isSymmetricSwapping; - } - }; - - this.__bidiEngine__.setOptions(options); - - return this.__bidiEngine__; - }; - - var _bidiUnicodeTypes = bidiUnicodeTypes; - var bidiEngine = new jsPDF.__bidiEngine__({ - isInputVisual: true - }); - - var bidiEngineFunction = function bidiEngineFunction(args) { - var text = args.text; - var x = args.x; - var y = args.y; - var options = args.options || {}; - var mutex = args.mutex || {}; - var lang = options.lang; - var tmpText = []; - - if (Object.prototype.toString.call(text) === '[object Array]') { - var i = 0; - tmpText = []; - - for (i = 0; i < text.length; i += 1) { - if (Object.prototype.toString.call(text[i]) === '[object Array]') { - tmpText.push([bidiEngine.doBidiReorder(text[i][0]), text[i][1], text[i][2]]); - } else { - tmpText.push([bidiEngine.doBidiReorder(text[i])]); - } - } - - args.text = tmpText; - } else { - args.text = bidiEngine.doBidiReorder(text); - } - }; - - jsPDF.API.events.push(['postProcessText', bidiEngineFunction]); - })(jsPDF); - - /* - Copyright (c) 2008, Adobe Systems Incorporated - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of Adobe Systems Incorporated nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - /* - JPEG encoder ported to JavaScript and optimized by Andreas Ritter, www.bytestrom.eu, 11/2009 - - Basic GUI blocking jpeg encoder - */ - function JPEGEncoder(quality) { - var ffloor = Math.floor; - var YTable = new Array(64); - var UVTable = new Array(64); - var fdtbl_Y = new Array(64); - var fdtbl_UV = new Array(64); - var YDC_HT; - var UVDC_HT; - var YAC_HT; - var UVAC_HT; - var bitcode = new Array(65535); - var category = new Array(65535); - var outputfDCTQuant = new Array(64); - var DU = new Array(64); - var byteout = []; - var bytenew = 0; - var bytepos = 7; - var YDU = new Array(64); - var UDU = new Array(64); - var VDU = new Array(64); - var clt = new Array(256); - var RGB_YUV_TABLE = new Array(2048); - var currentQuality; - var ZigZag = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63]; - var std_dc_luminance_nrcodes = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0]; - var std_dc_luminance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; - var std_ac_luminance_nrcodes = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d]; - var std_ac_luminance_values = [0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa]; - var std_dc_chrominance_nrcodes = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0]; - var std_dc_chrominance_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; - var std_ac_chrominance_nrcodes = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77]; - var std_ac_chrominance_values = [0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa]; - - function initQuantTables(sf) { - var YQT = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99]; - - for (var i = 0; i < 64; i++) { - var t = ffloor((YQT[i] * sf + 50) / 100); - - if (t < 1) { - t = 1; - } else if (t > 255) { - t = 255; - } - - YTable[ZigZag[i]] = t; - } - - var UVQT = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99]; - - for (var j = 0; j < 64; j++) { - var u = ffloor((UVQT[j] * sf + 50) / 100); - - if (u < 1) { - u = 1; - } else if (u > 255) { - u = 255; - } - - UVTable[ZigZag[j]] = u; - } - - var aasf = [1.0, 1.387039845, 1.306562965, 1.175875602, 1.0, 0.785694958, 0.541196100, 0.275899379]; - var k = 0; - - for (var row = 0; row < 8; row++) { - for (var col = 0; col < 8; col++) { - fdtbl_Y[k] = 1.0 / (YTable[ZigZag[k]] * aasf[row] * aasf[col] * 8.0); - fdtbl_UV[k] = 1.0 / (UVTable[ZigZag[k]] * aasf[row] * aasf[col] * 8.0); - k++; - } - } - } - - function computeHuffmanTbl(nrcodes, std_table) { - var codevalue = 0; - var pos_in_table = 0; - var HT = new Array(); - - for (var k = 1; k <= 16; k++) { - for (var j = 1; j <= nrcodes[k]; j++) { - HT[std_table[pos_in_table]] = []; - HT[std_table[pos_in_table]][0] = codevalue; - HT[std_table[pos_in_table]][1] = k; - pos_in_table++; - codevalue++; - } - - codevalue *= 2; - } - - return HT; - } - - function initHuffmanTbl() { - YDC_HT = computeHuffmanTbl(std_dc_luminance_nrcodes, std_dc_luminance_values); - UVDC_HT = computeHuffmanTbl(std_dc_chrominance_nrcodes, std_dc_chrominance_values); - YAC_HT = computeHuffmanTbl(std_ac_luminance_nrcodes, std_ac_luminance_values); - UVAC_HT = computeHuffmanTbl(std_ac_chrominance_nrcodes, std_ac_chrominance_values); - } - - function initCategoryNumber() { - var nrlower = 1; - var nrupper = 2; - - for (var cat = 1; cat <= 15; cat++) { - //Positive numbers - for (var nr = nrlower; nr < nrupper; nr++) { - category[32767 + nr] = cat; - bitcode[32767 + nr] = []; - bitcode[32767 + nr][1] = cat; - bitcode[32767 + nr][0] = nr; - } //Negative numbers - - - for (var nrneg = -(nrupper - 1); nrneg <= -nrlower; nrneg++) { - category[32767 + nrneg] = cat; - bitcode[32767 + nrneg] = []; - bitcode[32767 + nrneg][1] = cat; - bitcode[32767 + nrneg][0] = nrupper - 1 + nrneg; - } - - nrlower <<= 1; - nrupper <<= 1; - } - } - - function initRGBYUVTable() { - for (var i = 0; i < 256; i++) { - RGB_YUV_TABLE[i] = 19595 * i; - RGB_YUV_TABLE[i + 256 >> 0] = 38470 * i; - RGB_YUV_TABLE[i + 512 >> 0] = 7471 * i + 0x8000; - RGB_YUV_TABLE[i + 768 >> 0] = -11059 * i; - RGB_YUV_TABLE[i + 1024 >> 0] = -21709 * i; - RGB_YUV_TABLE[i + 1280 >> 0] = 32768 * i + 0x807FFF; - RGB_YUV_TABLE[i + 1536 >> 0] = -27439 * i; - RGB_YUV_TABLE[i + 1792 >> 0] = -5329 * i; - } - } // IO functions - - - function writeBits(bs) { - var value = bs[0]; - var posval = bs[1] - 1; - - while (posval >= 0) { - if (value & 1 << posval) { - bytenew |= 1 << bytepos; - } - - posval--; - bytepos--; - - if (bytepos < 0) { - if (bytenew == 0xFF) { - writeByte(0xFF); - writeByte(0); - } else { - writeByte(bytenew); - } - - bytepos = 7; - bytenew = 0; - } - } - } - - function writeByte(value) { - //byteout.push(clt[value]); // write char directly instead of converting later - byteout.push(value); - } - - function writeWord(value) { - writeByte(value >> 8 & 0xFF); - writeByte(value & 0xFF); - } // DCT & quantization core - - - function fDCTQuant(data, fdtbl) { - var d0, d1, d2, d3, d4, d5, d6, d7; - /* Pass 1: process rows. */ - - var dataOff = 0; - var i; - var I8 = 8; - var I64 = 64; - - for (i = 0; i < I8; ++i) { - d0 = data[dataOff]; - d1 = data[dataOff + 1]; - d2 = data[dataOff + 2]; - d3 = data[dataOff + 3]; - d4 = data[dataOff + 4]; - d5 = data[dataOff + 5]; - d6 = data[dataOff + 6]; - d7 = data[dataOff + 7]; - var tmp0 = d0 + d7; - var tmp7 = d0 - d7; - var tmp1 = d1 + d6; - var tmp6 = d1 - d6; - var tmp2 = d2 + d5; - var tmp5 = d2 - d5; - var tmp3 = d3 + d4; - var tmp4 = d3 - d4; - /* Even part */ - - var tmp10 = tmp0 + tmp3; - /* phase 2 */ - - var tmp13 = tmp0 - tmp3; - var tmp11 = tmp1 + tmp2; - var tmp12 = tmp1 - tmp2; - data[dataOff] = tmp10 + tmp11; - /* phase 3 */ - - data[dataOff + 4] = tmp10 - tmp11; - var z1 = (tmp12 + tmp13) * 0.707106781; - /* c4 */ - - data[dataOff + 2] = tmp13 + z1; - /* phase 5 */ - - data[dataOff + 6] = tmp13 - z1; - /* Odd part */ - - tmp10 = tmp4 + tmp5; - /* phase 2 */ - - tmp11 = tmp5 + tmp6; - tmp12 = tmp6 + tmp7; - /* The rotator is modified from fig 4-8 to avoid extra negations. */ - - var z5 = (tmp10 - tmp12) * 0.382683433; - /* c6 */ - - var z2 = 0.541196100 * tmp10 + z5; - /* c2-c6 */ - - var z4 = 1.306562965 * tmp12 + z5; - /* c2+c6 */ - - var z3 = tmp11 * 0.707106781; - /* c4 */ - - var z11 = tmp7 + z3; - /* phase 5 */ - - var z13 = tmp7 - z3; - data[dataOff + 5] = z13 + z2; - /* phase 6 */ - - data[dataOff + 3] = z13 - z2; - data[dataOff + 1] = z11 + z4; - data[dataOff + 7] = z11 - z4; - dataOff += 8; - /* advance pointer to next row */ - } - /* Pass 2: process columns. */ - - - dataOff = 0; - - for (i = 0; i < I8; ++i) { - d0 = data[dataOff]; - d1 = data[dataOff + 8]; - d2 = data[dataOff + 16]; - d3 = data[dataOff + 24]; - d4 = data[dataOff + 32]; - d5 = data[dataOff + 40]; - d6 = data[dataOff + 48]; - d7 = data[dataOff + 56]; - var tmp0p2 = d0 + d7; - var tmp7p2 = d0 - d7; - var tmp1p2 = d1 + d6; - var tmp6p2 = d1 - d6; - var tmp2p2 = d2 + d5; - var tmp5p2 = d2 - d5; - var tmp3p2 = d3 + d4; - var tmp4p2 = d3 - d4; - /* Even part */ - - var tmp10p2 = tmp0p2 + tmp3p2; - /* phase 2 */ - - var tmp13p2 = tmp0p2 - tmp3p2; - var tmp11p2 = tmp1p2 + tmp2p2; - var tmp12p2 = tmp1p2 - tmp2p2; - data[dataOff] = tmp10p2 + tmp11p2; - /* phase 3 */ - - data[dataOff + 32] = tmp10p2 - tmp11p2; - var z1p2 = (tmp12p2 + tmp13p2) * 0.707106781; - /* c4 */ - - data[dataOff + 16] = tmp13p2 + z1p2; - /* phase 5 */ - - data[dataOff + 48] = tmp13p2 - z1p2; - /* Odd part */ - - tmp10p2 = tmp4p2 + tmp5p2; - /* phase 2 */ - - tmp11p2 = tmp5p2 + tmp6p2; - tmp12p2 = tmp6p2 + tmp7p2; - /* The rotator is modified from fig 4-8 to avoid extra negations. */ - - var z5p2 = (tmp10p2 - tmp12p2) * 0.382683433; - /* c6 */ - - var z2p2 = 0.541196100 * tmp10p2 + z5p2; - /* c2-c6 */ - - var z4p2 = 1.306562965 * tmp12p2 + z5p2; - /* c2+c6 */ - - var z3p2 = tmp11p2 * 0.707106781; - /* c4 */ - - var z11p2 = tmp7p2 + z3p2; - /* phase 5 */ - - var z13p2 = tmp7p2 - z3p2; - data[dataOff + 40] = z13p2 + z2p2; - /* phase 6 */ - - data[dataOff + 24] = z13p2 - z2p2; - data[dataOff + 8] = z11p2 + z4p2; - data[dataOff + 56] = z11p2 - z4p2; - dataOff++; - /* advance pointer to next column */ - } // Quantize/descale the coefficients - - - var fDCTQuant; - - for (i = 0; i < I64; ++i) { - // Apply the quantization and scaling factor & Round to nearest integer - fDCTQuant = data[i] * fdtbl[i]; - outputfDCTQuant[i] = fDCTQuant > 0.0 ? fDCTQuant + 0.5 | 0 : fDCTQuant - 0.5 | 0; //outputfDCTQuant[i] = fround(fDCTQuant); - } - - return outputfDCTQuant; - } - - function writeAPP0() { - writeWord(0xFFE0); // marker - - writeWord(16); // length - - writeByte(0x4A); // J - - writeByte(0x46); // F - - writeByte(0x49); // I - - writeByte(0x46); // F - - writeByte(0); // = "JFIF",'\0' - - writeByte(1); // versionhi - - writeByte(1); // versionlo - - writeByte(0); // xyunits - - writeWord(1); // xdensity - - writeWord(1); // ydensity - - writeByte(0); // thumbnwidth - - writeByte(0); // thumbnheight - } - - function writeSOF0(width, height) { - writeWord(0xFFC0); // marker - - writeWord(17); // length, truecolor YUV JPG - - writeByte(8); // precision - - writeWord(height); - writeWord(width); - writeByte(3); // nrofcomponents - - writeByte(1); // IdY - - writeByte(0x11); // HVY - - writeByte(0); // QTY - - writeByte(2); // IdU - - writeByte(0x11); // HVU - - writeByte(1); // QTU - - writeByte(3); // IdV - - writeByte(0x11); // HVV - - writeByte(1); // QTV - } - - function writeDQT() { - writeWord(0xFFDB); // marker - - writeWord(132); // length - - writeByte(0); - - for (var i = 0; i < 64; i++) { - writeByte(YTable[i]); - } - - writeByte(1); - - for (var j = 0; j < 64; j++) { - writeByte(UVTable[j]); - } - } - - function writeDHT() { - writeWord(0xFFC4); // marker - - writeWord(0x01A2); // length - - writeByte(0); // HTYDCinfo - - for (var i = 0; i < 16; i++) { - writeByte(std_dc_luminance_nrcodes[i + 1]); - } - - for (var j = 0; j <= 11; j++) { - writeByte(std_dc_luminance_values[j]); - } - - writeByte(0x10); // HTYACinfo - - for (var k = 0; k < 16; k++) { - writeByte(std_ac_luminance_nrcodes[k + 1]); - } - - for (var l = 0; l <= 161; l++) { - writeByte(std_ac_luminance_values[l]); - } - - writeByte(1); // HTUDCinfo - - for (var m = 0; m < 16; m++) { - writeByte(std_dc_chrominance_nrcodes[m + 1]); - } - - for (var n = 0; n <= 11; n++) { - writeByte(std_dc_chrominance_values[n]); - } - - writeByte(0x11); // HTUACinfo - - for (var o = 0; o < 16; o++) { - writeByte(std_ac_chrominance_nrcodes[o + 1]); - } - - for (var p = 0; p <= 161; p++) { - writeByte(std_ac_chrominance_values[p]); - } - } - - function writeSOS() { - writeWord(0xFFDA); // marker - - writeWord(12); // length - - writeByte(3); // nrofcomponents - - writeByte(1); // IdY - - writeByte(0); // HTY - - writeByte(2); // IdU - - writeByte(0x11); // HTU - - writeByte(3); // IdV - - writeByte(0x11); // HTV - - writeByte(0); // Ss - - writeByte(0x3f); // Se - - writeByte(0); // Bf - } - - function processDU(CDU, fdtbl, DC, HTDC, HTAC) { - var EOB = HTAC[0x00]; - var M16zeroes = HTAC[0xF0]; - var pos; - var I16 = 16; - var I63 = 63; - var I64 = 64; - var DU_DCT = fDCTQuant(CDU, fdtbl); //ZigZag reorder - - for (var j = 0; j < I64; ++j) { - DU[ZigZag[j]] = DU_DCT[j]; - } - - var Diff = DU[0] - DC; - DC = DU[0]; //Encode DC - - if (Diff == 0) { - writeBits(HTDC[0]); // Diff might be 0 - } else { - pos = 32767 + Diff; - writeBits(HTDC[category[pos]]); - writeBits(bitcode[pos]); - } //Encode ACs - - - var end0pos = 63; // was const... which is crazy - - for (; end0pos > 0 && DU[end0pos] == 0; end0pos--) {} - - if (end0pos == 0) { - writeBits(EOB); - return DC; - } - - var i = 1; - var lng; - - while (i <= end0pos) { - var startpos = i; - - for (; DU[i] == 0 && i <= end0pos; ++i) {} - - var nrzeroes = i - startpos; - - if (nrzeroes >= I16) { - lng = nrzeroes >> 4; - - for (var nrmarker = 1; nrmarker <= lng; ++nrmarker) { - writeBits(M16zeroes); - } - - nrzeroes = nrzeroes & 0xF; - } - - pos = 32767 + DU[i]; - writeBits(HTAC[(nrzeroes << 4) + category[pos]]); - writeBits(bitcode[pos]); - i++; - } - - if (end0pos != I63) { - writeBits(EOB); - } - - return DC; - } - - function initCharLookupTable() { - var sfcc = String.fromCharCode; - - for (var i = 0; i < 256; i++) { - ///// ACHTUNG // 255 - clt[i] = sfcc(i); - } - } - - this.encode = function (image, quality) // image data object - { - var time_start = new Date().getTime(); - if (quality) setQuality(quality); // Initialize bit writer - - byteout = new Array(); - bytenew = 0; - bytepos = 7; // Add JPEG headers - - writeWord(0xFFD8); // SOI - - writeAPP0(); - writeDQT(); - writeSOF0(image.width, image.height); - writeDHT(); - writeSOS(); // Encode 8x8 macroblocks - - var DCY = 0; - var DCU = 0; - var DCV = 0; - bytenew = 0; - bytepos = 7; - this.encode.displayName = "_encode_"; - var imageData = image.data; - var width = image.width; - var height = image.height; - var quadWidth = width * 4; - var x, - y = 0; - var r, g, b; - var start, p, col, row, pos; - - while (y < height) { - x = 0; - - while (x < quadWidth) { - start = quadWidth * y + x; - p = start; - col = -1; - row = 0; - - for (pos = 0; pos < 64; pos++) { - row = pos >> 3; // /8 - - col = (pos & 7) * 4; // %8 - - p = start + row * quadWidth + col; - - if (y + row >= height) { - // padding bottom - p -= quadWidth * (y + 1 + row - height); - } - - if (x + col >= quadWidth) { - // padding right - p -= x + col - quadWidth + 4; - } - - r = imageData[p++]; - g = imageData[p++]; - b = imageData[p++]; - /* // calculate YUV values dynamically - YDU[pos]=((( 0.29900)*r+( 0.58700)*g+( 0.11400)*b))-128; //-0x80 - UDU[pos]=(((-0.16874)*r+(-0.33126)*g+( 0.50000)*b)); - VDU[pos]=((( 0.50000)*r+(-0.41869)*g+(-0.08131)*b)); - */ - // use lookup table (slightly faster) - - YDU[pos] = (RGB_YUV_TABLE[r] + RGB_YUV_TABLE[g + 256 >> 0] + RGB_YUV_TABLE[b + 512 >> 0] >> 16) - 128; - UDU[pos] = (RGB_YUV_TABLE[r + 768 >> 0] + RGB_YUV_TABLE[g + 1024 >> 0] + RGB_YUV_TABLE[b + 1280 >> 0] >> 16) - 128; - VDU[pos] = (RGB_YUV_TABLE[r + 1280 >> 0] + RGB_YUV_TABLE[g + 1536 >> 0] + RGB_YUV_TABLE[b + 1792 >> 0] >> 16) - 128; - } - - DCY = processDU(YDU, fdtbl_Y, DCY, YDC_HT, YAC_HT); - DCU = processDU(UDU, fdtbl_UV, DCU, UVDC_HT, UVAC_HT); - DCV = processDU(VDU, fdtbl_UV, DCV, UVDC_HT, UVAC_HT); - x += 32; - } - - y += 8; - } //////////////////////////////////////////////////////////////// - // Do the bit alignment of the EOI marker - - - if (bytepos >= 0) { - var fillbits = []; - fillbits[1] = bytepos + 1; - fillbits[0] = (1 << bytepos + 1) - 1; - writeBits(fillbits); - } - - writeWord(0xFFD9); //EOI - - return new Uint8Array(byteout); - }; - - function setQuality(quality) { - if (quality <= 0) { - quality = 1; - } - - if (quality > 100) { - quality = 100; - } - - if (currentQuality == quality) return; // don't recalc if unchanged - - var sf = 0; - - if (quality < 50) { - sf = Math.floor(5000 / quality); - } else { - sf = Math.floor(200 - quality * 2); - } - - initQuantTables(sf); - currentQuality = quality; //console.log('Quality set to: '+quality +'%'); - } - - function init() { - var time_start = new Date().getTime(); - if (!quality) quality = 50; // Create tables - - initCharLookupTable(); - initHuffmanTbl(); - initCategoryNumber(); - initRGBYUVTable(); - setQuality(quality); - var duration = new Date().getTime() - time_start; //console.log('Initialization '+ duration + 'ms'); - } - - init(); - } - - try { - module.exports = JPEGEncoder; - } catch (e) {} // CommonJS. - - /** - * @author shaozilee - * - * Bmp format decoder,support 1bit 4bit 8bit 24bit bmp - * - */ - function BmpDecoder(buffer, is_with_alpha) { - this.pos = 0; - this.buffer = buffer; - this.datav = new DataView(buffer.buffer); - this.is_with_alpha = !!is_with_alpha; - this.bottom_up = true; - this.flag = String.fromCharCode(this.buffer[0]) + String.fromCharCode(this.buffer[1]); - this.pos += 2; - if (["BM", "BA", "CI", "CP", "IC", "PT"].indexOf(this.flag) === -1) throw new Error("Invalid BMP File"); - this.parseHeader(); - this.parseBGR(); - } - - BmpDecoder.prototype.parseHeader = function () { - this.fileSize = this.datav.getUint32(this.pos, true); - this.pos += 4; - this.reserved = this.datav.getUint32(this.pos, true); - this.pos += 4; - this.offset = this.datav.getUint32(this.pos, true); - this.pos += 4; - this.headerSize = this.datav.getUint32(this.pos, true); - this.pos += 4; - this.width = this.datav.getUint32(this.pos, true); - this.pos += 4; - this.height = this.datav.getInt32(this.pos, true); - this.pos += 4; - this.planes = this.datav.getUint16(this.pos, true); - this.pos += 2; - this.bitPP = this.datav.getUint16(this.pos, true); - this.pos += 2; - this.compress = this.datav.getUint32(this.pos, true); - this.pos += 4; - this.rawSize = this.datav.getUint32(this.pos, true); - this.pos += 4; - this.hr = this.datav.getUint32(this.pos, true); - this.pos += 4; - this.vr = this.datav.getUint32(this.pos, true); - this.pos += 4; - this.colors = this.datav.getUint32(this.pos, true); - this.pos += 4; - this.importantColors = this.datav.getUint32(this.pos, true); - this.pos += 4; - - if (this.bitPP === 16 && this.is_with_alpha) { - this.bitPP = 15; - } - - if (this.bitPP < 15) { - var len = this.colors === 0 ? 1 << this.bitPP : this.colors; - this.palette = new Array(len); - - for (var i = 0; i < len; i++) { - var blue = this.datav.getUint8(this.pos++, true); - var green = this.datav.getUint8(this.pos++, true); - var red = this.datav.getUint8(this.pos++, true); - var quad = this.datav.getUint8(this.pos++, true); - this.palette[i] = { - red: red, - green: green, - blue: blue, - quad: quad - }; - } - } + var _invertByLevel = function _invertByLevel(level, charArray, sourceToTargetMap, levels, params) { + if (params.hiLevel < level) { + return; + } - if (this.height < 0) { - this.height *= -1; - this.bottom_up = false; - } - }; + if (level === 1 && _dir === DIR_RTL && !_hasUbatB) { + charArray.reverse(); + sourceToTargetMap && sourceToTargetMap.reverse(); + return; + } - BmpDecoder.prototype.parseBGR = function () { - this.pos = this.offset; + var ch, + high, + end, + low, + len = charArray.length, + start = 0; - try { - var bitn = "bit" + this.bitPP; - var len = this.width * this.height * 4; - this.data = new Uint8Array(len); - this[bitn](); - } catch (e) { - console.log("bit decode error:" + e); - } - }; - - BmpDecoder.prototype.bit1 = function () { - var xlen = Math.ceil(this.width / 8); - var mode = xlen % 4; - var y = this.height >= 0 ? this.height - 1 : -this.height; - - for (var y = this.height - 1; y >= 0; y--) { - var line = this.bottom_up ? y : this.height - 1 - y; - - for (var x = 0; x < xlen; x++) { - var b = this.datav.getUint8(this.pos++, true); - var location = line * this.width * 4 + x * 8 * 4; - - for (var i = 0; i < 8; i++) { - if (x * 8 + i < this.width) { - var rgb = this.palette[b >> 7 - i & 0x1]; - this.data[location + i * 4] = rgb.blue; - this.data[location + i * 4 + 1] = rgb.green; - this.data[location + i * 4 + 2] = rgb.red; - this.data[location + i * 4 + 3] = 0xFF; - } else { - break; - } - } - } + while (start < len) { + if (levels[start] >= level) { + end = start + 1; - if (mode != 0) { - this.pos += 4 - mode; - } - } - }; - - BmpDecoder.prototype.bit4 = function () { - var xlen = Math.ceil(this.width / 2); - var mode = xlen % 4; - - for (var y = this.height - 1; y >= 0; y--) { - var line = this.bottom_up ? y : this.height - 1 - y; - - for (var x = 0; x < xlen; x++) { - var b = this.datav.getUint8(this.pos++, true); - var location = line * this.width * 4 + x * 2 * 4; - var before = b >> 4; - var after = b & 0x0F; - var rgb = this.palette[before]; - this.data[location] = rgb.blue; - this.data[location + 1] = rgb.green; - this.data[location + 2] = rgb.red; - this.data[location + 3] = 0xFF; - if (x * 2 + 1 >= this.width) break; - rgb = this.palette[after]; - this.data[location + 4] = rgb.blue; - this.data[location + 4 + 1] = rgb.green; - this.data[location + 4 + 2] = rgb.red; - this.data[location + 4 + 3] = 0xFF; - } - - if (mode != 0) { - this.pos += 4 - mode; - } - } - }; + while (end < len && levels[end] >= level) { + end++; + } - BmpDecoder.prototype.bit8 = function () { - var mode = this.width % 4; + for (low = start, high = end - 1; low < high; low++, high--) { + ch = charArray[low]; + charArray[low] = charArray[high]; + charArray[high] = ch; - for (var y = this.height - 1; y >= 0; y--) { - var line = this.bottom_up ? y : this.height - 1 - y; + if (sourceToTargetMap) { + ch = sourceToTargetMap[low]; + sourceToTargetMap[low] = sourceToTargetMap[high]; + sourceToTargetMap[high] = ch; + } + } - for (var x = 0; x < this.width; x++) { - var b = this.datav.getUint8(this.pos++, true); - var location = line * this.width * 4 + x * 4; + start = end; + } - if (b < this.palette.length) { - var rgb = this.palette[b]; - this.data[location] = rgb.red; - this.data[location + 1] = rgb.green; - this.data[location + 2] = rgb.blue; - this.data[location + 3] = 0xFF; - } else { - this.data[location] = 0xFF; - this.data[location + 1] = 0xFF; - this.data[location + 2] = 0xFF; - this.data[location + 3] = 0xFF; + start++; } - } - - if (mode != 0) { - this.pos += 4 - mode; - } - } - }; + }; // for reference see 7 & BD16 in http://unicode.org/reports/tr9/ + // - BmpDecoder.prototype.bit15 = function () { - var dif_w = this.width % 3; - var _11111 = parseInt("11111", 2), - _1_5 = _11111; + var _symmetricSwap = function _symmetricSwap(charArray, levels, params) { + if (params.hiLevel !== 0 && _isSymmetricSwapping) { + for (var i = 0, index; i < charArray.length; i++) { + if (levels[i] === 1) { + index = _SWAP_TABLE.indexOf(charArray[i]); - for (var y = this.height - 1; y >= 0; y--) { - var line = this.bottom_up ? y : this.height - 1 - y; + if (index >= 0) { + charArray[i] = _SWAP_TABLE[index + 1]; + } + } + } + } + }; - for (var x = 0; x < this.width; x++) { - var B = this.datav.getUint16(this.pos, true); - this.pos += 2; - var blue = (B & _1_5) / _1_5 * 255 | 0; - var green = (B >> 5 & _1_5) / _1_5 * 255 | 0; - var red = (B >> 10 & _1_5) / _1_5 * 255 | 0; - var alpha = B >> 15 ? 0xFF : 0x00; - var location = line * this.width * 4 + x * 4; - this.data[location] = red; - this.data[location + 1] = green; - this.data[location + 2] = blue; - this.data[location + 3] = alpha; - } //skip extra bytes + var _reorder = function _reorder(text, sourceToTargetMap, levels) { + var charArray = text.split(""), + params = { + hiLevel: _dir + }; + if (!levels) { + levels = []; + } - this.pos += dif_w; - } - }; + _computeLevels(charArray, levels, params); - BmpDecoder.prototype.bit16 = function () { - var dif_w = this.width % 3; + _symmetricSwap(charArray, levels, params); - var _11111 = parseInt("11111", 2), - _1_5 = _11111; + _invertByLevel(DIR_RTL + 1, charArray, sourceToTargetMap, levels, params); - var _111111 = parseInt("111111", 2), - _1_6 = _111111; + _invertByLevel(DIR_RTL, charArray, sourceToTargetMap, levels, params); - for (var y = this.height - 1; y >= 0; y--) { - var line = this.bottom_up ? y : this.height - 1 - y; + return charArray.join(""); + }; // doBidiReorder( text, sourceToTargetMap, levels ) + // Performs Bidi reordering by implementing Unicode Bidi algorithm. + // Returns reordered string + // @text [String]: + // - input string to be reordered, this is input parameter + // $sourceToTargetMap [Array] (optional) + // - resultant mapping between input and output strings, this is output parameter + // $levels [Array] (optional) + // - array of calculated Bidi levels, , this is output parameter - for (var x = 0; x < this.width; x++) { - var B = this.datav.getUint16(this.pos, true); - this.pos += 2; - var alpha = 0xFF; - var blue = (B & _1_5) / _1_5 * 255 | 0; - var green = (B >> 5 & _1_6) / _1_6 * 255 | 0; - var red = (B >> 11) / _1_5 * 255 | 0; - var location = line * this.width * 4 + x * 4; - this.data[location] = red; - this.data[location + 1] = green; - this.data[location + 2] = blue; - this.data[location + 3] = alpha; - } //skip extra bytes + this.__bidiEngine__.doBidiReorder = function (text, sourceToTargetMap, levels) { + _init(text, sourceToTargetMap); - this.pos += dif_w; - } - }; - - BmpDecoder.prototype.bit24 = function () { - //when height > 0 - for (var y = this.height - 1; y >= 0; y--) { - var line = this.bottom_up ? y : this.height - 1 - y; - - for (var x = 0; x < this.width; x++) { - var blue = this.datav.getUint8(this.pos++, true); - var green = this.datav.getUint8(this.pos++, true); - var red = this.datav.getUint8(this.pos++, true); - var location = line * this.width * 4 + x * 4; - this.data[location] = red; - this.data[location + 1] = green; - this.data[location + 2] = blue; - this.data[location + 3] = 0xFF; - } //skip extra bytes - - - this.pos += this.width % 4; - } - }; - /** - * add 32bit decode func - * @author soubok - */ + if (!_isInVisual && _isOutVisual && !_isOutRtl) { + // LLTR->VLTR, LRTL->VLTR + _dir = _isInRtl ? DIR_RTL : DIR_LTR; + text = _reorder(text, sourceToTargetMap, levels); + } else if (_isInVisual && _isOutVisual && _isInRtl ^ _isOutRtl) { + // VRTL->VLTR, VLTR->VRTL + _dir = _isInRtl ? DIR_RTL : DIR_LTR; + text = _invertString(text, sourceToTargetMap, levels); + } else if (!_isInVisual && _isOutVisual && _isOutRtl) { + // LLTR->VRTL, LRTL->VRTL + _dir = _isInRtl ? DIR_RTL : DIR_LTR; + text = _reorder(text, sourceToTargetMap, levels); + text = _invertString(text, sourceToTargetMap); + } else if (_isInVisual && !_isInRtl && !_isOutVisual && !_isOutRtl) { + // VLTR->LLTR + _dir = DIR_LTR; + text = _reorder(text, sourceToTargetMap, levels); + } else if (_isInVisual && !_isOutVisual && _isInRtl ^ _isOutRtl) { + // VLTR->LRTL, VRTL->LLTR + text = _invertString(text, sourceToTargetMap); + if (_isInRtl) { + //LLTR -> VLTR + _dir = DIR_LTR; + text = _reorder(text, sourceToTargetMap, levels); + } else { + //LRTL -> VRTL + _dir = DIR_RTL; + text = _reorder(text, sourceToTargetMap, levels); + text = _invertString(text, sourceToTargetMap); + } + } else if (_isInVisual && _isInRtl && !_isOutVisual && _isOutRtl) { + // VRTL->LRTL + _dir = DIR_RTL; + text = _reorder(text, sourceToTargetMap, levels); + text = _invertString(text, sourceToTargetMap); + } else if (!_isInVisual && !_isOutVisual && _isInRtl ^ _isOutRtl) { + // LRTL->LLTR, LLTR->LRTL + var isSymmetricSwappingOrig = _isSymmetricSwapping; - BmpDecoder.prototype.bit32 = function () { - //when height > 0 - for (var y = this.height - 1; y >= 0; y--) { - var line = this.bottom_up ? y : this.height - 1 - y; - - for (var x = 0; x < this.width; x++) { - var blue = this.datav.getUint8(this.pos++, true); - var green = this.datav.getUint8(this.pos++, true); - var red = this.datav.getUint8(this.pos++, true); - var alpha = this.datav.getUint8(this.pos++, true); - var location = line * this.width * 4 + x * 4; - this.data[location] = red; - this.data[location + 1] = green; - this.data[location + 2] = blue; - this.data[location + 3] = alpha; - } //skip extra bytes - //this.pos += (this.width % 4); + if (_isInRtl) { + //LRTL->LLTR + _dir = DIR_RTL; + text = _reorder(text, sourceToTargetMap, levels); + _dir = DIR_LTR; + _isSymmetricSwapping = false; + text = _reorder(text, sourceToTargetMap, levels); + _isSymmetricSwapping = isSymmetricSwappingOrig; + } else { + //LLTR->LRTL + _dir = DIR_LTR; + text = _reorder(text, sourceToTargetMap, levels); + text = _invertString(text, sourceToTargetMap); + _dir = DIR_RTL; + _isSymmetricSwapping = false; + text = _reorder(text, sourceToTargetMap, levels); + _isSymmetricSwapping = isSymmetricSwappingOrig; + text = _invertString(text, sourceToTargetMap); + } + } - } - }; + return text; + }; + /** + * @name setOptions( options ) + * @function + * Sets options for Bidi conversion + * @param {Object}: + * - isInputVisual {boolean} (defaults to false): allowed values: true(Visual mode), false(Logical mode) + * - isInputRtl {boolean}: allowed values true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong character of input string) + * - isOutputVisual {boolean} (defaults to false): allowed values: true(Visual mode), false(Logical mode) + * - isOutputRtl {boolean}: allowed values true(Right-to-left direction), false (Left-to-right directiion), undefined(Contectual direction, i.e.direction defined by first strong characterof input string) + * - isSymmetricSwapping {boolean} (defaults to false): allowed values true(needs symmetric swapping), false (no need in symmetric swapping), + */ - BmpDecoder.prototype.getData = function () { - return this.data; - }; - try { - module.exports = function (bmpData) { - var decoder = new BmpDecoder(bmpData); - return { - data: decoder.getData(), - width: decoder.width, - height: decoder.height + this.__bidiEngine__.setOptions = function (options) { + if (options) { + _isInVisual = options.isInputVisual; + _isOutVisual = options.isOutputVisual; + _isInRtl = options.isInputRtl; + _isOutRtl = options.isOutputRtl; + _isSymmetricSwapping = options.isSymmetricSwapping; + } }; + + this.__bidiEngine__.setOptions(options); + + return this.__bidiEngine__; }; - } catch (e) {} // CommonJS. - /*rollup-keeper-start*/ + var _bidiUnicodeTypes = bidiUnicodeTypes; + var bidiEngine = new jsPDF.__bidiEngine__({ + isInputVisual: true + }); + var bidiEngineFunction = function bidiEngineFunction(args) { + var text = args.text; + var x = args.x; + var y = args.y; + var options = args.options || {}; + var mutex = args.mutex || {}; + var lang = options.lang; + var tmpText = []; - window.tmp = BmpDecoder; - /*rollup-keeper-end*/ + if (Object.prototype.toString.call(text) === '[object Array]') { + var i = 0; + tmpText = []; - /* - Copyright (c) 2013 Gildas Lormeau. All rights reserved. + for (i = 0; i < text.length; i += 1) { + if (Object.prototype.toString.call(text[i]) === '[object Array]') { + tmpText.push([bidiEngine.doBidiReorder(text[i][0]), text[i][1], text[i][2]]); + } else { + tmpText.push([bidiEngine.doBidiReorder(text[i])]); + } + } - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + args.text = tmpText; + } else { + args.text = bidiEngine.doBidiReorder(text); + } + }; - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + jsPDF.API.events.push(['postProcessText', bidiEngineFunction]); + })(jsPDF); - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the distribution. + /* + Copyright (c) 2008, Adobe Systems Incorporated + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of Adobe Systems Incorporated nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ - 3. The names of the authors may not be used to endorse or promote products - derived from this software without specific prior written permission. + /** + * @author shaozilee + * + * Bmp format decoder,support 1bit 4bit 8bit 24bit bmp + * + */ - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, - INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + /* + Copyright (c) 2013 Gildas Lormeau. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, + INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* - * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc. - * JZlib is based on zlib-1.1.3, so all credit should go authors - * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) - * and contributors of zlib. + /* + * This program is based on JZlib 1.0.2 ymnk, JCraft,Inc. + * JZlib is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. */ (function (global) { @@ -22357,15 +21276,16 @@ // while `this` is nsIContentFrameMessageManager // with an attribute `content` that corresponds to the window - /** - * A class to parse color values - * @author Stoyan Stefanov - * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} - * @license Use it if you like it + /** + * A class to parse color values + * @author Stoyan Stefanov + * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} + * @license Use it if you like it */ (function (global) { function RGBColor(color_string) { + color_string = color_string || ''; this.ok = false; // strip any leading # if (color_string.charAt(0) == '#') { @@ -22584,31 +21504,21 @@ if (b.length == 1) b = '0' + b; return '#' + r + g + b; }; - } // export as AMD... - - - if (typeof define !== 'undefined' && define.amd) { - define('RGBColor', function () { - return RGBColor; - }); - } // ...or as browserify - else if (typeof module !== 'undefined' && module.exports) { - module.exports = RGBColor; - } + } global.RGBColor = RGBColor; })(typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || Function('return typeof this === "object" && this.content')() || Function('return this')()); // `self` is undefined in Firefox for Android content script context // while `this` is nsIContentFrameMessageManager // with an attribute `content` that corresponds to the window - /************************************************ - * Title : custom font * - * Start Data : 2017. 01. 22. * - * Comment : TEXT API * + /************************************************ + * Title : custom font * + * Start Data : 2017. 01. 22. * + * Comment : TEXT API * ************************************************/ - /****************************** - * jsPDF extension API Design * + /****************************** + * jsPDF extension API Design * * ****************************/ (function (jsPDF) { @@ -22705,6 +21615,11 @@ /************************************************************************/ TTFFont.open = function (filename, name, vfs, encoding) { var contents; + + if (typeof vfs !== "string") { + throw new Error('Invalid argument supplied in TTFFont.open'); + } + contents = b64ToByteArray(vfs); return new TTFFont(contents, name, encoding); }; @@ -22996,9 +21911,9 @@ return _results; }; - /*Data.prototype.stringAt = function (pos, length) { - this.pos = pos; - return this.readString(length); + /*Data.prototype.stringAt = function (pos, length) { + this.pos = pos; + return this.readString(length); };*/ @@ -23049,8 +21964,8 @@ Data.prototype.writeInt = function (val) { return this.writeInt32(val); }; - /*Data.prototype.slice = function (start, end) { - return this.data.slice(start, end); + /*Data.prototype.slice = function (start, end) { + return this.data.slice(start, end); };*/ @@ -23695,26 +22610,26 @@ this.metricDataFormat = data.readShort(); return this.numberOfMetrics = data.readUInt16(); }; - /*HheaTable.prototype.encode = function (ids) { - var i, table, _i, _ref; - table = new Data; - table.writeInt(this.version); - table.writeShort(this.ascender); - table.writeShort(this.decender); - table.writeShort(this.lineGap); - table.writeShort(this.advanceWidthMax); - table.writeShort(this.minLeftSideBearing); - table.writeShort(this.minRightSideBearing); - table.writeShort(this.xMaxExtent); - table.writeShort(this.caretSlopeRise); - table.writeShort(this.caretSlopeRun); - table.writeShort(this.caretOffset); - for (i = _i = 0, _ref = 4 * 2; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { - table.writeByte(0); - } - table.writeShort(this.metricDataFormat); - table.writeUInt16(ids.length); - return table.data; + /*HheaTable.prototype.encode = function (ids) { + var i, table, _i, _ref; + table = new Data; + table.writeInt(this.version); + table.writeShort(this.ascender); + table.writeShort(this.decender); + table.writeShort(this.lineGap); + table.writeShort(this.advanceWidthMax); + table.writeShort(this.minLeftSideBearing); + table.writeShort(this.minRightSideBearing); + table.writeShort(this.xMaxExtent); + table.writeShort(this.caretSlopeRise); + table.writeShort(this.caretSlopeRun); + table.writeShort(this.caretOffset); + for (i = _i = 0, _ref = 4 * 2; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { + table.writeByte(0); + } + table.writeShort(this.metricDataFormat); + table.writeUInt16(ids.length); + return table.data; };*/ @@ -23807,8 +22722,8 @@ } } }; - /*OS2Table.prototype.encode = function () { - return this.raw(); + /*OS2Table.prototype.encode = function () { + return this.raw(); };*/ @@ -23979,52 +22894,52 @@ this.compatibleFull = strings[18]; return this.sampleText = strings[19]; }; - /*NameTable.prototype.encode = function () { - var id, list, nameID, nameTable, postscriptName, strCount, strTable, string, strings, table, val, _i, _len, _ref; - strings = {}; - _ref = this.strings; - for (id in _ref) { - val = _ref[id]; - strings[id] = val; - } - postscriptName = new NameEntry("" + subsetTag + "+" + this.postscriptName, { - platformID: 1 - , encodingID: 0 - , languageID: 0 - }); - strings[6] = [postscriptName]; - subsetTag = successorOf(subsetTag); - strCount = 0; - for (id in strings) { - list = strings[id]; - if (list != null) { - strCount += list.length; - } - } - table = new Data; - strTable = new Data; - table.writeShort(0); - table.writeShort(strCount); - table.writeShort(6 + 12 * strCount); - for (nameID in strings) { - list = strings[nameID]; - if (list != null) { - for (_i = 0, _len = list.length; _i < _len; _i++) { - string = list[_i]; - table.writeShort(string.platformID); - table.writeShort(string.encodingID); - table.writeShort(string.languageID); - table.writeShort(nameID); - table.writeShort(string.length); - table.writeShort(strTable.pos); - strTable.writeString(string.raw); - } - } - } - return nameTable = { - postscriptName: postscriptName.raw - , table: table.data.concat(strTable.data) - }; + /*NameTable.prototype.encode = function () { + var id, list, nameID, nameTable, postscriptName, strCount, strTable, string, strings, table, val, _i, _len, _ref; + strings = {}; + _ref = this.strings; + for (id in _ref) { + val = _ref[id]; + strings[id] = val; + } + postscriptName = new NameEntry("" + subsetTag + "+" + this.postscriptName, { + platformID: 1 + , encodingID: 0 + , languageID: 0 + }); + strings[6] = [postscriptName]; + subsetTag = successorOf(subsetTag); + strCount = 0; + for (id in strings) { + list = strings[id]; + if (list != null) { + strCount += list.length; + } + } + table = new Data; + strTable = new Data; + table.writeShort(0); + table.writeShort(strCount); + table.writeShort(6 + 12 * strCount); + for (nameID in strings) { + list = strings[nameID]; + if (list != null) { + for (_i = 0, _len = list.length; _i < _len; _i++) { + string = list[_i]; + table.writeShort(string.platformID); + table.writeShort(string.encodingID); + table.writeShort(string.languageID); + table.writeShort(nameID); + table.writeShort(string.length); + table.writeShort(strTable.pos); + strTable.writeString(string.raw); + } + } + } + return nameTable = { + postscriptName: postscriptName.raw + , table: table.data.concat(strTable.data) + }; };*/ return NameTable; @@ -24057,25 +22972,25 @@ this.maxComponentElements = data.readUInt16(); return this.maxComponentDepth = data.readUInt16(); }; - /*MaxpTable.prototype.encode = function (ids) { - var table; - table = new Data; - table.writeInt(this.version); - table.writeUInt16(ids.length); - table.writeUInt16(this.maxPoints); - table.writeUInt16(this.maxContours); - table.writeUInt16(this.maxCompositePoints); - table.writeUInt16(this.maxComponentContours); - table.writeUInt16(this.maxZones); - table.writeUInt16(this.maxTwilightPoints); - table.writeUInt16(this.maxStorage); - table.writeUInt16(this.maxFunctionDefs); - table.writeUInt16(this.maxInstructionDefs); - table.writeUInt16(this.maxStackElements); - table.writeUInt16(this.maxSizeOfInstructions); - table.writeUInt16(this.maxComponentElements); - table.writeUInt16(this.maxComponentDepth); - return table.data; + /*MaxpTable.prototype.encode = function (ids) { + var table; + table = new Data; + table.writeInt(this.version); + table.writeUInt16(ids.length); + table.writeUInt16(this.maxPoints); + table.writeUInt16(this.maxContours); + table.writeUInt16(this.maxCompositePoints); + table.writeUInt16(this.maxComponentContours); + table.writeUInt16(this.maxZones); + table.writeUInt16(this.maxTwilightPoints); + table.writeUInt16(this.maxStorage); + table.writeUInt16(this.maxFunctionDefs); + table.writeUInt16(this.maxInstructionDefs); + table.writeUInt16(this.maxStackElements); + table.writeUInt16(this.maxSizeOfInstructions); + table.writeUInt16(this.maxComponentElements); + table.writeUInt16(this.maxComponentDepth); + return table.data; };*/ @@ -24163,16 +23078,16 @@ lsb: this.leftSideBearings[id - this.metrics.length] }; }; - /*HmtxTable.prototype.encode = function (mapping) { - var id, metric, table, _i, _len; - table = new Data; - for (_i = 0, _len = mapping.length; _i < _len; _i++) { - id = mapping[_i]; - metric = this.forGlyph(id); - table.writeUInt16(metric.advance); - table.writeUInt16(metric.lsb); - } - return table.data; + /*HmtxTable.prototype.encode = function (mapping) { + var id, metric, table, _i, _len; + table = new Data; + for (_i = 0, _len = mapping.length; _i < _len; _i++) { + id = mapping[_i]; + metric = this.forGlyph(id); + table.writeUInt16(metric.advance); + table.writeUInt16(metric.lsb); + } + return table.data; };*/ @@ -24459,51 +23374,51 @@ return ret; }; - /*var successorOf = function (input) { - var added, alphabet, carry, i, index, isUpperCase, last, length, next, result; - alphabet = 'abcdefghijklmnopqrstuvwxyz'; - length = alphabet.length; - result = input; - i = input.length; - while (i >= 0) { - last = input.charAt(--i); - if (isNaN(last)) { - index = alphabet.indexOf(last.toLowerCase()); - if (index === -1) { - next = last; - carry = true; - } - else { - next = alphabet.charAt((index + 1) % length); - isUpperCase = last === last.toUpperCase(); - if (isUpperCase) { - next = next.toUpperCase(); - } - carry = index + 1 >= length; - if (carry && i === 0) { - added = isUpperCase ? 'A' : 'a'; - result = added + next + result.slice(1); - break; - } - } - } - else { - next = +last + 1; - carry = next > 9; - if (carry) { - next = 0; - } - if (carry && i === 0) { - result = '1' + next + result.slice(1); - break; - } - } - result = result.slice(0, i) + next + result.slice(i + 1); - if (!carry) { - break; - } - } - return result; + /*var successorOf = function (input) { + var added, alphabet, carry, i, index, isUpperCase, last, length, next, result; + alphabet = 'abcdefghijklmnopqrstuvwxyz'; + length = alphabet.length; + result = input; + i = input.length; + while (i >= 0) { + last = input.charAt(--i); + if (isNaN(last)) { + index = alphabet.indexOf(last.toLowerCase()); + if (index === -1) { + next = last; + carry = true; + } + else { + next = alphabet.charAt((index + 1) % length); + isUpperCase = last === last.toUpperCase(); + if (isUpperCase) { + next = next.toUpperCase(); + } + carry = index + 1 >= length; + if (carry && i === 0) { + added = isUpperCase ? 'A' : 'a'; + result = added + next + result.slice(1); + break; + } + } + } + else { + next = +last + 1; + carry = next > 9; + if (carry) { + next = 0; + } + if (carry && i === 0) { + result = '1' + next + result.slice(1); + break; + } + } + result = result.slice(0, i) + next + result.slice(i + 1); + if (!carry) { + break; + } + } + return result; };*/ @@ -24514,28 +23429,28 @@ this.unicodes = {}; this.next = 33; } - /*Subset.prototype.use = function (character) { - var i, _i, _ref; - if (typeof character === 'string') { - for (i = _i = 0, _ref = character.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { - this.use(character.charCodeAt(i)); - } - return; - } - if (!this.unicodes[character]) { - this.subset[this.next] = character; - return this.unicodes[character] = this.next++; - } + /*Subset.prototype.use = function (character) { + var i, _i, _ref; + if (typeof character === 'string') { + for (i = _i = 0, _ref = character.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { + this.use(character.charCodeAt(i)); + } + return; + } + if (!this.unicodes[character]) { + this.subset[this.next] = character; + return this.unicodes[character] = this.next++; + } };*/ - /*Subset.prototype.encodeText = function (text) { - var char, i, string, _i, _ref; - string = ''; - for (i = _i = 0, _ref = text.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { - char = this.unicodes[text.charCodeAt(i)]; - string += String.fromCharCode(char); - } - return string; + /*Subset.prototype.encodeText = function (text) { + var char, i, string, _i, _ref; + string = ''; + for (i = _i = 0, _ref = text.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) { + char = this.unicodes[text.charCodeAt(i)]; + string += String.fromCharCode(char); + } + return string; };*/ /***************************************************************/ @@ -24561,19 +23476,19 @@ return mapping; }; - /*Subset.prototype.glyphIDs = function () { - var ret, roman, unicode, unicodeCmap, val, _ref; - unicodeCmap = this.font.cmap.tables[0].codeMap; - ret = [0]; - _ref = this.subset; - for (roman in _ref) { - unicode = _ref[roman]; - val = unicodeCmap[unicode]; - if ((val != null) && __indexOf.call(ret, val) < 0) { - ret.push(val); - } - } - return ret.sort(); + /*Subset.prototype.glyphIDs = function () { + var ret, roman, unicode, unicodeCmap, val, _ref; + unicodeCmap = this.font.cmap.tables[0].codeMap; + ret = [0]; + _ref = this.subset; + for (roman in _ref) { + unicode = _ref[roman]; + val = unicodeCmap[unicode]; + if ((val != null) && __indexOf.call(ret, val) < 0) { + ret.push(val); + } + } + return ret.sort(); };*/ /******************************************************************/ @@ -24754,12 +23669,12 @@ // Generated by CoffeeScript 1.4.0 - /* - # PNG.js - # Copyright (c) 2011 Devon Govett - # MIT LICENSE - # - # + /* + # PNG.js + # Copyright (c) 2011 Devon Govett + # MIT LICENSE + # + # */ (function (global) { var PNG; @@ -24889,8 +23804,8 @@ palLen = this.palette.length / 3; this.transparency.indexed = this.read(chunkSize); if (this.transparency.indexed.length > palLen) throw new Error('More transparent colors than palette size'); - /* - * According to the PNG spec trns should be increased to the same size as palette if shorter + /* + * According to the PNG spec trns should be increased to the same size as palette if shorter */ //palShort = 255 - this.transparency.indexed.length; @@ -25120,22 +24035,22 @@ } if (_this.interlaceMethod == 1) { - /* - 1 6 4 6 2 6 4 6 - 7 7 7 7 7 7 7 7 - 5 6 5 6 5 6 5 6 - 7 7 7 7 7 7 7 7 - 3 6 4 6 3 6 4 6 - 7 7 7 7 7 7 7 7 - 5 6 5 6 5 6 5 6 - 7 7 7 7 7 7 7 7 + /* + 1 6 4 6 2 6 4 6 + 7 7 7 7 7 7 7 7 + 5 6 5 6 5 6 5 6 + 7 7 7 7 7 7 7 7 + 3 6 4 6 3 6 4 6 + 7 7 7 7 7 7 7 7 + 5 6 5 6 5 6 5 6 + 7 7 7 7 7 7 7 7 */ pass(0, 0, 8, 8); // 1 - /* NOTE these seem to follow the pattern: - * pass(x, 0, 2*x, 2*x); - * pass(0, x, x, 2*x); - * with x being 4, 2, 1. + /* NOTE these seem to follow the pattern: + * pass(x, 0, 2*x, 2*x); + * pass(0, x, x, 2*x); + * with x being 4, 2, 1. */ pass(4, 0, 8, 8); // 2 @@ -25347,20 +24262,20 @@ // while `this` is nsIContentFrameMessageManager // with an attribute `content` that corresponds to the window - /* - * Extracted from pdf.js - * https://github.com/andreasgal/pdf.js - * - * Copyright (c) 2011 Mozilla Foundation - * - * Contributors: Andreas Gal - * Chris G Jones - * Shaon Barman - * Vivien Nicolas <21@vingtetun.org> - * Justin D'Arcangelo - * Yury Delendik - * - * + /* + * Extracted from pdf.js + * https://github.com/andreasgal/pdf.js + * + * Copyright (c) 2011 Mozilla Foundation + * + * Contributors: Andreas Gal + * Chris G Jones + * Shaon Barman + * Vivien Nicolas <21@vingtetun.org> + * Justin D'Arcangelo + * Yury Delendik + * + * */ var DecodeStream = function () { function constructor() { @@ -25720,24 +24635,10 @@ return constructor; }(); - /*rollup-keeper-start*/ - - - window.tmp = FlateStream; - /*rollup-keeper-end*/ - - exports.default = jsPDF; - var _default2 = exports.default; - function rewire($stub) { - exports.default = $stub; - } - function restore() { - exports.default = _default2; - } - - exports.rewire = rewire; - exports.restore = restore; - - Object.defineProperty(exports, '__esModule', { value: true }); })); + +try { +module.exports = jsPDF; +} +catch (e) {} diff --git a/dist/jspdf.min.js b/dist/jspdf.min.js index 47897e2e7..22ef14478 100644 --- a/dist/jspdf.min.js +++ b/dist/jspdf.min.js @@ -1,8 +1,8 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).jsPDF={})}(this,function(n){"use strict"; +!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict"; /** @license * jsPDF - PDF Document creation from JavaScript - * Version 1.5.2 Built on 2018-12-20T15:49:00.470Z - * CommitID 81f5c40ca4 + * Version 1.5.3 Built on 2018-12-26T22:17:53.465Z + * CommitID 5533a7bbbc * * Copyright (c) 2010-2016 James Hall , https://github.com/MrRio/jsPDF * 2010 Aaron Spike, https://github.com/acspike @@ -26,7 +26,7 @@ * Contributor(s): * siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango, * kim3er, mfo, alnorth, Flamenco - */function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var t;!function(t){if("object"!==se(t.console)){t.console={};for(var e,n,r=t.console,i=function(){},o=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=o.pop();)r[e]||(r[e]={});for(;n=a.pop();)r[n]||(r[n]=i)}var s,l,h,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,a=0,s=0,l="",h=[];if(!t)return t;for(;e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,h[s++]=c.charAt(e)+c.charAt(n)+c.charAt(r)+c.charAt(i),a>16&255,n=a>>8&255,r=255&a,h[l++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r),s>>0,r=new Array(n),i=1>>0,i=0;i>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i>16&255,r=l>>8&255,i=255&l}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+a[0];else switch(t.precision){case 2:e=Z(n/255)+" "+a[0];break;case 3:default:e=Q(n/255)+" "+a[0]}else if(void 0===o||"object"===se(o)){if(o&&!isNaN(o.a)&&0===o.a)return e=["1.000","1.000","1.000",a[1]].join(" ");if("string"==typeof n)e=[n,r,i,a[1]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),a[1]].join(" ");break;default:case 3:e=[Q(n/255),Q(r/255),Q(i/255),a[1]].join(" ")}}else if("string"==typeof n)e=[n,r,i,o,a[2]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),Z(o/255),a[2]].join(" ");break;case 3:default:e=[Q(n/255),Q(r/255),Q(i/255),Q(o/255),a[2]].join(" ")}return e},ct=l.__private__.getFilters=function(){return o},ft=l.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||ct(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,o=e.length,a={};!0===n&&(n=["FlateEncode"]);var s=t.additionalKeyValues||[],l=(a=void 0!==ae.API.processDataByFilters?ae.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());0!==a.data.length&&(s.push({key:"Length",value:a.data.length}),!0===i&&s.push({key:"Length1",value:o})),0!=l.length&&(l.split("/").length-1==1?s.push({key:"Filter",value:l}):s.push({key:"Filter",value:"["+l+"]"})),tt("<<");for(var h=0;h>"),0!==a.data.length&&(tt("stream"),tt(a.data),tt("endstream"))},dt=l.__private__.putPage=function(t){t.mediaBox;var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;ot(r,!0);V[x].mediaBox.topRightX,V[x].mediaBox.bottomLeftX,V[x].mediaBox.topRightY,V[x].mediaBox.bottomLeftY;tt("<>"),tt("endobj");var o=n.join("\n");return ot(i,!0),ft({data:o,filters:ct()}),tt("endobj"),r},pt=l.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=W;t++)V[t].objId=X(),V[t].contentsObjId=X();for(t=1;t<=W;t++)n.push(dt({number:t,data:I[t],objId:V[t].objId,contentsObjId:V[t].contentsObjId,mediaBox:V[t].mediaBox,cropBox:V[t].cropBox,bleedBox:V[t].bleedBox,trimBox:V[t].trimBox,artBox:V[t].artBox,userUnit:V[t].userUnit,rootDictionaryObjId:st,resourceDictionaryObjId:lt}));ot(st,!0),tt("<>"),tt("endobj"),it.publish("postPutPages")},gt=function(){!function(){for(var t in rt)rt.hasOwnProperty(t)&&(!1===s||!0===s&&K.hasOwnProperty(t))&&(e=rt[t],it.publish("putFont",{font:e,out:tt,newObject:J,putStream:ft}),!0!==e.isAlreadyPutted&&(e.objectNumber=J(),tt("<<"),tt("/Type /Font"),tt("/BaseFont /"+e.postScriptName),tt("/Subtype /Type1"),"string"==typeof e.encoding&&tt("/Encoding /"+e.encoding),tt("/FirstChar 32"),tt("/LastChar 255"),tt(">>"),tt("endobj")));var e}(),it.publish("putResources"),ot(lt,!0),tt("<<"),function(){for(var t in tt("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),tt("/Font <<"),rt)rt.hasOwnProperty(t)&&(!1===s||!0===s&&K.hasOwnProperty(t))&&tt("/"+t+" "+rt[t].objectNumber+" 0 R");tt(">>"),tt("/XObject <<"),it.publish("putXobjectDict"),tt(">>")}(),tt(">>"),tt("endobj"),it.publish("postPutResources")},mt=function(t,e,n){H.hasOwnProperty(e)||(H[e]={}),H[e][n]=t},yt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(rt).length+1).toString(10),a={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return it.publish("addFont",{font:a,instance:this}),void 0!==o&&(rt[o]=a,mt(o,e,n)),o},vt=l.__private__.pdfEscape=l.pdfEscape=function(t,e){return function(t,e){var n,r,i,o,a,s,l,h,u;if(i=(e=e||{}).sourceEncoding||"Unicode",a=e.outputEncoding,(e.autoencode||a)&&rt[$].metadata&&rt[$].metadata[i]&&rt[$].metadata[i].encoding&&(o=rt[$].metadata[i].encoding,!a&&rt[$].encoding&&(a=rt[$].encoding),!a&&o.codePages&&(a=o.codePages[0]),"string"==typeof a&&(a=o[a]),a)){for(l=!1,s=[],n=0,r=t.length;n>8&&(l=!0);t=s.join("")}for(n=t.length;void 0===l&&0!==n;)t.charCodeAt(n-1)>>8&&(l=!0),n--;if(!l)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(u),s.push(h-(u<<8))}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},wt=l.__private__.beginPage=function(t,e){var n,r="string"==typeof e&&e.toLowerCase();if("string"==typeof t&&f(t.toLowerCase())&&(t=f(t.toLowerCase())[0],e=f(t.toLowerCase())[1]),Array.isArray(t)&&(e=t[1],t=t[0]),(isNaN(t)||isNaN(e))&&(t=i[0],e=i[1]),r){switch(r.substr(0,1)){case"l":t>"),tt("endobj")},St=l.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||st;switch(J(),tt("<<"),tt("/Type /Catalog"),tt("/Pages "+e+" 0 R"),L||(L="fullwidth"),L){case"fullwidth":tt("/OpenAction [3 0 R /FitH null]");break;case"fullheight":tt("/OpenAction [3 0 R /FitV null]");break;case"fullpage":tt("/OpenAction [3 0 R /Fit]");break;case"original":tt("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+L;"%"===n.substr(n.length-1)&&(L=parseInt(L)/100),"number"==typeof L&&tt("/OpenAction [3 0 R /XYZ null null "+Z(L)+"]")}switch(S||(S="continuous"),S){case"continuous":tt("/PageLayout /OneColumn");break;case"single":tt("/PageLayout /SinglePage");break;case"two":case"twoleft":tt("/PageLayout /TwoColumnLeft");break;case"tworight":tt("/PageLayout /TwoColumnRight")}A&&tt("/PageMode /"+A),it.publish("putCatalog"),tt(">>"),tt("endobj")},_t=l.__private__.putTrailer=function(){tt("trailer"),tt("<<"),tt("/Size "+(U+1)),tt("/Root "+U+" 0 R"),tt("/Info "+(U-1)+" 0 R"),tt("/ID [ <"+p+"> <"+p+"> ]"),tt(">>")},Ft=l.__private__.putHeader=function(){tt("%PDF-"+h),tt("%ºß¬à")},Pt=l.__private__.putXRef=function(){var t=1,e="0000000000";for(tt("xref"),tt("0 "+(U+1)),tt("0000000000 65535 f "),t=1;t<=U;t++){"function"==typeof z[t]?tt((e+z[t]()).slice(-10)+" 00000 n "):void 0!==z[t]?tt((e+z[t]).slice(-10)+" 00000 n "):tt("0000000000 00000 n ")}},kt=l.__private__.buildDocument=function(){k=!1,B=U=0,C=[],z=[],G=[],st=X(),lt=X(),it.publish("buildDocument"),Ft(),pt(),function(){it.publish("putAdditionalObjects");for(var t=0;t',i=ie.open();if(null!==i&&i.document.write(r),i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return ie.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return F.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!ie.console)throw new Error(n);ie.console.error(n,t),ie.alert&&alert(n)}},(F.foo.bar=F).foo),Bt=function(t){return!0===Array.isArray(Y)&&-1":")"),Y=1):(W=Wt(e),V=Vt(n),G=(l?"<":"(")+v[H]+(l?">":")")),void 0!==T&&void 0!==T[H]&&(J=T[H]+" Tw\n"),0!==S.length&&0===H?t.push(J+S.join(" ")+" "+W.toFixed(2)+" "+V.toFixed(2)+" Tm\n"+G):1===Y||0===Y&&0===H?t.push(J+W.toFixed(2)+" "+V.toFixed(2)+" Td\n"+G):t.push(J+G);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var X="BT\n/"+$+" "+et+" Tf\n"+(et*u).toFixed(2)+" TL\n"+Kt+"\n";return X+=h,X+=t,tt(X+="ET"),K[$]=!0,c},l.__private__.lstext=l.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},l.__private__.clip=l.clip=function(t){tt("evenodd"===t?"W*":"W"),tt("n")},l.__private__.clip_fixed=l.clip_fixed=function(t){console.log("clip_fixed is deprecated"),l.clip(t)};var Mt=l.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},Tt=l.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};l.__private__.line=l.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},l.__private__.lines=l.lines=function(t,e,n,r,i,o){var a,s,l,h,u,c,f,d,p,g,m,y;if("number"==typeof t&&(y=n,n=e,e=t,t=y),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Mt(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(tt(Q(Wt(e))+" "+Q(Vt(n))+" m "),a=r[0],s=r[1],h=t.length,g=e,m=n,l=0;l>7,i=1<<(7&n)+1;x[t++];x[t++];var o=null;r&&(o=t,t+=3*i);var a=!0,s=[],l=0,h=null,u=0,c=null;for(this.width=N,this.height=e;a&&t>2&7,t++;break;case 254:for(;;){if(0===(A=x[t++]))break;t+=A}break;default:throw"Unknown graphic control label: 0x"+x[t-1].toString(16)}break;case 44:var d=x[t++]|x[t++]<<8,p=x[t++]|x[t++]<<8,g=x[t++]|x[t++]<<8,m=x[t++]|x[t++]<<8,y=x[t++],v=y>>6&1,w=o,b=!1;if(y>>7){b=!0;w=t,t+=3*(1<<(7&y)+1)}var L=t;for(t++;;){var A;if(0===(A=x[t++]))break;t+=A}s.push({x:d,y:p,width:g,height:m,has_local_palette:b,palette_offset:w,data_offset:L,data_length:t-L,transparent_index:h,interlaced:!!v,delay:l,disposal:u});break;case 59:a=!1;break;default:throw"Unknown gif block: 0x"+x[t-1].toString(16)}this.numFrames=function(){return s.length},this.loopCount=function(){return c},this.frameInfo=function(t){if(t<0||t>=s.length)throw"Frame index out of range.";return s[t]},this.decodeAndBlitFrameBGRA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);_t(x,n.data_offset,i,r);var o=n.palette_offset,a=n.transparent_index;null===a&&(a=256);var s=n.width,l=N-s,h=s,u=4*(n.y*N+n.x),c=4*((n.y+n.height)*N+n.x),f=u,d=4*l;!0===n.interlaced&&(d+=4*(s+l)*7);for(var p=8,g=0,m=i.length;g>=1)),y===a)f+=4;else{var v=x[o+3*y],w=x[o+3*y+1],b=x[o+3*y+2];e[f++]=b,e[f++]=w,e[f++]=v,e[f++]=255}--h}},this.decodeAndBlitFrameRGBA=function(t,e){var n=this.frameInfo(t),r=n.width*n.height,i=new Uint8Array(r);_t(x,n.data_offset,i,r);var o=n.palette_offset,a=n.transparent_index;null===a&&(a=256);var s=n.width,l=N-s,h=s,u=4*(n.y*N+n.x),c=4*((n.y+n.height)*N+n.x),f=u,d=4*l;!0===n.interlaced&&(d+=4*(s+l)*7);for(var p=8,g=0,m=i.length;g>=1)),y===a)f+=4;else{var v=x[o+3*y],w=x[o+3*y+1],b=x[o+3*y+2];e[f++]=v,e[f++]=w,e[f++]=b,e[f++]=255}--h}}}function _t(t,e,n,r){for(var i=t[e++],o=1<>=l,u-=l,m!==o){if(m===a)break;for(var y=m>8,++v;var b=w;if(r>=8;null!==g&&s<4096&&(p[s++]=g<<8|b,h+1<=s&&l<12&&(++l,h=h<<1|1)),g=m}else s=a+1,h=(1<<(l=i+1))-1,g=null}return f!==r&&console.log("Warning, gif stream shorter than expected."),n} + */function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t){if("object"!==se(t.console)){t.console={};for(var e,n,r=t.console,i=function(){},o=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=o.pop();)r[e]||(r[e]={});for(;n=a.pop();)r[n]||(r[n]=i)}var s,l,u,c,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,o,a=0,s=0,l="",u=[];if(!t)return t;for(;e=(o=t.charCodeAt(a++)<<16|t.charCodeAt(a++)<<8|t.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,u[s++]=h.charAt(e)+h.charAt(n)+h.charAt(r)+h.charAt(i),a>16&255,n=a>>8&255,r=255&a,u[l++]=64==i?String.fromCharCode(e):64==o?String.fromCharCode(e,n):String.fromCharCode(e,n,r),s>>0,r=new Array(n),i=1>>0,i=0;i>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i>16&255,r=l>>8&255,i=255&l}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+a[0];else switch(t.precision){case 2:e=Z(n/255)+" "+a[0];break;case 3:default:e=Q(n/255)+" "+a[0]}else if(void 0===o||"object"===se(o)){if(o&&!isNaN(o.a)&&0===o.a)return e=["1.000","1.000","1.000",a[1]].join(" ");if("string"==typeof n)e=[n,r,i,a[1]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),a[1]].join(" ");break;default:case 3:e=[Q(n/255),Q(r/255),Q(i/255),a[1]].join(" ")}}else if("string"==typeof n)e=[n,r,i,o,a[2]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),Z(o/255),a[2]].join(" ");break;case 3:default:e=[Q(n/255),Q(r/255),Q(i/255),Q(o/255),a[2]].join(" ")}return e},ht=l.__private__.getFilters=function(){return o},ft=l.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||ht(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,o=e.length,a={};!0===n&&(n=["FlateEncode"]);var s=t.additionalKeyValues||[],l=(a=void 0!==ae.API.processDataByFilters?ae.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());0!==a.data.length&&(s.push({key:"Length",value:a.data.length}),!0===i&&s.push({key:"Length1",value:o})),0!=l.length&&(l.split("/").length-1==1?s.push({key:"Filter",value:l}):s.push({key:"Filter",value:"["+l+"]"})),tt("<<");for(var u=0;u>"),0!==a.data.length&&(tt("stream"),tt(a.data),tt("endstream"))},pt=l.__private__.putPage=function(t){t.mediaBox;var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;ot(r,!0);V[x].mediaBox.topRightX,V[x].mediaBox.bottomLeftX,V[x].mediaBox.topRightY,V[x].mediaBox.bottomLeftY;tt("<>"),tt("endobj");var o=n.join("\n");return ot(i,!0),ft({data:o,filters:ht()}),tt("endobj"),r},dt=l.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=W;t++)V[t].objId=X(),V[t].contentsObjId=X();for(t=1;t<=W;t++)n.push(pt({number:t,data:I[t],objId:V[t].objId,contentsObjId:V[t].contentsObjId,mediaBox:V[t].mediaBox,cropBox:V[t].cropBox,bleedBox:V[t].bleedBox,trimBox:V[t].trimBox,artBox:V[t].artBox,userUnit:V[t].userUnit,rootDictionaryObjId:st,resourceDictionaryObjId:lt}));ot(st,!0),tt("<>"),tt("endobj"),it.publish("postPutPages")},gt=function(){!function(){for(var t in rt)rt.hasOwnProperty(t)&&(!1===s||!0===s&&K.hasOwnProperty(t))&&(e=rt[t],it.publish("putFont",{font:e,out:tt,newObject:J,putStream:ft}),!0!==e.isAlreadyPutted&&(e.objectNumber=J(),tt("<<"),tt("/Type /Font"),tt("/BaseFont /"+e.postScriptName),tt("/Subtype /Type1"),"string"==typeof e.encoding&&tt("/Encoding /"+e.encoding),tt("/FirstChar 32"),tt("/LastChar 255"),tt(">>"),tt("endobj")));var e}(),it.publish("putResources"),ot(lt,!0),tt("<<"),function(){for(var t in tt("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),tt("/Font <<"),rt)rt.hasOwnProperty(t)&&(!1===s||!0===s&&K.hasOwnProperty(t))&&tt("/"+t+" "+rt[t].objectNumber+" 0 R");tt(">>"),tt("/XObject <<"),it.publish("putXobjectDict"),tt(">>")}(),tt(">>"),tt("endobj"),it.publish("postPutResources")},mt=function(t,e,n){H.hasOwnProperty(e)||(H[e]={}),H[e][n]=t},yt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(rt).length+1).toString(10),a={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return it.publish("addFont",{font:a,instance:this}),void 0!==o&&(rt[o]=a,mt(o,e,n)),o},vt=l.__private__.pdfEscape=l.pdfEscape=function(t,e){return function(t,e){var n,r,i,o,a,s,l,u,c;if(i=(e=e||{}).sourceEncoding||"Unicode",a=e.outputEncoding,(e.autoencode||a)&&rt[$].metadata&&rt[$].metadata[i]&&rt[$].metadata[i].encoding&&(o=rt[$].metadata[i].encoding,!a&&rt[$].encoding&&(a=rt[$].encoding),!a&&o.codePages&&(a=o.codePages[0]),"string"==typeof a&&(a=o[a]),a)){for(l=!1,s=[],n=0,r=t.length;n>8&&(l=!0);t=s.join("")}for(n=t.length;void 0===l&&0!==n;)t.charCodeAt(n-1)>>8&&(l=!0),n--;if(!l)return t;for(s=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(c),s.push(u-(c<<8))}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},wt=l.__private__.beginPage=function(t,e){var n,r="string"==typeof e&&e.toLowerCase();if("string"==typeof t&&(n=f(t.toLowerCase()))&&(t=n[0],e=n[1]),Array.isArray(t)&&(e=t[1],t=t[0]),(isNaN(t)||isNaN(e))&&(t=i[0],e=i[1]),r){switch(r.substr(0,1)){case"l":t>"),tt("endobj")},St=l.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||st;switch(J(),tt("<<"),tt("/Type /Catalog"),tt("/Pages "+e+" 0 R"),L||(L="fullwidth"),L){case"fullwidth":tt("/OpenAction [3 0 R /FitH null]");break;case"fullheight":tt("/OpenAction [3 0 R /FitV null]");break;case"fullpage":tt("/OpenAction [3 0 R /Fit]");break;case"original":tt("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+L;"%"===n.substr(n.length-1)&&(L=parseInt(L)/100),"number"==typeof L&&tt("/OpenAction [3 0 R /XYZ null null "+Z(L)+"]")}switch(S||(S="continuous"),S){case"continuous":tt("/PageLayout /OneColumn");break;case"single":tt("/PageLayout /SinglePage");break;case"two":case"twoleft":tt("/PageLayout /TwoColumnLeft");break;case"tworight":tt("/PageLayout /TwoColumnRight")}A&&tt("/PageMode /"+A),it.publish("putCatalog"),tt(">>"),tt("endobj")},_t=l.__private__.putTrailer=function(){tt("trailer"),tt("<<"),tt("/Size "+(z+1)),tt("/Root "+z+" 0 R"),tt("/Info "+(z-1)+" 0 R"),tt("/ID [ <"+d+"> <"+d+"> ]"),tt(">>")},Ft=l.__private__.putHeader=function(){tt("%PDF-"+u),tt("%ºß¬à")},Pt=l.__private__.putXRef=function(){var t=1,e="0000000000";for(tt("xref"),tt("0 "+(z+1)),tt("0000000000 65535 f "),t=1;t<=z;t++){"function"==typeof U[t]?tt((e+U[t]()).slice(-10)+" 00000 n "):void 0!==U[t]?tt((e+U[t]).slice(-10)+" 00000 n "):tt("0000000000 00000 n ")}},kt=l.__private__.buildDocument=function(){k=!1,B=z=0,C=[],U=[],G=[],st=X(),lt=X(),it.publish("buildDocument"),Ft(),dt(),function(){it.publish("putAdditionalObjects");for(var t=0;t',i=ie.open();if(null!==i&&i.document.write(r),i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return ie.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return F.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!ie.console)throw new Error(n);ie.console.error(n,t),ie.alert&&alert(n)}},(F.foo.bar=F).foo),Bt=function(t){return!0===Array.isArray(Y)&&-1":")"),Y=1):(W=Wt(e),V=Vt(n),G=(l?"<":"(")+v[H]+(l?">":")")),void 0!==q&&void 0!==q[H]&&(J=q[H]+" Tw\n"),0!==S.length&&0===H?t.push(J+S.join(" ")+" "+W.toFixed(2)+" "+V.toFixed(2)+" Tm\n"+G):1===Y||0===Y&&0===H?t.push(J+W.toFixed(2)+" "+V.toFixed(2)+" Td\n"+G):t.push(J+G);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var X="BT\n/"+$+" "+et+" Tf\n"+(et*c).toFixed(2)+" TL\n"+Kt+"\n";return X+=u,X+=t,tt(X+="ET"),K[$]=!0,h},l.__private__.lstext=l.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},l.__private__.clip=l.clip=function(t){tt("evenodd"===t?"W*":"W"),tt("n")},l.__private__.clip_fixed=l.clip_fixed=function(t){console.log("clip_fixed is deprecated"),l.clip(t)};var Mt=l.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},qt=l.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};l.__private__.line=l.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},l.__private__.lines=l.lines=function(t,e,n,r,i,o){var a,s,l,u,c,h,f,p,d,g,m,y;if("number"==typeof t&&(y=n,n=e,e=t,t=y),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Mt(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(tt(Q(Wt(e))+" "+Q(Vt(n))+" m "),a=r[0],s=r[1],u=t.length,g=e,m=n,l=0;l=o.length-1;if(b&&!x){m+=" ";continue}if(b||x){if(x)p=w;else if(i.multiline&&a<(h+2)*(y+2)+2)continue t}else{if(!i.multiline)continue t;if(a<(h+2)*(y+2)+2)continue t;p=w}for(var N="",L=d;L<=p;L++)N+=o[L]+" ";switch(N=" "==N.substr(N.length-1)?N.substr(0,N.length-1):N,g=F(N,i,r).width,i.textAlign){case"right":c=s-g-2;break;case"center":c=(s-g)/2;break;case"left":default:c=2}t+=_(c)+" "+_(f)+" Td\n",t+="("+S(N)+") Tj\n",t+=-_(c)+" 0 Td\n",f=-(r+2),g=0,d=p+1,y++,m=""}else;break}return n.text=t,n.fontSize=r,n},F=function(t,e,n){var r=A.internal.getFont(e.fontName,e.fontStyle),i=A.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:A.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},u={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},d=function(){A.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=A.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&p.call(A,n)}},p=function(t){var e={type:"reference",object:t};void 0===A.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&A.internal.getPageInfo(t.page).pageContext.annotations.push(e)},g=function(){if(void 0===A.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");A.internal.write("/AcroForm "+A.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},m=function(){A.internal.events.unsubscribe(A.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete A.internal.acroformPlugin.acroFormDictionaryRoot._eventID,A.internal.acroformPlugin.printedOut=!0},L=function(t){var e=!t;t||(A.internal.newObjectDeferredBegin(A.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),A.internal.acroformPlugin.acroFormDictionaryRoot.putStream());t=t||A.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=[],o=r.Rect;if(r.Rect&&(r.Rect=c.call(this,r.Rect)),A.internal.newObjectDeferredBegin(r.objId,!0),r.DA=Y.createDefaultAppearanceStream(r),"object"===se(r)&&"function"==typeof r.getKeyValueListForStream&&(i=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=f.call(this,r);i.push({key:"AP",value:"<>"}),A.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var s="";for(var l in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(l)){var h=r.appearanceStreamContent[l];if(s+="/"+l+" ",s+="<<",1<=Object.keys(h).length||Array.isArray(h))for(var n in h){var u;if(h.hasOwnProperty(n))"function"==typeof(u=h[n])&&(u=u.call(this,r)),s+="/"+n+" "+u+" ",0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u)}else"function"==typeof(u=h)&&(u=u.call(this,r)),s+="/"+n+" "+u,0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u);s+=">>"}i.push({key:"AP",value:"<<\n"+s+">>"})}A.internal.putStream({additionalKeyValues:i}),A.internal.out("endobj")}e&&P.call(this,A.internal.acroformPlugin.xForms)},P=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];A.internal.newObjectDeferredBegin(r&&r.objId,!0),"object"===se(r)&&"function"==typeof r.putStream&&r.putStream(),delete t[n]}},k=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(A=this,O.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(u)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");n=A.internal.scaleFactor,A.internal.acroformPlugin.acroFormDictionaryRoot=new E,A.internal.acroformPlugin.acroFormDictionaryRoot._eventID=A.internal.events.subscribe("postPutResources",m),A.internal.events.subscribe("buildDocument",d),A.internal.events.subscribe("putCatalog",g),A.internal.events.subscribe("postPutPages",L),A.internal.acroformPlugin.isInitialized=!0}},I=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n>"),e.join("\n")}},set:function(t){"object"===se(t)&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){"string"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};r(D,O);var U=function(){D.call(this),this.pushButton=!0};r(U,D);var z=function(){D.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};r(z,D);var H=function(){var e,n;O.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var r,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),i)e.push("/"+t+" ("+i[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===se(t)&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(t){r="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=Y.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};r(H,O),z.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t&&"getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},z.prototype.createOption=function(t){this.Kids.length;var e=new H;return e.Parent=this,e.optionName=t,this.Kids.push(e),J.call(this,e),e};var W=function(){D.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Y.CheckBox.createAppearanceStream()};r(W,D);var V=function(){O.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,13):this.Ff=N(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,21):this.Ff=N(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=N(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,24):this.Ff=N(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,25):this.Ff=N(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=N(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};r(V,O);var G=function(){V.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,14):this.Ff=N(this.Ff,14)}}),this.password=!0};r(G,V);var Y={CheckBox:{createAppearanceStream:function(){return{N:{On:Y.CheckBox.YesNormal},D:{On:Y.CheckBox.YesPushDown,Off:Y.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=l(t),n=[],r=A.internal.getFont(t.fontName,t.fontStyle).id,i=A.__private__.encodeColorString(t.color),o=h(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+_(o.fontSize)+" Tf "+i),n.push("BT"),n.push(o.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=l(t),n=A.internal.getFont(t.fontName,t.fontStyle).id,r=A.__private__.encodeColorString(t.color),i=[],o=Y.internal.getHeight(t),a=Y.internal.getWidth(t),s=h(t,t.caption);return i.push("1 g"),i.push("0 0 "+_(a)+" "+_(o)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+_(a-1)+" "+_(o-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+_(s.fontSize)+" Tf "+r),i.push(s.text),i.push("ET"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Circle.YesNormal,e.D[t]=Y.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Y.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5)),a=Number((r*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Cross.YesNormal,e.D[t]=Y.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(_(r.x1.x)+" "+_(r.x1.y)+" m"),n.push(_(r.x2.x)+" "+_(r.x2.y)+" l"),n.push(_(r.x4.x)+" "+_(r.x4.y)+" m"),n.push(_(r.x3.x)+" "+_(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=l(t),n=Y.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(_(n.x1.x)+" "+_(n.x1.y)+" m"),r.push(_(n.x2.x)+" "+_(n.x2.y)+" l"),r.push(_(n.x4.x)+" "+_(n.x4.y)+" m"),r.push(_(n.x3.x)+" "+_(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=A.internal.getFont(t.fontName,t.fontStyle).id,n=A.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};Y.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Y.internal.getWidth(t),n=Y.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},Y.internal.getWidth=function(t){var e=0;return"object"===se(t)&&(e=v(t.Rect[2])),e},Y.internal.getHeight=function(t){var e=0;return"object"===se(t)&&(e=v(t.Rect[3])),e};var J=t.addField=function(t){if(k.call(this),!(t instanceof O))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){A.internal.acroformPlugin.printedOut&&(A.internal.acroformPlugin.printedOut=!1,A.internal.acroformPlugin.acroFormDictionaryRoot=null),A.internal.acroformPlugin.acroFormDictionaryRoot||k.call(A),A.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=A.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof D==!1)throw new Error("Invalid argument passed to jsPDF.addButton.");return J.call(this,t)},t.addTextField=function(t){if(t instanceof V==!1)throw new Error("Invalid argument passed to jsPDF.addTextField.");return J.call(this,t)},t.addChoiceField=function(t){if(t instanceof M==!1)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return J.call(this,t)};"object"==se(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=M,e.ListBox=T,e.ComboBox=q,e.EditBox=R,e.Button=D,e.PushButton=U,e.RadioButton=z,e.CheckBox=W,e.TextField=V,e.PasswordField=G,e.AcroForm={Appearance:Y}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=M,t.AcroFormListBox=T,t.AcroFormComboBox=q,t.AcroFormEditBox=R,t.AcroFormButton=D,t.AcroFormPushButton=U,t.AcroFormRadioButton=z,t.AcroFormCheckBox=W,t.AcroFormTextField=V,t.AcroFormPasswordField=G,t.AcroFormAppearance=Y,t.AcroForm={ChoiceField:M,ListBox:T,ComboBox:q,EditBox:R,Button:D,PushButton:U,RadioButton:z,CheckBox:W,TextField:V,PasswordField:G,Appearance:Y}})((window.tmp=At).API,"undefined"!=typeof window&&window||"undefined"!=typeof global&&global), +/** + * @license + * Copyright (c) 2016 Alexander Weidt, + * https://github.com/BiggA94 + * + * Licensed under the MIT License. http://opensource.org/licenses/mit-license + */ +!function(t,e){var A,n=1,S=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},y=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},_=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(2)},s=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(5)};t.__acroform__={};var r=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},v=function(t){return t*n},w=function(t){return t/n},l=function(t){var e=new j,n=Y.internal.getHeight(t)||0,r=Y.internal.getWidth(t)||0;return e.BBox=[0,0,Number(_(r)),Number(_(n))],e},i=t.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|=1<=o.length-1;if(b&&!x){m+=" ";continue}if(b||x){if(x)d=w;else if(i.multiline&&a<(u+2)*(y+2)+2)continue t}else{if(!i.multiline)continue t;if(a<(u+2)*(y+2)+2)continue t;d=w}for(var N="",L=p;L<=d;L++)N+=o[L]+" ";switch(N=" "==N.substr(N.length-1)?N.substr(0,N.length-1):N,g=F(N,i,r).width,i.textAlign){case"right":h=s-g-2;break;case"center":h=(s-g)/2;break;case"left":default:h=2}t+=_(h)+" "+_(f)+" Td\n",t+="("+S(N)+") Tj\n",t+=-_(h)+" 0 Td\n",f=-(r+2),g=0,p=d+1,y++,m=""}else;break}return n.text=t,n.fontSize=r,n},F=function(t,e,n){var r=A.internal.getFont(e.fontName,e.fontStyle),i=A.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:A.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},c={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){A.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=A.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&d.call(A,n)}},d=function(t){var e={type:"reference",object:t};void 0===A.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&A.internal.getPageInfo(t.page).pageContext.annotations.push(e)},g=function(){if(void 0===A.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");A.internal.write("/AcroForm "+A.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},m=function(){A.internal.events.unsubscribe(A.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete A.internal.acroformPlugin.acroFormDictionaryRoot._eventID,A.internal.acroformPlugin.printedOut=!0},L=function(t){var e=!t;t||(A.internal.newObjectDeferredBegin(A.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),A.internal.acroformPlugin.acroFormDictionaryRoot.putStream());t=t||A.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=[],o=r.Rect;if(r.Rect&&(r.Rect=h.call(this,r.Rect)),A.internal.newObjectDeferredBegin(r.objId,!0),r.DA=Y.createDefaultAppearanceStream(r),"object"===se(r)&&"function"==typeof r.getKeyValueListForStream&&(i=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=f.call(this,r);i.push({key:"AP",value:"<>"}),A.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var s="";for(var l in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(l)){var u=r.appearanceStreamContent[l];if(s+="/"+l+" ",s+="<<",1<=Object.keys(u).length||Array.isArray(u))for(var n in u){var c;if(u.hasOwnProperty(n))"function"==typeof(c=u[n])&&(c=c.call(this,r)),s+="/"+n+" "+c+" ",0<=A.internal.acroformPlugin.xForms.indexOf(c)||A.internal.acroformPlugin.xForms.push(c)}else"function"==typeof(c=u)&&(c=c.call(this,r)),s+="/"+n+" "+c,0<=A.internal.acroformPlugin.xForms.indexOf(c)||A.internal.acroformPlugin.xForms.push(c);s+=">>"}i.push({key:"AP",value:"<<\n"+s+">>"})}A.internal.putStream({additionalKeyValues:i}),A.internal.out("endobj")}e&&P.call(this,A.internal.acroformPlugin.xForms)},P=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];A.internal.newObjectDeferredBegin(r&&r.objId,!0),"object"===se(r)&&"function"==typeof r.putStream&&r.putStream(),delete t[n]}},k=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(A=this,O.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(c)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");n=A.internal.scaleFactor,A.internal.acroformPlugin.acroFormDictionaryRoot=new E,A.internal.acroformPlugin.acroFormDictionaryRoot._eventID=A.internal.events.subscribe("postPutResources",m),A.internal.events.subscribe("buildDocument",p),A.internal.events.subscribe("putCatalog",g),A.internal.events.subscribe("postPutPages",L),A.internal.acroformPlugin.isInitialized=!0}},I=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n>"),e.join("\n")}},set:function(t){"object"===se(t)&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){"string"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};r(D,O);var z=function(){D.call(this),this.pushButton=!0};r(z,D);var U=function(){D.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};r(U,D);var H=function(){var e,n;O.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var r,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),i)e.push("/"+t+" ("+i[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===se(t)&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(t){r="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=Y.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};r(H,O),U.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t&&"getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},U.prototype.createOption=function(t){this.Kids.length;var e=new H;return e.Parent=this,e.optionName=t,this.Kids.push(e),J.call(this,e),e};var W=function(){D.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Y.CheckBox.createAppearanceStream()};r(W,D);var V=function(){O.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,13):this.Ff=N(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,21):this.Ff=N(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=N(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,24):this.Ff=N(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,25):this.Ff=N(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=N(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};r(V,O);var G=function(){V.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,14):this.Ff=N(this.Ff,14)}}),this.password=!0};r(G,V);var Y={CheckBox:{createAppearanceStream:function(){return{N:{On:Y.CheckBox.YesNormal},D:{On:Y.CheckBox.YesPushDown,Off:Y.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=l(t),n=[],r=A.internal.getFont(t.fontName,t.fontStyle).id,i=A.__private__.encodeColorString(t.color),o=u(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+_(o.fontSize)+" Tf "+i),n.push("BT"),n.push(o.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=l(t),n=A.internal.getFont(t.fontName,t.fontStyle).id,r=A.__private__.encodeColorString(t.color),i=[],o=Y.internal.getHeight(t),a=Y.internal.getWidth(t),s=u(t,t.caption);return i.push("1 g"),i.push("0 0 "+_(a)+" "+_(o)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+_(a-1)+" "+_(o-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+_(s.fontSize)+" Tf "+r),i.push(s.text),i.push("ET"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Circle.YesNormal,e.D[t]=Y.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Y.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5)),a=Number((r*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+s(Y.internal.getWidth(t)/2)+" "+s(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Cross.YesNormal,e.D[t]=Y.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(_(r.x1.x)+" "+_(r.x1.y)+" m"),n.push(_(r.x2.x)+" "+_(r.x2.y)+" l"),n.push(_(r.x4.x)+" "+_(r.x4.y)+" m"),n.push(_(r.x3.x)+" "+_(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=l(t),n=Y.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(_(n.x1.x)+" "+_(n.x1.y)+" m"),r.push(_(n.x2.x)+" "+_(n.x2.y)+" l"),r.push(_(n.x4.x)+" "+_(n.x4.y)+" m"),r.push(_(n.x3.x)+" "+_(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=A.internal.getFont(t.fontName,t.fontStyle).id,n=A.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};Y.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Y.internal.getWidth(t),n=Y.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},Y.internal.getWidth=function(t){var e=0;return"object"===se(t)&&(e=v(t.Rect[2])),e},Y.internal.getHeight=function(t){var e=0;return"object"===se(t)&&(e=v(t.Rect[3])),e};var J=t.addField=function(t){if(k.call(this),!(t instanceof O))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){A.internal.acroformPlugin.printedOut&&(A.internal.acroformPlugin.printedOut=!1,A.internal.acroformPlugin.acroFormDictionaryRoot=null),A.internal.acroformPlugin.acroFormDictionaryRoot||k.call(A),A.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=A.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof D==!1)throw new Error("Invalid argument passed to jsPDF.addButton.");return J.call(this,t)},t.addTextField=function(t){if(t instanceof V==!1)throw new Error("Invalid argument passed to jsPDF.addTextField.");return J.call(this,t)},t.addChoiceField=function(t){if(t instanceof M==!1)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return J.call(this,t)};"object"==se(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=M,e.ListBox=q,e.ComboBox=T,e.EditBox=R,e.Button=D,e.PushButton=z,e.RadioButton=U,e.CheckBox=W,e.TextField=V,e.PasswordField=G,e.AcroForm={Appearance:Y}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=M,t.AcroFormListBox=q,t.AcroFormComboBox=T,t.AcroFormEditBox=R,t.AcroFormButton=D,t.AcroFormPushButton=z,t.AcroFormRadioButton=U,t.AcroFormCheckBox=W,t.AcroFormTextField=V,t.AcroFormPasswordField=G,t.AcroFormAppearance=Y,t.AcroForm={ChoiceField:M,ListBox:q,ComboBox:T,EditBox:R,Button:D,PushButton:z,RadioButton:U,CheckBox:W,TextField:V,PasswordField:G,Appearance:Y}}(lt.API,"undefined"!=typeof window&&window||"undefined"!=typeof global&&global), /** @license * jsPDF addImage plugin * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/ @@ -47,7 +54,7 @@ * * */ -function(x){var N="addImage_",l={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},h=x.getImageFileTypeByImageData=function(t,e){var n,r;e=e||"UNKNOWN";var i,o,a,s="UNKNOWN";for(a in x.isArrayBufferView(t)&&(t=x.arrayBufferToBinaryString(t)),l)for(i=l[a],n=0;n>"}),"trns"in e&&e.trns.constructor==Array){for(var s="",l=0,h=e.trns.length;l>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},x.createImageInfo=function(t,e,n,r,i,o,a,s,l,h,u,c,f){var d={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(d.f=o),l&&(d.dp=l),h&&(d.trns=h),u&&(d.pal=u),c&&(d.smask=c),f&&(d.p=f),d},x.addImage=function(t,e,n,r,i,o,a,s,l){var h="";if("string"!=typeof e){var u=o;o=i,i=r,r=n,n=e,e=u}if("object"===se(t)&&!_(t)&&"imageData"in t){var c=t;t=c.imageData,e=c.format||e||"UNKNOWN",n=c.x||n||0,r=c.y||r||0,i=c.w||i,o=c.h||o,a=c.alias||a,s=c.compression||s,l=c.rotation||c.angle||l}var f=this.internal.getFilters();if(void 0===s&&-1!==f.indexOf("FlateEncode")&&(s="SLOW"),"string"==typeof t&&(t=unescape(t)),isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var d,p,g,m,y,v,w,b=function(){var t=this.internal.collections[N+"images"];return t||(this.internal.collections[N+"images"]=t={},this.internal.events.subscribe("putResources",L),this.internal.events.subscribe("putXobjectDict",A)),t}.call(this);if(!((d=P(t,b))||(_(t)&&(t=F(t,e)),(null==(w=a)||0===w.length)&&(a="string"==typeof(v=t)?x.sHashCode(v):x.isArrayBufferView(v)?x.sHashCode(x.arrayBufferToBinaryString(v)):null),d=P(a,b)))){if(this.isString(t)&&(""!==(h=this.convertStringToImageData(t))?t=h:void 0!==(h=x.loadFile(t))&&(t=h)),e=this.getImageFileTypeByImageData(t,e),!S(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(p=t,t=this.binaryStringToUint8Array(t))),!(d=this["process"+e.toUpperCase()](t,(y=0,(m=b)&&(y=Object.keys?Object.keys(m).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(m)),y),a,((g=s)&&"string"==typeof g&&(g=g.toUpperCase()),g in x.image_compression?g:x.image_compression.NONE),p)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var l=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),h=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;if(n=l[0],r=l[1],a[o]=i,s){s*=Math.PI/180;var c=Math.cos(s),f=Math.sin(s),d=function(t){return t.toFixed(4)},p=[d(c),d(f),d(-1*f),d(c),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,h(t),u(e+r),"cm"].join(" ")),this.internal.write(p.join(" ")),this.internal.write([h(n),"0","0",h(r),"0","0","cm"].join(" "))):this.internal.write([h(n),"0","0",h(r),h(t),u(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,n,r,i,o,d,d.i,b,l),this},x.convertStringToImageData=function(t){var e,n="";if(this.isString(t)){var r;e=null!==(r=this.extractImageFromDataUrl(t))?r.data:t;try{n=atob(e)}catch(t){throw x.validateStringAsBase64(e)?new Error("atob-Error in jsPDF.convertStringToImageData "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return n};var u=function(t,e){return t.subarray(e,e+5)};x.processJPEG=function(t,e,n,r,i,o){var a,s=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if("JPEG"!==h(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r>"}),"trns"in e&&e.trns.constructor==Array){for(var s="",l=0,u=e.trns.length;l>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},x.createImageInfo=function(t,e,n,r,i,o,a,s,l,u,c,h,f){var p={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(p.f=o),l&&(p.dp=l),u&&(p.trns=u),c&&(p.pal=c),h&&(p.smask=h),f&&(p.p=f),p},x.addImage=function(t,e,n,r,i,o,a,s,l){var u="";if("string"!=typeof e){var c=o;o=i,i=r,r=n,n=e,e=c}if("object"===se(t)&&!_(t)&&"imageData"in t){var h=t;t=h.imageData,e=h.format||e||"UNKNOWN",n=h.x||n||0,r=h.y||r||0,i=h.w||i,o=h.h||o,a=h.alias||a,s=h.compression||s,l=h.rotation||h.angle||l}var f=this.internal.getFilters();if(void 0===s&&-1!==f.indexOf("FlateEncode")&&(s="SLOW"),"string"==typeof t&&(t=unescape(t)),isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var p,d,g,m,y,v,w,b=function(){var t=this.internal.collections[N+"images"];return t||(this.internal.collections[N+"images"]=t={},this.internal.events.subscribe("putResources",L),this.internal.events.subscribe("putXobjectDict",A)),t}.call(this);if(!((p=P(t,b))||(_(t)&&(t=F(t,e)),(null==(w=a)||0===w.length)&&(a="string"==typeof(v=t)?x.sHashCode(v):x.isArrayBufferView(v)?x.sHashCode(x.arrayBufferToBinaryString(v)):null),p=P(a,b)))){if(this.isString(t)&&(""!==(u=this.convertStringToImageData(t))?t=u:void 0!==(u=x.loadFile(t))&&(t=u)),e=this.getImageFileTypeByImageData(t,e),!S(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t,t=this.binaryStringToUint8Array(t))),!(p=this["process"+e.toUpperCase()](t,(y=0,(m=b)&&(y=Object.keys?Object.keys(m).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(m)),y),a,((g=s)&&"string"==typeof g&&(g=g.toUpperCase()),g in x.image_compression?g:x.image_compression.NONE),d)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var l=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),u=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;if(n=l[0],r=l[1],a[o]=i,s){s*=Math.PI/180;var h=Math.cos(s),f=Math.sin(s),p=function(t){return t.toFixed(4)},d=[p(h),p(f),p(-1*f),p(h),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,u(t),c(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([u(n),"0","0",u(r),"0","0","cm"].join(" "))):this.internal.write([u(n),"0","0",u(r),u(t),c(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,n,r,i,o,p,p.i,b,l),this},x.convertStringToImageData=function(t){var e,n="";if(this.isString(t)){var r;e=null!==(r=this.extractImageFromDataUrl(t))?r.data:t;try{n=atob(e)}catch(t){throw x.validateStringAsBase64(e)?new Error("atob-Error in jsPDF.convertStringToImageData "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return n};var c=function(t,e){return t.subarray(e,e+5)};x.processJPEG=function(t,e,n,r,i,o){var a,s=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if("JPEG"!==u(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r>",h.content=m;var f=h.objId+" 0 R";m="<>";else if(l.options.pageNumber)switch(m="<>",this.internal.write(m))}}this.internal.write("]")}}]),e.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},e.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},e.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},e.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor}, +t=lt.API,lt.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(t){for(var e=this.internal.getPageInfoByObjId(t.objId),n=t.pageContext.annotations,r=function(t){if(void 0!==t&&""!=t)return!0},i=!1,o=0;o>",u.content=m;var f=u.objId+" 0 R";m="<>";else if(l.options.pageNumber)switch(m="<>",this.internal.write(m))}}this.internal.write("]")}}]),t.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},t.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor}, /** * @license * Copyright (c) 2017 Aras Abbasi @@ -63,7 +70,7 @@ e=At.API,At.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.p * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ -function(t){var h={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},a={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];t.__arabicParser__={};var r=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==h[t.charCodeAt(0)]},u=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},i=t.__arabicParser__.isArabicEndLetter=function(t){return u(t)&&r(t)&&h[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return u(t)&&0<=n.indexOf(t.charCodeAt(0))},s=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return u(t)&&r(t)&&1<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return u(t)&&r(t)&&2<=h[t.charCodeAt(0)].length}),l=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return u(t)&&r(t)&&3<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return u(t)&&r(t)&&4==h[t.charCodeAt(0)].length}),c=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=a,r=0,i="",o=0;for(e=0;e>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this}, +function(t){var u={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},a={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];t.__arabicParser__={};var r=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==u[t.charCodeAt(0)]},c=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},i=t.__arabicParser__.isArabicEndLetter=function(t){return c(t)&&r(t)&&u[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return c(t)&&0<=n.indexOf(t.charCodeAt(0))},s=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return c(t)&&r(t)&&1<=u[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return c(t)&&r(t)&&2<=u[t.charCodeAt(0)].length}),l=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return c(t)&&r(t)&&3<=u[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return c(t)&&r(t)&&4==u[t.charCodeAt(0)].length}),h=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=a,r=0,i="",o=0;for(e=0;e>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this}, /** * @license * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv @@ -71,7 +78,7 @@ function(t){var h={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[6515 * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ -r=At.API,(i=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var r=300;Object.defineProperty(this,"height",{get:function(){return r},set:function(t){r=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=r+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(t){i=t}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(t){o=t}}),Object.defineProperty(this,"parentNode",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},i.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},r.events.push(["initialized",function(){this.canvas=new i,this.canvas.pdf=this}]), +e=lt.API,(n=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var r=300;Object.defineProperty(this,"height",{get:function(){return r},set:function(t){r=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=r+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(t){i=t}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(t){o=t}}),Object.defineProperty(this,"parentNode",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},n.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new n,this.canvas.pdf=this}]), /** * @license * ==================================================================== @@ -85,13 +92,13 @@ r=At.API,(i=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:functi * * ==================================================================== */ -_=At.API,F={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1,d=function(t,e,n,r,i){F={x:t,y:e,w:n,h:r,ln:i}},p=function(){return F},k={left:0,top:0,bottom:0},_.setHeaderFunction=function(t){l=t},_.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,a=0;if("string"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if("[object Array]"!==Object.prototype.toString.call(t))throw new Error("getTextDimensions expects text-parameter to be of type String or an Array of Strings.");for(var s=0;s=this.internal.pageSize.getHeight()-h.bottom&&(this.cellAddPage(),l=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=p().y+p().h,l&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===a){i instanceof Array||(i=[i]);for(var u=0;u=this.internal.pageSize.getHeight()-u.bottom&&(this.cellAddPage(),l=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,l&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===a){i instanceof Array||(i=[i]);for(var c=0;c=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},n.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},n.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},n.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!N.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},n.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");L.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},n.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},n.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},n.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},n.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},n.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!N.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},n.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");L.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},n.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},n.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n"},s=function(t){var r,e,n,i,o,a=String,s="length",l="charCodeAt",h="slice",u="replace";for(t[h](-2),t=t[h](0,-2)[u](/\s/g,"")[u]("z","!!!!!"),n=[],i=0,o=(t+=r="uuuuu"[h](t[s]%5||5))[s];i>24,255&e>>16,255&e>>8,255&e);return function(t,e){for(var n=r[s];0")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),t=String.fromCharCode.apply(null,i)},a.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n"},s=function(t){var r,e,n,i,o,a=String,s="length",l="charCodeAt",u="slice",c="replace";for(t[u](-2),t=t[u](0,-2)[c](/\s/g,"")[c]("z","!!!!!"),n=[],i=0,o=(t+=r="uuuuu"[u](t[s]%5||5))[s];i>24,255&e>>16,255&e>>8,255&e);return function(t,e){for(var n=r[s];0")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),t=String.fromCharCode.apply(null,i)},a.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n>"),this.internal.out("endobj"),x=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+N+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==b&&void 0!==x&&this.internal.out("/Names <>")}),this},( +i=lt.API,f="undefined"!=typeof window&&window||"undefined"!=typeof global&&global,g=function(t){var e=se(t);return"undefined"===e?"undefined":"string"===e||t instanceof String?"string":"number"===e||t instanceof Number?"number":"function"===e||t instanceof Function?"function":t&&t.constructor===Array?"array":t&&1===t.nodeType?"element":"object"===e?"object":"unknown"},m=function(t,e){var n=document.createElement(t);if(e.className&&(n.className=e.className),e.innerHTML){n.innerHTML=e.innerHTML;for(var r=n.getElementsByTagName("script"),i=r.length;0>"),this.internal.out("endobj"),w=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+b+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){void 0!==v&&void 0!==w&&this.internal.out("/Names <>")}),this},( /** * @license * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv @@ -123,7 +130,7 @@ g=At.API,m="undefined"!=typeof window&&window||"undefined"!=typeof global&&globa * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ -L=At.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0> endobj")}var c=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r>","endobj"),t.internal.newObject(),t.internal.write("<< /Dests "+c+" 0 R"),t.internal.write(">>","endobj")}}]),L.events.push(["putCatalog",function(){0> \r\nendobj\r\n"},a.outline.count_r=function(t,e){for(var n=0;n> endobj")}var h=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r>","endobj"),t.internal.newObject(),t.internal.write("<< /Dests "+h+" 0 R"),t.internal.write(">>","endobj")}}]),x.events.push(["putCatalog",function(){0> \r\nendobj\r\n"},a.outline.count_r=function(t,e){for(var n=0;n>>24&255,f[c++]=s>>>16&255,f[c++]=s>>>8&255,f[c++]=255&s,I.arrayBufferToBinaryString(f)},A=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},S=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0>>0},j=function(t,e,n,r){for(var i,o,a,s=t.length/e,l=new Uint8Array(t.length+s),h=D(),u=0;u>>1)&255;return o},q=function(t,e,n){var r,i,o,a,s=[],l=0,h=t.length;for(s[0]=4;l>>p&255,p+=o.bits;y[w]=x>>>p&255}if(16===o.bits){g=(_=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),y=new Uint8Array(g*(32/o.pixelBitlength));for(var x,N=1>>0&255,N&&(m[b++]=x>>>16&255,x=_[w++],m[b++]=x>>>0&255),y[L++]=x>>>16&255;d=8}r!==I.image_compression.NONE&&C()?(t=B(m,o.width*o.colors,o.colors,r),u=B(y,o.width,1,r)):(t=m,u=y,f=null)}if(3===o.colorType&&(c=this.color_spaces.INDEXED,h=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,S=0;for(w=0,g=A.length;w>>24&255,f[h++]=s>>>16&255,f[h++]=s>>>8&255,f[h++]=255&s,I.arrayBufferToBinaryString(f)},N=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},L=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0>>0},A=function(t,e,n,r){for(var i,o,a,s=t.length/e,l=new Uint8Array(t.length+s),u=T(),c=0;c>>1)&255;return o},M=function(t,e,n){var r,i,o,a,s=[],l=0,u=t.length;for(s[0]=4;l>>d&255,d+=o.bits;y[w]=x>>>d&255}if(16===o.bits){g=(_=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),y=new Uint8Array(g*(32/o.pixelBitlength));for(var x,N=1>>0&255,N&&(m[b++]=x>>>16&255,x=_[w++],m[b++]=x>>>0&255),y[L++]=x>>>16&255;p=8}r!==I.image_compression.NONE&&C()?(t=B(m,o.width*o.colors,o.colors,r),c=B(y,o.width,1,r)):(t=m,c=y,f=null)}if(3===o.colorType&&(h=this.color_spaces.INDEXED,u=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,S=0;for(w=0,g=A.length;wr&&(i.push(t.slice(l,o)),s=0,l=o),s+=e[o],o++;return l!==o&&i.push(t.slice(l,o)),i},K=function(t,e,n){n||(n={});var r,i,o,a,s,l,h=[],u=[h],c=n.textIndent||0,f=0,d=0,p=t.split(" "),g=G.apply(this,[" ",n])[0];if(l=-1===n.lineIndent?p[0].length+2:n.lineIndent||0){var m=Array(l).join(" "),y=[];p.map(function(t){1<(t=t.split(/\s*\n/)).length?y=y.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):y.push(t[0])}),p=y,l=J.apply(this,[m,n])}for(o=0,a=p.length;or&&(i.push(t.slice(l,o)),s=0,l=o),s+=e[o],o++;return l!==o&&i.push(t.slice(l,o)),i},J=function(t,e,n){n||(n={});var r,i,o,a,s,l,u=[],c=[u],h=n.textIndent||0,f=0,p=0,d=t.split(" "),g=W.apply(this,[" ",n])[0];if(l=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var m=Array(l).join(" "),y=[];d.map(function(t){1<(t=t.split(/\s*\n/)).length?y=y.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):y.push(t[0])}),d=y,l=G.apply(this,[m,n])}for(o=0,a=d.length;o>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this}, +et=lt.API).addSvg=function(t,e,n,r,i){if(void 0===e||void 0===n)throw new Error("addSVG needs values for 'x' and 'y'");function o(t){for(var e=parseFloat(t[1]),n=parseFloat(t[2]),r=[],i=3,o=t.length;i>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this}, /** ==================================================================== * jsPDF XMP metadata plugin * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi @@ -185,7 +192,7 @@ rt=At.API).addSvg=function(t,e,n,r,i){if(void 0===e||void 0===n)throw new Error( * * ==================================================================== */ -it=At.API,st=at=ot="",it.addMetadata=function(t,e){return at=e||"http://jspdf.default.namespaceuri/",ot=t,this.internal.events.subscribe("postPutResources",function(){if(ot){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(ot)),i=unescape(encodeURIComponent("")),o=unescape(encodeURIComponent("")),a=n.length+r.length+i.length+e.length+o.length;st=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else st=""}),this.internal.events.subscribe("putCatalog",function(){st&&this.internal.write("/Metadata "+st+" 0 R")}),this},function(f,t){var e=f.API;var m=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"Identity-H"===t.encoding){for(var i=t.metadata.Unicode.widths,o=t.metadata.subset.encode(t.metadata.glyIdsUsed,1),a="",s=0;s>"),e("endobj");var c=n();e("<<"),e("/Type /Font"),e("/BaseFont /"+t.fontName),e("/FontDescriptor "+u+" 0 R"),e("/W "+f.API.PDFObject.convert(i)),e("/CIDToGIDMap /Identity"),e("/DW 1000"),e("/Subtype /CIDFontType2"),e("/CIDSystemInfo"),e("<<"),e("/Supplement 0"),e("/Registry (Adobe)"),e("/Ordering ("+t.encoding+")"),e(">>"),e(">>"),e("endobj"),t.objectNumber=n(),e("<<"),e("/Type /Font"),e("/Subtype /Type0"),e("/ToUnicode "+h+" 0 R"),e("/BaseFont /"+t.fontName),e("/Encoding /"+t.encoding),e("/DescendantFonts ["+c+" 0 R]"),e(">>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"WinAnsiEncoding"===t.encoding){t.metadata.Unicode.widths;for(var i=t.metadata.rawData,o="",a=0;a>"),e("endobj"),t.objectNumber=n(),a=0;a>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);var h=function(t){var e,n,r=t.text||"",i=t.x,o=t.y,a=t.options||{},s=t.mutex||{},l=s.pdfEscape,h=s.activeFontKey,u=s.fonts,c=(s.activeFontSize,""),f=0,d="",p=u[n=h].encoding;if("Identity-H"!==u[n].encoding)return{text:r,x:i,y:o,options:a,mutex:s};for(d=r,n=h,"[object Array]"===Object.prototype.toString.call(r)&&(d=r[0]),f=0;fw-h.top-h.bottom&&s.pagesplit){var d=function(t,e,n,r,i){var o=document.createElement("canvas");o.height=i,o.width=r;var a=o.getContext("2d");return a.mozImageSmoothingEnabled=!1,a.webkitImageSmoothingEnabled=!1,a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,a.fillStyle=s.backgroundColor||"#ffffff",a.fillRect(0,0,r,i),a.drawImage(t,e,n,r,i,0,0,r,i),o},n=function(){for(var t,e,n=0,r=0,i={},o=!1;;){var a;if(r=0,i.top=0!==n?h.top:g,i.left=0!==n?h.left:p,o=(v-h.left-h.right)*y=l.width)break;this.addPage()}else s=[a=d(l,0,n,t,e),i.left,i.top,a.width/y,a.height/y,c,null,f],this.addImage.apply(this,s);if((n+=e)>=l.height)break;this.addPage()}m(u,n,null,s)}.bind(this);if("CANVAS"===l.nodeName){var r=new Image;r.onload=n,r.src=l.toDataURL("image/png"),l=r}else n()}else{var i=Math.random().toString(35),o=[l,p,g,u,e,c,i,f];this.addImage.apply(this,o),m(u,e,i,o)}}.bind(this),"undefined"!=typeof html2canvas&&!s.rstz)return html2canvas(t,s);if("undefined"==typeof rasterizeHTML)return null;var n="drawDocument";return"string"==typeof t&&(n=/^http/.test(t)?"drawURL":"drawHTML"),s.width=s.width||v*y,rasterizeHTML[n](t,void 0,s).then(function(t){s.onrendered(t.image)},function(t){m(null,t)})}, +nt=lt.API,ot=it=rt="",nt.addMetadata=function(t,e){return it=e||"http://jspdf.default.namespaceuri/",rt=t,this.internal.events.subscribe("postPutResources",function(){if(rt){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(rt)),i=unescape(encodeURIComponent("")),o=unescape(encodeURIComponent("")),a=n.length+r.length+i.length+e.length+o.length;ot=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else ot=""}),this.internal.events.subscribe("putCatalog",function(){ot&&this.internal.write("/Metadata "+ot+" 0 R")}),this},function(f,t){var e=f.API;var m=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"Identity-H"===t.encoding){for(var i=t.metadata.Unicode.widths,o=t.metadata.subset.encode(t.metadata.glyIdsUsed,1),a="",s=0;s>"),e("endobj");var h=n();e("<<"),e("/Type /Font"),e("/BaseFont /"+t.fontName),e("/FontDescriptor "+c+" 0 R"),e("/W "+f.API.PDFObject.convert(i)),e("/CIDToGIDMap /Identity"),e("/DW 1000"),e("/Subtype /CIDFontType2"),e("/CIDSystemInfo"),e("<<"),e("/Supplement 0"),e("/Registry (Adobe)"),e("/Ordering ("+t.encoding+")"),e(">>"),e(">>"),e("endobj"),t.objectNumber=n(),e("<<"),e("/Type /Font"),e("/Subtype /Type0"),e("/ToUnicode "+u+" 0 R"),e("/BaseFont /"+t.fontName),e("/Encoding /"+t.encoding),e("/DescendantFonts ["+h+" 0 R]"),e(">>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"WinAnsiEncoding"===t.encoding){t.metadata.Unicode.widths;for(var i=t.metadata.rawData,o="",a=0;a>"),e("endobj"),t.objectNumber=n(),a=0;a>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);var u=function(t){var e,n,r=t.text||"",i=t.x,o=t.y,a=t.options||{},s=t.mutex||{},l=s.pdfEscape,u=s.activeFontKey,c=s.fonts,h=(s.activeFontSize,""),f=0,p="",d=c[n=u].encoding;if("Identity-H"!==c[n].encoding)return{text:r,x:i,y:o,options:a,mutex:s};for(p=r,n=u,"[object Array]"===Object.prototype.toString.call(r)&&(p=r[0]),f=0;fw-u.top-u.bottom&&s.pagesplit){var p=function(t,e,n,r,i){var o=document.createElement("canvas");o.height=i,o.width=r;var a=o.getContext("2d");return a.mozImageSmoothingEnabled=!1,a.webkitImageSmoothingEnabled=!1,a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,a.fillStyle=s.backgroundColor||"#ffffff",a.fillRect(0,0,r,i),a.drawImage(t,e,n,r,i,0,0,r,i),o},n=function(){for(var t,e,n=0,r=0,i={},o=!1;;){var a;if(r=0,i.top=0!==n?u.top:g,i.left=0!==n?u.left:d,o=(v-u.left-u.right)*y=l.width)break;this.addPage()}else s=[a=p(l,0,n,t,e),i.left,i.top,a.width/y,a.height/y,h,null,f],this.addImage.apply(this,s);if((n+=e)>=l.height)break;this.addPage()}m(c,n,null,s)}.bind(this);if("CANVAS"===l.nodeName){var r=new Image;r.onload=n,r.src=l.toDataURL("image/png"),l=r}else n()}else{var i=Math.random().toString(35),o=[l,d,g,c,e,h,i,f];this.addImage.apply(this,o),m(c,e,i,o)}}.bind(this),"undefined"!=typeof html2canvas&&!s.rstz)return html2canvas(t,s);if("undefined"==typeof rasterizeHTML)return null;var n="drawDocument";return"string"==typeof t&&(n=/^http/.test(t)?"drawURL":"drawHTML"),s.width=s.width||v*y,rasterizeHTML[n](t,void 0,s).then(function(t){s.onrendered(t.image)},function(t){m(null,t)})}, /** * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com @@ -199,7 +206,13 @@ it=At.API,st=at=ot="",it.addMetadata=function(t,e){return at=e||"http://jspdf.de * * ==================================================================== */ -function(t){var P,k,i,a,s,l,h,u,I,w,f,c,d,n,C,B,p,g,m,j;P=function(){return function(t){return e.prototype=t,new e};function e(){}}(),w=function(t){var e,n,r,i,o,a,s;for(n=0,r=t.length,e=void 0,a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0),n--;for(o=/\s+$/g,s=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},c=function(t){var e,n,r;for(e=void 0,n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},d=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),-1i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(n));var b=I(n),x=i.x,N=12/i.pdf.internal.scaleFactor,L=(b["margin-left"]+b["padding-left"])*N,A=(b["margin-right"]+b["padding-right"])*N,S=(b["margin-top"]+b["padding-top"])*N,_=(b["margin-bottom"]+b["padding-bottom"])*N;void 0!==b.float&&"right"===b.float?x+=i.settings.width-n.width-A:x+=L,i.pdf.addImage(v,x,i.y+S,n.width,n.height),v=void 0,"right"===b.float||"left"===b.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!E[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===b.float?-n.width-L-A:0,i.y+n.height+S+_,n.width)),i.watchFunctions.push(function(t,e,n){return!(i.y]*?>/gi,""),h="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(l=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",l.innerHTML='',i=ie.open();if(null!==i&&i.document.write(r),i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return ie.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return F.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!ie.console)throw new Error(n);ie.console.error(n,t),ie.alert&&alert(n)}},(F.foo.bar=F).foo),Bt=function(t){return!0===Array.isArray(Y)&&-1":")"),Y=1):(W=Wt(e),V=Vt(n),G=(u?"<":"(")+v[H]+(u?">":")")),void 0!==O&&void 0!==O[H]&&(J=O[H]+" Tw\n"),0!==S.length&&0===H?t.push(J+S.join(" ")+" "+W.toFixed(2)+" "+V.toFixed(2)+" Tm\n"+G):1===Y||0===Y&&0===H?t.push(J+W.toFixed(2)+" "+V.toFixed(2)+" Td\n"+G):t.push(J+G);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var X="BT\n/"+$+" "+et+" Tf\n"+(et*l).toFixed(2)+" TL\n"+Kt+"\n";return X+=c,X+=t,tt(X+="ET"),K[$]=!0,h},u.__private__.lstext=u.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},u.__private__.clip=u.clip=function(t){tt("evenodd"===t?"W*":"W"),tt("n")},u.__private__.clip_fixed=u.clip_fixed=function(t){console.log("clip_fixed is deprecated"),u.clip(t)};var Mt=u.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},Ot=u.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};u.__private__.line=u.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},u.__private__.lines=u.lines=function(t,e,n,r,i,o){var s,a,u,c,l,h,f,p,d,g,m,y;if("number"==typeof t&&(y=n,n=e,e=t,t=y),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Mt(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(tt(Q(Wt(e))+" "+Q(Vt(n))+" m "),s=r[0],a=r[1],c=t.length,g=e,m=n,u=0;u>16&255,r=u>>8&255,i=255&u}if(void 0===r||void 0===o&&n===r&&r===i)if("string"==typeof n)e=n+" "+s[0];else switch(t.precision){case 2:e=Z(n/255)+" "+s[0];break;case 3:default:e=Q(n/255)+" "+s[0]}else if(void 0===o||"object"===_typeof(o)){if(o&&!isNaN(o.a)&&0===o.a)return e=["1.000","1.000","1.000",s[1]].join(" ");if("string"==typeof n)e=[n,r,i,s[1]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),s[1]].join(" ");break;default:case 3:e=[Q(n/255),Q(r/255),Q(i/255),s[1]].join(" ")}}else if("string"==typeof n)e=[n,r,i,o,s[2]].join(" ");else switch(t.precision){case 2:e=[Z(n/255),Z(r/255),Z(i/255),Z(o/255),s[2]].join(" ");break;case 3:default:e=[Q(n/255),Q(r/255),Q(i/255),Q(o/255),s[2]].join(" ")}return e},lt=u.__private__.getFilters=function(){return o},ft=u.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||lt(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,o=e.length,s={};!0===n&&(n=["FlateEncode"]);var a=t.additionalKeyValues||[],u=(s=void 0!==se.API.processDataByFilters?se.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());0!==s.data.length&&(a.push({key:"Length",value:s.data.length}),!0===i&&a.push({key:"Length1",value:o})),0!=u.length&&(u.split("/").length-1==1?a.push({key:"Filter",value:u}):a.push({key:"Filter",value:"["+u+"]"})),tt("<<");for(var h=0;h>"),0!==s.data.length&&(tt("stream"),tt(s.data),tt("endstream"))},pt=u.__private__.putPage=function(t){t.mediaBox;var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;ot(r,!0);V[N].mediaBox.topRightX,V[N].mediaBox.bottomLeftX,V[N].mediaBox.topRightY,V[N].mediaBox.bottomLeftY;tt("<>"),tt("endobj");var o=n.join("\n");return ot(i,!0),ft({data:o,filters:lt()}),tt("endobj"),r},dt=u.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=W;t++)V[t].objId=X(),V[t].contentsObjId=X();for(t=1;t<=W;t++)n.push(pt({number:t,data:I[t],objId:V[t].objId,contentsObjId:V[t].contentsObjId,mediaBox:V[t].mediaBox,cropBox:V[t].cropBox,bleedBox:V[t].bleedBox,trimBox:V[t].trimBox,artBox:V[t].artBox,userUnit:V[t].userUnit,rootDictionaryObjId:at,resourceDictionaryObjId:ut}));ot(at,!0),tt("<>"),tt("endobj"),it.publish("postPutPages")},gt=function(){!function(){for(var t in rt)rt.hasOwnProperty(t)&&(!1===a||!0===a&&K.hasOwnProperty(t))&&(e=rt[t],it.publish("putFont",{font:e,out:tt,newObject:J,putStream:ft}),!0!==e.isAlreadyPutted&&(e.objectNumber=J(),tt("<<"),tt("/Type /Font"),tt("/BaseFont /"+e.postScriptName),tt("/Subtype /Type1"),"string"==typeof e.encoding&&tt("/Encoding /"+e.encoding),tt("/FirstChar 32"),tt("/LastChar 255"),tt(">>"),tt("endobj")));var e}(),it.publish("putResources"),ot(ut,!0),tt("<<"),function(){for(var t in tt("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),tt("/Font <<"),rt)rt.hasOwnProperty(t)&&(!1===a||!0===a&&K.hasOwnProperty(t))&&tt("/"+t+" "+rt[t].objectNumber+" 0 R");tt(">>"),tt("/XObject <<"),it.publish("putXobjectDict"),tt(">>")}(),tt(">>"),tt("endobj"),it.publish("postPutResources")},mt=function(t,e,n){H.hasOwnProperty(e)||(H[e]={}),H[e][n]=t},yt=function(t,e,n,r,i){i=i||!1;var o="F"+(Object.keys(rt).length+1).toString(10),s={id:o,postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i,metadata:{}};return it.publish("addFont",{font:s,instance:this}),void 0!==o&&(rt[o]=s,mt(o,e,n)),o},vt=u.__private__.pdfEscape=u.pdfEscape=function(t,e){return function(t,e){var n,r,i,o,s,a,u,h,c;if(i=(e=e||{}).sourceEncoding||"Unicode",s=e.outputEncoding,(e.autoencode||s)&&rt[$].metadata&&rt[$].metadata[i]&&rt[$].metadata[i].encoding&&(o=rt[$].metadata[i].encoding,!s&&rt[$].encoding&&(s=rt[$].encoding),!s&&o.codePages&&(s=o.codePages[0]),"string"==typeof s&&(s=o[s]),s)){for(u=!1,a=[],n=0,r=t.length;n>8&&(u=!0);t=a.join("")}for(n=t.length;void 0===u&&0!==n;)t.charCodeAt(n-1)>>8&&(u=!0),n--;if(!u)return t;for(a=e.noBOM?[]:[254,255],n=0,r=t.length;n>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(c),a.push(h-(c<<8))}return String.fromCharCode.apply(void 0,a)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},wt=u.__private__.beginPage=function(t,e){var n,r="string"==typeof e&&e.toLowerCase();if("string"==typeof t&&f(t.toLowerCase())&&(t=f(t.toLowerCase())[0],e=f(t.toLowerCase())[1]),Array.isArray(t)&&(e=t[1],t=t[0]),(isNaN(t)||isNaN(e))&&(t=i[0],e=i[1]),r){switch(r.substr(0,1)){case"l":t>"),tt("endobj")},St=u.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||at;switch(J(),tt("<<"),tt("/Type /Catalog"),tt("/Pages "+e+" 0 R"),x||(x="fullwidth"),x){case"fullwidth":tt("/OpenAction [3 0 R /FitH null]");break;case"fullheight":tt("/OpenAction [3 0 R /FitV null]");break;case"fullpage":tt("/OpenAction [3 0 R /Fit]");break;case"original":tt("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+x;"%"===n.substr(n.length-1)&&(x=parseInt(x)/100),"number"==typeof x&&tt("/OpenAction [3 0 R /XYZ null null "+Z(x)+"]")}switch(S||(S="continuous"),S){case"continuous":tt("/PageLayout /OneColumn");break;case"single":tt("/PageLayout /SinglePage");break;case"two":case"twoleft":tt("/PageLayout /TwoColumnLeft");break;case"tworight":tt("/PageLayout /TwoColumnRight")}A&&tt("/PageMode /"+A),it.publish("putCatalog"),tt(">>"),tt("endobj")},_t=u.__private__.putTrailer=function(){tt("trailer"),tt("<<"),tt("/Size "+(z+1)),tt("/Root "+z+" 0 R"),tt("/Info "+(z-1)+" 0 R"),tt("/ID [ <"+d+"> <"+d+"> ]"),tt(">>")},Pt=u.__private__.putHeader=function(){tt("%PDF-"+h),tt("%ºß¬à")},Ft=u.__private__.putXRef=function(){var t=1,e="0000000000";for(tt("xref"),tt("0 "+(z+1)),tt("0000000000 65535 f "),t=1;t<=z;t++){"function"==typeof U[t]?tt((e+U[t]()).slice(-10)+" 00000 n "):void 0!==U[t]?tt((e+U[t]).slice(-10)+" 00000 n "):tt("0000000000 00000 n ")}},kt=u.__private__.buildDocument=function(){k=!1,B=z=0,C=[],U=[],G=[],at=X(),ut=X(),it.publish("buildDocument"),Pt(),dt(),function(){it.publish("putAdditionalObjects");for(var t=0;t',i=ie.open();if(null!==i&&i.document.write(r),i||"undefined"==typeof safari)return i;case"datauri":case"dataurl":return ie.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return P.apply(this,arguments)}catch(t){var e=t.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var n="Error in function "+e.split("\n")[0].split("<")[0]+": "+t.message;if(!ie.console)throw new Error(n);ie.console.error(n,t),ie.alert&&alert(n)}},(P.foo.bar=P).foo),Bt=function(t){return!0===Array.isArray(Y)&&-1":")"),Y=1):(W=Wt(e),V=Vt(n),G=(u?"<":"(")+v[H]+(u?">":")")),void 0!==D&&void 0!==D[H]&&(J=D[H]+" Tw\n"),0!==S.length&&0===H?t.push(J+S.join(" ")+" "+W.toFixed(2)+" "+V.toFixed(2)+" Tm\n"+G):1===Y||0===Y&&0===H?t.push(J+W.toFixed(2)+" "+V.toFixed(2)+" Td\n"+G):t.push(J+G);t=0===Y?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var X="BT\n/"+$+" "+et+" Tf\n"+(et*c).toFixed(2)+" TL\n"+Kt+"\n";return X+=h,X+=t,tt(X+="ET"),K[$]=!0,l},u.__private__.lstext=u.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},u.__private__.clip=u.clip=function(t){tt("evenodd"===t?"W*":"W"),tt("n")},u.__private__.clip_fixed=u.clip_fixed=function(t){console.log("clip_fixed is deprecated"),u.clip(t)};var Mt=u.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},Dt=u.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};u.__private__.line=u.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},u.__private__.lines=u.lines=function(t,e,n,r,i,o){var s,a,u,h,c,l,f,p,d,g,m,y;if("number"==typeof t&&(y=n,n=e,e=t,t=y),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Mt(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(tt(Q(Wt(e))+" "+Q(Vt(n))+" m "),s=r[0],a=r[1],h=t.length,g=e,m=n,u=0;u>8&255),G(255&t)}function J(t,e,n,r,i){for(var o,s=i[0],a=i[240],u=function(t,e){var n,r,i,o,s,a,u,h,c,l,f=0;for(c=0;c<8;++c){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],s=t[f+4],a=t[f+5],u=t[f+6];var p=n+(h=t[f+7]),d=n-h,g=r+u,m=r-u,y=i+a,v=i-a,w=o+s,b=o-s,N=p+w,L=p-w,x=g+y,A=g-y;t[f]=N+x,t[f+4]=N-x;var S=.707106781*(A+L);t[f+2]=L+S,t[f+6]=L-S;var _=.382683433*((N=b+v)-(A=m+d)),P=.5411961*N+_,F=1.306562965*A+_,k=.707106781*(x=v+m),I=d+k,C=d-k;t[f+5]=C+P,t[f+3]=C-P,t[f+1]=I+F,t[f+7]=I-F,f+=8}for(c=f=0;c<8;++c){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],s=t[f+32],a=t[f+40],u=t[f+48];var B=n+(h=t[f+56]),j=n-h,q=r+u,E=r-u,M=i+a,D=i-a,O=o+s,T=o-s,R=B+O,z=B-O,U=q+M,H=q-M;t[f]=R+U,t[f+32]=R-U;var W=.707106781*(H+z);t[f+16]=z+W,t[f+48]=z-W;var V=.382683433*((R=T+D)-(H=E+j)),G=.5411961*R+V,Y=1.306562965*H+V,J=.707106781*(U=D+E),X=j+J,K=j-J;t[f+40]=K+G,t[f+24]=K-G,t[f+8]=X+Y,t[f+56]=X-Y,f++}for(c=0;c<64;++c)l=t[c]*e[c],Z[c]=0>4;for(var m=1;m<=f;++m)V(a);g&=15}o=32767+w[p],V(i[(g<<4)+v[o]]),V(y[o]),p++}return 63!=l&&V(s),n}function X(t){if(t<=0&&(t=1),100>3)*w+(p=4*(7&g)),v<=b+d&&(f-=w*(b+1+d-v)),w<=a+p&&(f-=a+p-w+4),u=m[f++],h=m[f++],c=m[f++],j[g]=(M[u]+M[h+256>>0]+M[c+512>>0]>>16)-128,q[g]=(M[u+768>>0]+M[h+1024>>0]+M[c+1280>>0]>>16)-128,E[g]=(M[u+1280>>0]+M[h+1536>>0]+M[c+1792>>0]>>16)-128;i=J(j,F,i,L,A),o=J(q,k,o,x,S),s=J(E,k,s,x,S),a+=32}b+=8}if(0<=B){var N=[];N[1]=B+1,N[0]=(1<>0]=38470*t,M[t+512>>0]=7471*t+32768,M[t+768>>0]=-11059*t,M[t+1024>>0]=-21709*t,M[t+1280>>0]=32768*t+8421375,M[t+1536>>0]=-27439*t,M[t+1792>>0]=-5329*t}(),X(t),(new Date).getTime()}()} /** * @license * Copyright (c) 2016 Alexander Weidt, @@ -67,7 +41,7 @@ function JPEGEncoder(t){var L,x,A,S,e,l=Math.floor,_=new Array(64),P=new Array(6 * * Licensed under the MIT License. http://opensource.org/licenses/mit-license */ -(function(t,e){var A,n=1,S=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},y=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},_=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(2)},a=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(5)};t.__acroform__={};var r=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},v=function(t){return t*n},w=function(t){return t/n},u=function(t){var e=new j,n=Y.internal.getHeight(t)||0,r=Y.internal.getWidth(t)||0;return e.BBox=[0,0,Number(_(r)),Number(_(n))],e},i=t.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|=1<=o.length-1;if(b&&!N){m+=" ";continue}if(b||N){if(N)d=w;else if(i.multiline&&s<(h+2)*(y+2)+2)continue t}else{if(!i.multiline)continue t;if(s<(h+2)*(y+2)+2)continue t;d=w}for(var L="",x=p;x<=d;x++)L+=o[x]+" ";switch(L=" "==L.substr(L.length-1)?L.substr(0,L.length-1):L,g=P(L,i,r).width,i.textAlign){case"right":l=a-g-2;break;case"center":l=(a-g)/2;break;case"left":default:l=2}t+=_(l)+" "+_(f)+" Td\n",t+="("+S(L)+") Tj\n",t+=-_(l)+" 0 Td\n",f=-(r+2),g=0,p=d+1,y++,m=""}else;break}return n.text=t,n.fontSize=r,n},P=function(t,e,n){var r=A.internal.getFont(e.fontName,e.fontStyle),i=A.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:A.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},c={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){A.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=A.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&d.call(A,n)}},d=function(t){var e={type:"reference",object:t};void 0===A.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&A.internal.getPageInfo(t.page).pageContext.annotations.push(e)},g=function(){if(void 0===A.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");A.internal.write("/AcroForm "+A.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},m=function(){A.internal.events.unsubscribe(A.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete A.internal.acroformPlugin.acroFormDictionaryRoot._eventID,A.internal.acroformPlugin.printedOut=!0},x=function(t){var e=!t;t||(A.internal.newObjectDeferredBegin(A.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),A.internal.acroformPlugin.acroFormDictionaryRoot.putStream());t=t||A.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=[],o=r.Rect;if(r.Rect&&(r.Rect=l.call(this,r.Rect)),A.internal.newObjectDeferredBegin(r.objId,!0),r.DA=Y.createDefaultAppearanceStream(r),"object"===_typeof(r)&&"function"==typeof r.getKeyValueListForStream&&(i=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var s=f.call(this,r);i.push({key:"AP",value:"<>"}),A.internal.acroformPlugin.xForms.push(s)}if(r.appearanceStreamContent){var a="";for(var u in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(u)){var h=r.appearanceStreamContent[u];if(a+="/"+u+" ",a+="<<",1<=Object.keys(h).length||Array.isArray(h))for(var n in h){var c;if(h.hasOwnProperty(n))"function"==typeof(c=h[n])&&(c=c.call(this,r)),a+="/"+n+" "+c+" ",0<=A.internal.acroformPlugin.xForms.indexOf(c)||A.internal.acroformPlugin.xForms.push(c)}else"function"==typeof(c=h)&&(c=c.call(this,r)),a+="/"+n+" "+c,0<=A.internal.acroformPlugin.xForms.indexOf(c)||A.internal.acroformPlugin.xForms.push(c);a+=">>"}i.push({key:"AP",value:"<<\n"+a+">>"})}A.internal.putStream({additionalKeyValues:i}),A.internal.out("endobj")}e&&F.call(this,A.internal.acroformPlugin.xForms)},F=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];A.internal.newObjectDeferredBegin(r&&r.objId,!0),"object"===_typeof(r)&&"function"==typeof r.putStream&&r.putStream(),delete t[n]}},k=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(A=this,E.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(c)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");n=A.internal.scaleFactor,A.internal.acroformPlugin.acroFormDictionaryRoot=new q,A.internal.acroformPlugin.acroFormDictionaryRoot._eventID=A.internal.events.subscribe("postPutResources",m),A.internal.events.subscribe("buildDocument",p),A.internal.events.subscribe("putCatalog",g),A.internal.events.subscribe("postPutPages",x),A.internal.acroformPlugin.isInitialized=!0}},I=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n>"),e.join("\n")}},set:function(t){"object"===_typeof(t)&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){"string"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};r(R,E);var z=function(){R.call(this),this.pushButton=!0};r(z,R);var U=function(){R.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};r(U,R);var H=function(){var e,n;E.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var r,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),i)e.push("/"+t+" ("+i[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===_typeof(t)&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(t){r="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=Y.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};r(H,E),U.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t&&"getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},U.prototype.createOption=function(t){this.Kids.length;var e=new H;return e.Parent=this,e.optionName=t,this.Kids.push(e),J.call(this,e),e};var W=function(){R.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Y.CheckBox.createAppearanceStream()};r(W,R);var V=function(){E.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,13):this.Ff=L(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,21):this.Ff=L(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,23):this.Ff=L(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,24):this.Ff=L(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,25):this.Ff=L(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,26):this.Ff=L(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};r(V,E);var G=function(){V.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,14):this.Ff=L(this.Ff,14)}}),this.password=!0};r(G,V);var Y={CheckBox:{createAppearanceStream:function(){return{N:{On:Y.CheckBox.YesNormal},D:{On:Y.CheckBox.YesPushDown,Off:Y.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=u(t),n=[],r=A.internal.getFont(t.fontName,t.fontStyle).id,i=A.__private__.encodeColorString(t.color),o=h(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+_(o.fontSize)+" Tf "+i),n.push("BT"),n.push(o.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=u(t),n=A.internal.getFont(t.fontName,t.fontStyle).id,r=A.__private__.encodeColorString(t.color),i=[],o=Y.internal.getHeight(t),s=Y.internal.getWidth(t),a=h(t,t.caption);return i.push("1 g"),i.push("0 0 "+_(s)+" "+_(o)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+_(s-1)+" "+_(o-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+_(a.fontSize)+" Tf "+r),i.push(a.text),i.push("ET"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=u(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Circle.YesNormal,e.D[t]=Y.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=u(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Y.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+a(Y.internal.getWidth(t)/2)+" "+a(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=u(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5)),s=Number((r*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+a(Y.internal.getWidth(t)/2)+" "+a(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+a(Y.internal.getWidth(t)/2)+" "+a(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=u(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+a(Y.internal.getWidth(t)/2)+" "+a(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Cross.YesNormal,e.D[t]=Y.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=u(t),n=[],r=Y.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(_(r.x1.x)+" "+_(r.x1.y)+" m"),n.push(_(r.x2.x)+" "+_(r.x2.y)+" l"),n.push(_(r.x4.x)+" "+_(r.x4.y)+" m"),n.push(_(r.x3.x)+" "+_(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=u(t),n=Y.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(_(n.x1.x)+" "+_(n.x1.y)+" m"),r.push(_(n.x2.x)+" "+_(n.x2.y)+" l"),r.push(_(n.x4.x)+" "+_(n.x4.y)+" m"),r.push(_(n.x3.x)+" "+_(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=u(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=A.internal.getFont(t.fontName,t.fontStyle).id,n=A.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};Y.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Y.internal.getWidth(t),n=Y.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},Y.internal.getWidth=function(t){var e=0;return"object"===_typeof(t)&&(e=v(t.Rect[2])),e},Y.internal.getHeight=function(t){var e=0;return"object"===_typeof(t)&&(e=v(t.Rect[3])),e};var J=t.addField=function(t){if(k.call(this),!(t instanceof E))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){A.internal.acroformPlugin.printedOut&&(A.internal.acroformPlugin.printedOut=!1,A.internal.acroformPlugin.acroFormDictionaryRoot=null),A.internal.acroformPlugin.acroFormDictionaryRoot||k.call(A),A.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=A.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof R==!1)throw new Error("Invalid argument passed to jsPDF.addButton.");return J.call(this,t)},t.addTextField=function(t){if(t instanceof V==!1)throw new Error("Invalid argument passed to jsPDF.addTextField.");return J.call(this,t)},t.addChoiceField=function(t){if(t instanceof M==!1)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return J.call(this,t)};"object"==_typeof(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=M,e.ListBox=D,e.ComboBox=O,e.EditBox=T,e.Button=R,e.PushButton=z,e.RadioButton=U,e.CheckBox=W,e.TextField=V,e.PasswordField=G,e.AcroForm={Appearance:Y}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=M,t.AcroFormListBox=D,t.AcroFormComboBox=O,t.AcroFormEditBox=T,t.AcroFormButton=R,t.AcroFormPushButton=z,t.AcroFormRadioButton=U,t.AcroFormCheckBox=W,t.AcroFormTextField=V,t.AcroFormPasswordField=G,t.AcroFormAppearance=Y,t.AcroForm={ChoiceField:M,ListBox:D,ComboBox:O,EditBox:T,Button:R,PushButton:z,RadioButton:U,CheckBox:W,TextField:V,PasswordField:G,Appearance:Y}})((window.tmp=jsPDF).API,"undefined"!=typeof window&&window||"undefined"!=typeof global&&global), +!function(t,e){var A,n=1,S=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},y=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},_=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(2)},a=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return t.toFixed(5)};t.__acroform__={};var r=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},v=function(t){return t*n},w=function(t){return t/n},u=function(t){var e=new j,n=Y.internal.getHeight(t)||0,r=Y.internal.getWidth(t)||0;return e.BBox=[0,0,Number(_(r)),Number(_(n))],e},i=t.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|=1<=o.length-1;if(b&&!N){m+=" ";continue}if(b||N){if(N)d=w;else if(i.multiline&&s<(c+2)*(y+2)+2)continue t}else{if(!i.multiline)continue t;if(s<(c+2)*(y+2)+2)continue t;d=w}for(var L="",x=p;x<=d;x++)L+=o[x]+" ";switch(L=" "==L.substr(L.length-1)?L.substr(0,L.length-1):L,g=F(L,i,r).width,i.textAlign){case"right":h=a-g-2;break;case"center":h=(a-g)/2;break;case"left":default:h=2}t+=_(h)+" "+_(f)+" Td\n",t+="("+S(L)+") Tj\n",t+=-_(h)+" 0 Td\n",f=-(r+2),g=0,p=d+1,y++,m=""}else;break}return n.text=t,n.fontSize=r,n},F=function(t,e,n){var r=A.internal.getFont(e.fontName,e.fontStyle),i=A.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:A.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},l={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){A.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=A.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&d.call(A,n)}},d=function(t){var e={type:"reference",object:t};void 0===A.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&A.internal.getPageInfo(t.page).pageContext.annotations.push(e)},g=function(){if(void 0===A.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");A.internal.write("/AcroForm "+A.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},m=function(){A.internal.events.unsubscribe(A.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete A.internal.acroformPlugin.acroFormDictionaryRoot._eventID,A.internal.acroformPlugin.printedOut=!0},x=function(t){var e=!t;t||(A.internal.newObjectDeferredBegin(A.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),A.internal.acroformPlugin.acroFormDictionaryRoot.putStream());t=t||A.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=[],o=r.Rect;if(r.Rect&&(r.Rect=h.call(this,r.Rect)),A.internal.newObjectDeferredBegin(r.objId,!0),r.DA=Y.createDefaultAppearanceStream(r),"object"===_typeof(r)&&"function"==typeof r.getKeyValueListForStream&&(i=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var s=f.call(this,r);i.push({key:"AP",value:"<>"}),A.internal.acroformPlugin.xForms.push(s)}if(r.appearanceStreamContent){var a="";for(var u in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(u)){var c=r.appearanceStreamContent[u];if(a+="/"+u+" ",a+="<<",1<=Object.keys(c).length||Array.isArray(c))for(var n in c){var l;if(c.hasOwnProperty(n))"function"==typeof(l=c[n])&&(l=l.call(this,r)),a+="/"+n+" "+l+" ",0<=A.internal.acroformPlugin.xForms.indexOf(l)||A.internal.acroformPlugin.xForms.push(l)}else"function"==typeof(l=c)&&(l=l.call(this,r)),a+="/"+n+" "+l,0<=A.internal.acroformPlugin.xForms.indexOf(l)||A.internal.acroformPlugin.xForms.push(l);a+=">>"}i.push({key:"AP",value:"<<\n"+a+">>"})}A.internal.putStream({additionalKeyValues:i}),A.internal.out("endobj")}e&&P.call(this,A.internal.acroformPlugin.xForms)},P=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];A.internal.newObjectDeferredBegin(r&&r.objId,!0),"object"===_typeof(r)&&"function"==typeof r.putStream&&r.putStream(),delete t[n]}},k=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(A=this,E.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(l)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");n=A.internal.scaleFactor,A.internal.acroformPlugin.acroFormDictionaryRoot=new q,A.internal.acroformPlugin.acroFormDictionaryRoot._eventID=A.internal.events.subscribe("postPutResources",m),A.internal.events.subscribe("buildDocument",p),A.internal.events.subscribe("putCatalog",g),A.internal.events.subscribe("postPutPages",x),A.internal.acroformPlugin.isInitialized=!0}},I=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n>"),e.join("\n")}},set:function(t){"object"===_typeof(t)&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){"string"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};r(R,E);var z=function(){R.call(this),this.pushButton=!0};r(z,R);var U=function(){R.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};r(U,R);var H=function(){var e,n;E.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var r,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),i)e.push("/"+t+" ("+i[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===_typeof(t)&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(t){r="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=Y.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};r(H,E),U.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t&&"getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},U.prototype.createOption=function(t){this.Kids.length;var e=new H;return e.Parent=this,e.optionName=t,this.Kids.push(e),J.call(this,e),e};var W=function(){R.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Y.CheckBox.createAppearanceStream()};r(W,R);var V=function(){E.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,13):this.Ff=L(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,21):this.Ff=L(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,23):this.Ff=L(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,24):this.Ff=L(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,25):this.Ff=L(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,26):this.Ff=L(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};r(V,E);var G=function(){V.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=N(this.Ff,14):this.Ff=L(this.Ff,14)}}),this.password=!0};r(G,V);var Y={CheckBox:{createAppearanceStream:function(){return{N:{On:Y.CheckBox.YesNormal},D:{On:Y.CheckBox.YesPushDown,Off:Y.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=u(t),n=[],r=A.internal.getFont(t.fontName,t.fontStyle).id,i=A.__private__.encodeColorString(t.color),o=c(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+_(o.fontSize)+" Tf "+i),n.push("BT"),n.push(o.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=u(t),n=A.internal.getFont(t.fontName,t.fontStyle).id,r=A.__private__.encodeColorString(t.color),i=[],o=Y.internal.getHeight(t),s=Y.internal.getWidth(t),a=c(t,t.caption);return i.push("1 g"),i.push("0 0 "+_(s)+" "+_(o)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+_(s-1)+" "+_(o-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+_(a.fontSize)+" Tf "+r),i.push(a.text),i.push("ET"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=u(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Circle.YesNormal,e.D[t]=Y.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=u(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Y.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+a(Y.internal.getWidth(t)/2)+" "+a(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=u(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5)),s=Number((r*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+a(Y.internal.getWidth(t)/2)+" "+a(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+a(Y.internal.getWidth(t)/2)+" "+a(Y.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=u(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+a(Y.internal.getWidth(t)/2)+" "+a(Y.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Cross.YesNormal,e.D[t]=Y.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=u(t),n=[],r=Y.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(_(r.x1.x)+" "+_(r.x1.y)+" m"),n.push(_(r.x2.x)+" "+_(r.x2.y)+" l"),n.push(_(r.x4.x)+" "+_(r.x4.y)+" m"),n.push(_(r.x3.x)+" "+_(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=u(t),n=Y.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+_(Y.internal.getWidth(t)-2)+" "+_(Y.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(_(n.x1.x)+" "+_(n.x1.y)+" m"),r.push(_(n.x2.x)+" "+_(n.x2.y)+" l"),r.push(_(n.x4.x)+" "+_(n.x4.y)+" m"),r.push(_(n.x3.x)+" "+_(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=u(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+_(Y.internal.getWidth(t))+" "+_(Y.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=A.internal.getFont(t.fontName,t.fontStyle).id,n=A.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};Y.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Y.internal.getWidth(t),n=Y.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},Y.internal.getWidth=function(t){var e=0;return"object"===_typeof(t)&&(e=v(t.Rect[2])),e},Y.internal.getHeight=function(t){var e=0;return"object"===_typeof(t)&&(e=v(t.Rect[3])),e};var J=t.addField=function(t){if(k.call(this),!(t instanceof E))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){A.internal.acroformPlugin.printedOut&&(A.internal.acroformPlugin.printedOut=!1,A.internal.acroformPlugin.acroFormDictionaryRoot=null),A.internal.acroformPlugin.acroFormDictionaryRoot||k.call(A),A.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=A.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof R==!1)throw new Error("Invalid argument passed to jsPDF.addButton.");return J.call(this,t)},t.addTextField=function(t){if(t instanceof V==!1)throw new Error("Invalid argument passed to jsPDF.addTextField.");return J.call(this,t)},t.addChoiceField=function(t){if(t instanceof M==!1)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return J.call(this,t)};"object"==_typeof(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=M,e.ListBox=O,e.ComboBox=D,e.EditBox=T,e.Button=R,e.PushButton=z,e.RadioButton=U,e.CheckBox=W,e.TextField=V,e.PasswordField=G,e.AcroForm={Appearance:Y}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=M,t.AcroFormListBox=O,t.AcroFormComboBox=D,t.AcroFormEditBox=T,t.AcroFormButton=R,t.AcroFormPushButton=z,t.AcroFormRadioButton=U,t.AcroFormCheckBox=W,t.AcroFormTextField=V,t.AcroFormPasswordField=G,t.AcroFormAppearance=Y,t.AcroForm={ChoiceField:M,ListBox:O,ComboBox:D,EditBox:T,Button:R,PushButton:z,RadioButton:U,CheckBox:W,TextField:V,PasswordField:G,Appearance:Y}}(jsPDF.API,"undefined"!=typeof window&&window||"undefined"!=typeof global&&global), /** @license * jsPDF addImage plugin * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/ @@ -80,7 +54,7 @@ function JPEGEncoder(t){var L,x,A,S,e,l=Math.floor,_=new Array(64),P=new Array(6 * * */ -function(N){var L="addImage_",u={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},h=N.getImageFileTypeByImageData=function(t,e){var n,r;e=e||"UNKNOWN";var i,o,s,a="UNKNOWN";for(s in N.isArrayBufferView(t)&&(t=N.arrayBufferToBinaryString(t)),u)for(i=u[s],n=0;n>"}),"trns"in e&&e.trns.constructor==Array){for(var a="",u=0,h=e.trns.length;u>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==s?n+=r[(252&(e=i[a]))>>2]+r[(3&e)<<4]+"==":2==s&&(n+=r[(64512&(e=i[a]<<8|i[a+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},N.createImageInfo=function(t,e,n,r,i,o,s,a,u,h,c,l,f){var p={alias:a,w:e,h:n,cs:r,bpc:i,i:s,data:t};return o&&(p.f=o),u&&(p.dp=u),h&&(p.trns=h),c&&(p.pal=c),l&&(p.smask=l),f&&(p.p=f),p},N.addImage=function(t,e,n,r,i,o,s,a,u){var h="";if("string"!=typeof e){var c=o;o=i,i=r,r=n,n=e,e=c}if("object"===_typeof(t)&&!_(t)&&"imageData"in t){var l=t;t=l.imageData,e=l.format||e||"UNKNOWN",n=l.x||n||0,r=l.y||r||0,i=l.w||i,o=l.h||o,s=l.alias||s,a=l.compression||a,u=l.rotation||l.angle||u}var f=this.internal.getFilters();if(void 0===a&&-1!==f.indexOf("FlateEncode")&&(a="SLOW"),"string"==typeof t&&(t=unescape(t)),isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var p,d,g,m,y,v,w,b=function(){var t=this.internal.collections[L+"images"];return t||(this.internal.collections[L+"images"]=t={},this.internal.events.subscribe("putResources",x),this.internal.events.subscribe("putXobjectDict",A)),t}.call(this);if(!((p=F(t,b))||(_(t)&&(t=P(t,e)),(null==(w=s)||0===w.length)&&(s="string"==typeof(v=t)?N.sHashCode(v):N.isArrayBufferView(v)?N.sHashCode(N.arrayBufferToBinaryString(v)):null),p=F(s,b)))){if(this.isString(t)&&(""!==(h=this.convertStringToImageData(t))?t=h:void 0!==(h=N.loadFile(t))&&(t=h)),e=this.getImageFileTypeByImageData(t,e),!S(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t,t=this.binaryStringToUint8Array(t))),!(p=this["process"+e.toUpperCase()](t,(y=0,(m=b)&&(y=Object.keys?Object.keys(m).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(m)),y),s,((g=a)&&"string"==typeof g&&(g=g.toUpperCase()),g in N.image_compression?g:N.image_compression.NONE),d)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,s,a){var u=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),h=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;if(n=u[0],r=u[1],s[o]=i,a){a*=Math.PI/180;var l=Math.cos(a),f=Math.sin(a),p=function(t){return t.toFixed(4)},d=[p(l),p(f),p(-1*f),p(l),0,0,"cm"]}this.internal.write("q"),a?(this.internal.write([1,"0","0",1,h(t),c(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([h(n),"0","0",h(r),"0","0","cm"].join(" "))):this.internal.write([h(n),"0","0",h(r),h(t),c(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,n,r,i,o,p,p.i,b,u),this},N.convertStringToImageData=function(t){var e,n="";if(this.isString(t)){var r;e=null!==(r=this.extractImageFromDataUrl(t))?r.data:t;try{n=atob(e)}catch(t){throw N.validateStringAsBase64(e)?new Error("atob-Error in jsPDF.convertStringToImageData "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return n};var c=function(t,e){return t.subarray(e,e+5)};N.processJPEG=function(t,e,n,r,i,o){var s,a=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(s=function(t){var e;if("JPEG"!==h(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r>"}),"trns"in e&&e.trns.constructor==Array){for(var a="",u=0,c=e.trns.length;u>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==s?n+=r[(252&(e=i[a]))>>2]+r[(3&e)<<4]+"==":2==s&&(n+=r[(64512&(e=i[a]<<8|i[a+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},N.createImageInfo=function(t,e,n,r,i,o,s,a,u,c,l,h,f){var p={alias:a,w:e,h:n,cs:r,bpc:i,i:s,data:t};return o&&(p.f=o),u&&(p.dp=u),c&&(p.trns=c),l&&(p.pal=l),h&&(p.smask=h),f&&(p.p=f),p},N.addImage=function(t,e,n,r,i,o,s,a,u){var c="";if("string"!=typeof e){var l=o;o=i,i=r,r=n,n=e,e=l}if("object"===_typeof(t)&&!_(t)&&"imageData"in t){var h=t;t=h.imageData,e=h.format||e||"UNKNOWN",n=h.x||n||0,r=h.y||r||0,i=h.w||i,o=h.h||o,s=h.alias||s,a=h.compression||a,u=h.rotation||h.angle||u}var f=this.internal.getFilters();if(void 0===a&&-1!==f.indexOf("FlateEncode")&&(a="SLOW"),"string"==typeof t&&(t=unescape(t)),isNaN(n)||isNaN(r))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var p,d,g,m,y,v,w,b=function(){var t=this.internal.collections[L+"images"];return t||(this.internal.collections[L+"images"]=t={},this.internal.events.subscribe("putResources",x),this.internal.events.subscribe("putXobjectDict",A)),t}.call(this);if(!((p=P(t,b))||(_(t)&&(t=F(t,e)),(null==(w=s)||0===w.length)&&(s="string"==typeof(v=t)?N.sHashCode(v):N.isArrayBufferView(v)?N.sHashCode(N.arrayBufferToBinaryString(v)):null),p=P(s,b)))){if(this.isString(t)&&(""!==(c=this.convertStringToImageData(t))?t=c:void 0!==(c=N.loadFile(t))&&(t=c)),e=this.getImageFileTypeByImageData(t,e),!S(e))throw new Error("addImage does not support files of type '"+e+"', please ensure that a plugin for '"+e+"' support is added.");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t,t=this.binaryStringToUint8Array(t))),!(p=this["process"+e.toUpperCase()](t,(y=0,(m=b)&&(y=Object.keys?Object.keys(m).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(m)),y),s,((g=a)&&"string"==typeof g&&(g=g.toUpperCase()),g in N.image_compression?g:N.image_compression.NONE),d)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,s,a){var u=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),c=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString;if(n=u[0],r=u[1],s[o]=i,a){a*=Math.PI/180;var h=Math.cos(a),f=Math.sin(a),p=function(t){return t.toFixed(4)},d=[p(h),p(f),p(-1*f),p(h),0,0,"cm"]}this.internal.write("q"),a?(this.internal.write([1,"0","0",1,c(t),l(e+r),"cm"].join(" ")),this.internal.write(d.join(" ")),this.internal.write([c(n),"0","0",c(r),"0","0","cm"].join(" "))):this.internal.write([c(n),"0","0",c(r),c(t),l(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,n,r,i,o,p,p.i,b,u),this},N.convertStringToImageData=function(t){var e,n="";if(this.isString(t)){var r;e=null!==(r=this.extractImageFromDataUrl(t))?r.data:t;try{n=atob(e)}catch(t){throw N.validateStringAsBase64(e)?new Error("atob-Error in jsPDF.convertStringToImageData "+t.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return n};var l=function(t,e){return t.subarray(e,e+5)};N.processJPEG=function(t,e,n,r,i,o){var s,a=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(s=function(t){var e;if("JPEG"!==c(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r>",h.content=m;var f=h.objId+" 0 R";m="<>";else if(u.options.pageNumber){switch(m="<>",this.internal.write(m))}}this.internal.write("]")}}]),t.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},t.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor}}(jsPDF.API), +function(t){jsPDF.API.events.push(["addPage",function(t){this.internal.getPageInfo(t.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(t){for(var e=this.internal.getPageInfoByObjId(t.objId),n=t.pageContext.annotations,r=function(t){if(void 0!==t&&""!=t)return!0},i=!1,o=0;o>",c.content=m;var f=c.objId+" 0 R";m="<>";else if(u.options.pageNumber){switch(m="<>",this.internal.write(m))}}this.internal.write("]")}}]),t.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},t.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor}}(jsPDF.API), /** * @license * Copyright (c) 2017 Aras Abbasi @@ -96,7 +70,7 @@ function(t){jsPDF.API.events.push(["addPage",function(t){this.internal.getPageIn * Licensed under the MIT License. * http://opensource.org/licenses/mit-license */ -function(t){var h={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},s={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];t.__arabicParser__={};var r=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==h[t.charCodeAt(0)]},c=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},i=t.__arabicParser__.isArabicEndLetter=function(t){return c(t)&&r(t)&&h[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return c(t)&&0<=n.indexOf(t.charCodeAt(0))},a=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return c(t)&&r(t)&&1<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return c(t)&&r(t)&&2<=h[t.charCodeAt(0)].length}),u=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return c(t)&&r(t)&&3<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return c(t)&&r(t)&&4==h[t.charCodeAt(0)].length}),l=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=s,r=0,i="",o=0;for(e=0;e>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this}, +function(t){var c={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},s={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];t.__arabicParser__={};var r=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==c[t.charCodeAt(0)]},l=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},i=t.__arabicParser__.isArabicEndLetter=function(t){return l(t)&&r(t)&&c[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return l(t)&&0<=n.indexOf(t.charCodeAt(0))},a=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return l(t)&&r(t)&&1<=c[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return l(t)&&r(t)&&2<=c[t.charCodeAt(0)].length}),u=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return l(t)&&r(t)&&3<=c[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return l(t)&&r(t)&&4==c[t.charCodeAt(0)].length}),h=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=s,r=0,i="",o=0;for(e=0;e>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this}, /** * @license * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv @@ -118,13 +92,13 @@ function(t){var e=function(){var e=void 0;Object.defineProperty(this,"pdf",{get: * * ==================================================================== */ -function(_){var u,P={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},F=1,p=function(t,e,n,r,i){P={x:t,y:e,w:n,h:r,ln:i}},d=function(){return P},k={left:0,top:0,bottom:0};_.setHeaderFunction=function(t){u=t},_.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,s=0;if("string"==typeof t)0!==(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if("[object Array]"!==Object.prototype.toString.call(t))throw new Error("getTextDimensions expects text-parameter to be of type String or an Array of Strings.");for(var a=0;a=this.internal.pageSize.getHeight()-h.bottom&&(this.cellAddPage(),u=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,u&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===s){i instanceof Array||(i=[i]);for(var c=0;c=this.internal.pageSize.getHeight()-c.bottom&&(this.cellAddPage(),u=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,u&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===s){i instanceof Array||(i=[i]);for(var l=0;l=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},n.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},n.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},n.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!L.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},n.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");x.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},n.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},n.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},n.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},n.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},n.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!L.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},n.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");x.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},n.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},n.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n"},a=function(t){var r,e,n,i,o,s=String,a="length",u="charCodeAt",h="slice",c="replace";for(t[h](-2),t=t[h](0,-2)[c](/\s/g,"")[c]("z","!!!!!"),n=[],i=0,o=(t+=r="uuuuu"[h](t[a]%5||5))[a];i>24,255&e>>16,255&e>>8,255&e);return function(t,e){for(var n=r[a];0")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),t=String.fromCharCode.apply(null,i)};s.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n"},a=function(t){var r,e,n,i,o,s=String,a="length",u="charCodeAt",c="slice",l="replace";for(t[c](-2),t=t[c](0,-2)[l](/\s/g,"")[l]("z","!!!!!"),n=[],i=0,o=(t+=r="uuuuu"[c](t[a]%5||5))[a];i>24,255&e>>16,255&e>>8,255&e);return function(t,e){for(var n=r[a];0")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),t=String.fromCharCode.apply(null,i)};s.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n> endobj")}var l=t.internal.newObject();t.internal.write("<< /Names [ ");for(r=0;r>","endobj");t.internal.newObject();t.internal.write("<< /Dests "+l+" 0 R"),t.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){0> \r\nendobj\r\n"},s.outline.count_r=function(t,e){for(var n=0;n> endobj")}var h=t.internal.newObject();t.internal.write("<< /Names [ ");for(r=0;r>","endobj");t.internal.newObject();t.internal.write("<< /Dests "+h+" 0 R"),t.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){0> \r\nendobj\r\n"},s.outline.count_r=function(t,e){for(var n=0;n>>24&255,f[l++]=a>>>16&255,f[l++]=a>>>8&255,f[l++]=255&a,F.arrayBufferToBinaryString(f)},p=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},d=function(t,e){for(var n,r=1,i=0,o=t.length,s=0;0>>0},g=function(t,e,n,r){for(var i,o,s,a=t.length/e,u=new Uint8Array(t.length+a),h=b(),c=0;c>>1)&255;return o},w=function(t,e,n){var r,i,o,s,a=[],u=0,h=t.length;for(a[0]=4;u>>d&255,d+=o.bits;y[w]=N>>>d&255}if(16===o.bits){g=(_=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),y=new Uint8Array(g*(32/o.pixelBitlength));for(var N,L=1>>0&255,L&&(m[b++]=N>>>16&255,N=_[w++],m[b++]=N>>>0&255),y[x++]=N>>>16&255;p=8}r!==F.image_compression.NONE&&k()?(t=I(m,o.width*o.colors,o.colors,r),c=I(y,o.width,1,r)):(t=m,c=y,f=null)}if(3===o.colorType&&(l=this.color_spaces.INDEXED,h=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,S=0;for(w=0,g=A.length;w>>24&255,f[h++]=a>>>16&255,f[h++]=a>>>8&255,f[h++]=255&a,P.arrayBufferToBinaryString(f)},p=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},d=function(t,e){for(var n,r=1,i=0,o=t.length,s=0;0>>0},g=function(t,e,n,r){for(var i,o,s,a=t.length/e,u=new Uint8Array(t.length+a),c=b(),l=0;l>>1)&255;return o},w=function(t,e,n){var r,i,o,s,a=[],u=0,c=t.length;for(a[0]=4;u>>d&255,d+=o.bits;y[w]=N>>>d&255}if(16===o.bits){g=(_=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),y=new Uint8Array(g*(32/o.pixelBitlength));for(var N,L=1>>0&255,L&&(m[b++]=N>>>16&255,N=_[w++],m[b++]=N>>>0&255),y[x++]=N>>>16&255;p=8}r!==P.image_compression.NONE&&k()?(t=I(m,o.width*o.colors,o.colors,r),l=I(y,o.width,1,r)):(t=m,l=y,f=null)}if(3===o.colorType&&(h=this.color_spaces.INDEXED,c=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,S=0;for(w=0,g=A.length;wr&&(i.push(t.slice(u,o)),a=0,u=o),a+=e[o],o++;return u!==o&&i.push(t.slice(u,o)),i},c=function(t,e,n){n||(n={});var r,i,o,s,a,u,h=[],c=[h],l=n.textIndent||0,f=0,p=0,d=t.split(" "),g=b.apply(this,[" ",n])[0];if(u=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var m=Array(u).join(" "),y=[];d.map(function(t){1<(t=t.split(/\s*\n/)).length?y=y.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):y.push(t[0])}),d=y,u=L.apply(this,[m,n])}for(o=0,s=d.length;or&&(i.push(t.slice(u,o)),a=0,u=o),a+=e[o],o++;return u!==o&&i.push(t.slice(u,o)),i},l=function(t,e,n){n||(n={});var r,i,o,s,a,u,c=[],l=[c],h=n.textIndent||0,f=0,p=0,d=t.split(" "),g=b.apply(this,[" ",n])[0];if(u=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var m=Array(u).join(" "),y=[];d.map(function(t){1<(t=t.split(/\s*\n/)).length?y=y.concat(t.map(function(t,e){return(e&&t.length?"\n":"")+t})):y.push(t[0])}),d=y,u=L.apply(this,[m,n])}for(o=0,s=d.length;o>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this}, +function(t){t.addSvg=function(t,e,n,r,i){if(void 0===e||void 0===n)throw new Error("addSVG needs values for 'x' and 'y'");function o(t){for(var e=parseFloat(t[1]),n=parseFloat(t[2]),r=[],i=3,o=t.length;i>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this}, /** ==================================================================== * jsPDF XMP metadata plugin * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi @@ -227,7 +201,38 @@ function(t){t.addSvg=function(t,e,n,r,i){if(void 0===e||void 0===n)throw new Err * * ==================================================================== */ -function(t){var a="",u="",h="";t.addMetadata=function(t,e){return u=e||"http://jspdf.default.namespaceuri/",a=t,this.internal.events.subscribe("postPutResources",function(){if(a){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(a)),i=unescape(encodeURIComponent("")),o=unescape(encodeURIComponent("")),s=n.length+r.length+i.length+e.length+o.length;h=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+s+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else h=""}),this.internal.events.subscribe("putCatalog",function(){h&&this.internal.write("/Metadata "+h+" 0 R")}),this}}(jsPDF.API),function(f,t){var e=f.API;var m=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],s=0,a=t.length;s<"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"Identity-H"===t.encoding){for(var i=t.metadata.Unicode.widths,o=t.metadata.subset.encode(t.metadata.glyIdsUsed,1),s="",a=0;a>"),e("endobj");var l=n();e("<<"),e("/Type /Font"),e("/BaseFont /"+t.fontName),e("/FontDescriptor "+c+" 0 R"),e("/W "+f.API.PDFObject.convert(i)),e("/CIDToGIDMap /Identity"),e("/DW 1000"),e("/Subtype /CIDFontType2"),e("/CIDSystemInfo"),e("<<"),e("/Supplement 0"),e("/Registry (Adobe)"),e("/Ordering ("+t.encoding+")"),e(">>"),e(">>"),e("endobj"),t.objectNumber=n(),e("<<"),e("/Type /Font"),e("/Subtype /Type0"),e("/ToUnicode "+h+" 0 R"),e("/BaseFont /"+t.fontName),e("/Encoding /"+t.encoding),e("/DescendantFonts ["+l+" 0 R]"),e(">>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"WinAnsiEncoding"===t.encoding){t.metadata.Unicode.widths;for(var i=t.metadata.rawData,o="",s=0;s>"),e("endobj"),t.objectNumber=n(),s=0;s>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);var h=function(t){var e,n,r=t.text||"",i=t.x,o=t.y,s=t.options||{},a=t.mutex||{},u=a.pdfEscape,h=a.activeFontKey,c=a.fonts,l=(a.activeFontSize,""),f=0,p="",d=c[n=h].encoding;if("Identity-H"!==c[n].encoding)return{text:r,x:i,y:o,options:s,mutex:a};for(p=r,n=h,"[object Array]"===Object.prototype.toString.call(r)&&(p=r[0]),f=0;f>>16,i=0,o=e.length;i>>0},c=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i>>0},l={},f=l.Adler32=(((i=(r=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(t=null==t?1:+t))throw new Error("First arguments needs to be a finite number.");this.checksum=t>>>0}).prototype={}).constructor=r).from=((t=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");this.checksum=h(1,t.toString())}).prototype=i,t),r.fromUtf8=((e=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");var e=a(t.toString());this.checksum=h(1,e)}).prototype=i,e),o&&(r.fromBuffer=((n=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(!s(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=c(1,e)}).prototype=i,n)),i.update=function(t){if(null==t)throw new Error("First argument needs to be a string.");return t=t.toString(),this.checksum=h(this.checksum,t)},i.updateUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=a(t.toString());return this.checksum=h(this.checksum,e)},o&&(i.updateBuffer=function(t){if(!s(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=c(this.checksum,e)}),i.clone=function(){return new f(this.checksum)},r);return l.from=function(t){if(null==t)throw new Error("First argument needs to be a string.");return h(1,t.toString())},l.fromUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=a(t.toString());return h(1,e)},o&&(l.fromBuffer=function(t){if(!s(t))throw new Error("First argument need to be ArrayBuffer.");var e=new Uint8Array(t);return c(1,e)}),l}(),function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(t){var d,g,l,f,i,o,s,a=e,m=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],y=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],v={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},u={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},h=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],c=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),w=!1,b=0;this.__bidiEngine__={};var N=function(t){var e=t.charCodeAt(),n=e>>8,r=u[n];return void 0!==r?a[256*r+(255&e)]:252===n||253===n?"AL":c.test(n)?"L":8===n?"R":"N"},p=function(t){for(var e,n=0;n=e.length||"EN"!==(i=n[r-1])&&"AN"!==i||"EN"!==(o=e[r+1])&&"AN"!==o?u="N":w&&(o="AN"),u=o===i?o:"N";break;case"ES":u="EN"===(i=0=t){for(a=c+1;a=t;)a++;for(u=c,s=a-1;u>7-a&1];this.data[s+4*a]=u.blue,this.data[s+4*a+1]=u.green,this.data[s+4*a+2]=u.red,this.data[s+4*a+3]=255}0!=e&&(this.pos+=4-e)}},BmpDecoder.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;0<=n;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i>4,u=15&o,h=this.palette[a];if(this.data[s]=h.blue,this.data[s+1]=h.green,this.data[s+2]=h.red,this.data[s+3]=255,2*i+1>=this.width)break;h=this.palette[u],this.data[s+4]=h.blue,this.data[s+4+1]=h.green,this.data[s+4+2]=h.red,this.data[s+4+3]=255}0!=e&&(this.pos+=4-e)}},BmpDecoder.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;0<=e;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r>5&e)/e*255|0,u=(o>>10&e)/e*255|0,h=o>>15?255:0,c=r*this.width*4+4*i;this.data[c]=u,this.data[c+1]=a,this.data[c+2]=s,this.data[c+3]=h}this.pos+=t}},BmpDecoder.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;0<=r;r--){for(var i=this.bottom_up?r:this.height-1-r,o=0;o>5&n)/n*255|0,h=(s>>11)/e*255|0,c=i*this.width*4+4*o;this.data[c]=h,this.data[c+1]=u,this.data[c+2]=a,this.data[c+3]=255}this.pos+=t}},BmpDecoder.prototype.bit24=function(){for(var t=this.height-1;0<=t;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(a)),i=unescape(encodeURIComponent("")),o=unescape(encodeURIComponent("")),s=n.length+r.length+i.length+e.length+o.length;c=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+s+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else c=""}),this.internal.events.subscribe("putCatalog",function(){c&&this.internal.write("/Metadata "+c+" 0 R")}),this}}(jsPDF.API),function(f,t){var e=f.API;var m=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],s=0,a=t.length;s<"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"Identity-H"===t.encoding){for(var i=t.metadata.Unicode.widths,o=t.metadata.subset.encode(t.metadata.glyIdsUsed,1),s="",a=0;a>"),e("endobj");var h=n();e("<<"),e("/Type /Font"),e("/BaseFont /"+t.fontName),e("/FontDescriptor "+l+" 0 R"),e("/W "+f.API.PDFObject.convert(i)),e("/CIDToGIDMap /Identity"),e("/DW 1000"),e("/Subtype /CIDFontType2"),e("/CIDSystemInfo"),e("<<"),e("/Supplement 0"),e("/Registry (Adobe)"),e("/Ordering ("+t.encoding+")"),e(">>"),e(">>"),e("endobj"),t.objectNumber=n(),e("<<"),e("/Type /Font"),e("/Subtype /Type0"),e("/ToUnicode "+c+" 0 R"),e("/BaseFont /"+t.fontName),e("/Encoding /"+t.encoding),e("/DescendantFonts ["+h+" 0 R]"),e(">>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);e.events.push(["putFont",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&"WinAnsiEncoding"===t.encoding){t.metadata.Unicode.widths;for(var i=t.metadata.rawData,o="",s=0;s>"),e("endobj"),t.objectNumber=n(),s=0;s>"),e("endobj"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);var c=function(t){var e,n,r=t.text||"",i=t.x,o=t.y,s=t.options||{},a=t.mutex||{},u=a.pdfEscape,c=a.activeFontKey,l=a.fonts,h=(a.activeFontSize,""),f=0,p="",d=l[n=c].encoding;if("Identity-H"!==l[n].encoding)return{text:r,x:i,y:o,options:s,mutex:a};for(p=r,n=c,"[object Array]"===Object.prototype.toString.call(r)&&(p=r[0]),f=0;f>>16,i=0,o=e.length;i>>0},h=function(t,e){for(var n=65535&t,r=t>>>16,i=0,o=e.length;i>>0},f={},p=f.Adler32=(((i=(r=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(t=null==t?1:+t))throw new Error("First arguments needs to be a finite number.");this.checksum=t>>>0}).prototype={}).constructor=r).from=((t=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");this.checksum=l(1,t.toString())}).prototype=i,t),r.fromUtf8=((e=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(null==t)throw new Error("First argument needs to be a string.");var e=u(t.toString());this.checksum=l(1,e)}).prototype=i,e),o&&(r.fromBuffer=((n=function(t){if(!(this instanceof r))throw new TypeError("Constructor cannot called be as a function.");if(!a(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=h(1,e)}).prototype=i,n)),i.update=function(t){if(null==t)throw new Error("First argument needs to be a string.");return t=t.toString(),this.checksum=l(this.checksum,t)},i.updateUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=u(t.toString());return this.checksum=l(this.checksum,e)},o&&(i.updateBuffer=function(t){if(!a(t))throw new Error("First argument needs to be ArrayBuffer.");var e=new Uint8Array(t);return this.checksum=h(this.checksum,e)}),i.clone=function(){return new p(this.checksum)},r);return f.from=function(t){if(null==t)throw new Error("First argument needs to be a string.");return l(1,t.toString())},f.fromUtf8=function(t){if(null==t)throw new Error("First argument needs to be a string.");var e=u(t.toString());return l(1,e)},o&&(f.fromBuffer=function(t){if(!a(t))throw new Error("First argument need to be ArrayBuffer.");var e=new Uint8Array(t);return h(1,e)}),f}(),function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(t){var d,g,h,f,i,o,s,a=e,m=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],y=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],v={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},u={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},c=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],l=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),w=!1,b=0;this.__bidiEngine__={};var N=function(t){var e=t.charCodeAt(),n=e>>8,r=u[n];return void 0!==r?a[256*r+(255&e)]:252===n||253===n?"AL":l.test(n)?"L":8===n?"R":"N"},p=function(t){for(var e,n=0;n=e.length||"EN"!==(i=n[r-1])&&"AN"!==i||"EN"!==(o=e[r+1])&&"AN"!==o?u="N":w&&(o="AN"),u=o===i?o:"N";break;case"ES":u="EN"===(i=0=t){for(a=l+1;a=t;)a++;for(u=l,s=a-1;u>>=1,n<<=1,0<--e;);return n>>>1}p.build_tree=function(t){var e,n,r,i=p.dyn_tree,o=p.stat_desc.static_tree,s=p.stat_desc.elems,a=-1;for(t.heap_len=0,t.heap_max=g,e=0;ep.max_code||(t.bl_count[i]++,o=0,c<=n&&(o=h[n-c]),s=a[2*n],t.opt_len+=s*(i+o),u&&(t.static_len+=s*(u[2*n+1]+o)));if(0!==f){do{for(i=l-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[l]--,f-=2}while(0p.max_code||(a[2*r+1]!=i&&(t.opt_len+=(i-a[2*r+1])*a[2*r],a[2*r+1]=i),n--)}}(t),function(t,e,n){var r,i,o,s=[],a=0;for(r=1;r<=d;r++)s[r]=a=a+n[r-1]<<1;for(i=0;i<=e;i++)0!==(o=t[2*i+1])&&(t[2*i]=u(s[o]++,o))}(i,p.max_code,t.bl_count)}}function ft(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i}lt._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],lt.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],lt.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],lt.d_code=function(t){return t<256?e[t]:e[256+(t>>>7)]},lt.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],lt.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],lt.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],lt.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ft.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],ft.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],ft.static_l_desc=new ft(ft.static_ltree,lt.extra_lbits,257,286,d),ft.static_d_desc=new ft(ft.static_dtree,lt.extra_dbits,0,30,d),ft.static_bl_desc=new ft(null,lt.extra_blbits,0,19,7);function n(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}var pt=[new n(0,0,0,0,0),new n(4,4,8,4,1),new n(4,5,16,8,1),new n(4,6,32,32,1),new n(4,4,16,16,2),new n(8,16,32,32,2),new n(8,16,128,128,2),new n(8,32,128,256,2),new n(32,128,258,1024,2),new n(32,258,258,4096,2)],dt=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],gt=262;function mt(t,e,n,r){var i=t[2*e],o=t[2*n];return i>>8&255)}function $(t,e){var n,r=e;16-r>>16-W,W+=r-16):(H|=t<>>=8,W-=8)}function rt(t,e){var n,r,i;if(V.pending_buf[z+2*R]=t>>>8&255,V.pending_buf[z+2*R+1]=255&t,V.pending_buf[O+R]=255&e,R++,0===t?a[2*e]++:(o++,t--,a[2*(lt._length_code[e]+256+1)]++,M[2*lt.d_code(t)]++),0==(8191&R)&&2>>=3,o>>3,(i=V.static_len+3+7>>>3)<=r&&(r=i)):r=i=e+5,e+4<=r&&-1!=t?st(t,e,n):i==r?($(2+(n?1:0),3),it(ft.static_ltree,ft.static_dtree)):($(4+(n?1:0),3),function(t,e,n){var r;for($(t-257,5),$(e-1,5),$(n-4,4),r=0;r>=2),Fs&&0!=--r);return o<=F?o:F}function ct(t){return t.total_in=t.total_out=0,t.msg=null,V.pending=0,V.pending_out=0,h=113,l=0,G.dyn_tree=a,G.stat_desc=ft.static_l_desc,Y.dyn_tree=M,Y.stat_desc=ft.static_d_desc,J.dyn_tree=D,J.stat_desc=ft.static_bl_desc,W=H=0,U=8,X(),function(){var t;for(i=2*f,t=y[w-1]=0;t>1)&&(i=3),r|=i<<6,0!==_&&(r|=32),h=113,Z((a=r+=31-r%31)>>8&255),Z(255&a)),0!==V.pending){if(u.flush_pending(),0===u.avail_out)return l=-1,0}else if(0===u.avail_in&&e<=o&&4!=e)return u.msg=dt[7],-5;if(666==h&&0!==u.avail_in)return t.msg=dt[7],-5;if(0!==u.avail_in||0!==F||0!=e&&666!=h){switch(s=-1,pt[B].func){case 0:s=function(t){var e,n=65535;for(c-5t.avail_out&&(e=t.avail_out),0!==e&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index),t.next_out_index+=e,t.dstate.pending_out+=e,t.total_out+=e,t.avail_out-=e,t.dstate.pending-=e,0===t.dstate.pending&&(t.dstate.pending_out=0))}};var o=t.zip||t;o.Deflater=o._jzlib_Deflater=function(t){var a=new i,u=new Uint8Array(512),e=t?t.level:-1;void 0===e&&(e=-1),a.deflateInit(e),a.next_out=u,this.append=function(t,e){var n,r=[],i=0,o=0,s=0;if(t.length){a.next_in_index=0,a.next_in=t,a.avail_in=t.length;do{if(a.next_out_index=0,a.avail_out=512,0!=a.deflate(0))throw new Error("deflating: "+a.msg);a.next_out_index&&(512==a.next_out_index?r.push(new Uint8Array(u)):r.push(new Uint8Array(u.subarray(0,a.next_out_index)))),s+=a.next_out_index,e&&0 - * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} - * @license Use it if you like it - */ -function(t){function e(t){var e;this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=(t=t.replace(/ /g,"")).toLowerCase();var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var r in n)t==r&&(t=n[r]);for(var i=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],o=0;o>16),h((65280&i)>>8),h(255&i);return 2===o?h(255&(i=c(t.charAt(e))<<2|c(t.charAt(e+1))>>4)):1===o&&(h((i=c(t.charAt(e))<<10|c(t.charAt(e+1))<<4|c(t.charAt(e+2))>>2)>>8&255),h(255&i)),s}(n),e,r)},i.prototype.parse=function(){return this.directory=new e(this.contents),this.head=new p(this),this.name=new b(this),this.cmap=new y(this),this.toUnicode=new Map,this.hhea=new g(this),this.maxp=new N(this),this.hmtx=new L(this),this.post=new v(this),this.os2=new m(this),this.loca=new P(this),this.glyf=new A(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},i.prototype.registerTTF=function(){var i,t,e,n,r;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,e,n,r;for(r=[],t=0,e=(n=this.bbox).length;t>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+e)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(r=this.familyClass)||2===r||3===r||4===r||5===r||7===r,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},i.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0},i.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*e},i.prototype.widthOfString=function(t,e,n){var r,i,o,s,a;for(i=s=o=0,a=(t=""+t).length;0<=a?s>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return 2147483648<=(t=this.readUInt32())?t-4294967296:t},t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return 32768<=(t=this.readUInt16())?t-65536:t},t.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var e,n,r;for(n=[],e=r=0;0<=t?r>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var e,n;for(e=[],n=0;0<=t?n>8,u[4*h+1]=(16711680&n[h])>>16,u[4*h]=(4278190080&n[h])>>24;return u},e}(),F=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,e,n,r,i;for(e in r=this.font.cmap.tables[0].codeMap,t={},i=this.subset)n=i[e],t[e]=r[n];return t},t.prototype.glyphsFor=function(t){var e,n,r,i,o,s,a;for(r={},o=0,s=t.length;o>"),e.join("\n")},s}()}(jsPDF), +function(t){var d=15,g=573,e=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function ht(){var p=this;function u(t,e){for(var n=0;n|=1&t,t>>>=1,n<<=1,0<--e;);return n>>>1}p.build_tree=function(t){var e,n,r,i=p.dyn_tree,o=p.stat_desc.static_tree,s=p.stat_desc.elems,a=-1;for(t.heap_len=0,t.heap_max=g,e=0;ep.max_code||(t.bl_count[i]++,o=0,l<=n&&(o=c[n-l]),s=a[2*n],t.opt_len+=s*(i+o),u&&(t.static_len+=s*(u[2*n+1]+o)));if(0!==f){do{for(i=h-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[h]--,f-=2}while(0p.max_code||(a[2*r+1]!=i&&(t.opt_len+=(i-a[2*r+1])*a[2*r],a[2*r+1]=i),n--)}}(t),function(t,e,n){var r,i,o,s=[],a=0;for(r=1;r<=d;r++)s[r]=a=a+n[r-1]<<1;for(i=0;i<=e;i++)0!==(o=t[2*i+1])&&(t[2*i]=u(s[o]++,o))}(i,p.max_code,t.bl_count)}}function ft(t,e,n,r,i){var o=this;o.static_tree=t,o.extra_bits=e,o.extra_base=n,o.elems=r,o.max_length=i}ht._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],ht.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],ht.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],ht.d_code=function(t){return t<256?e[t]:e[256+(t>>>7)]},ht.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ht.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ht.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ht.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ft.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],ft.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],ft.static_l_desc=new ft(ft.static_ltree,ht.extra_lbits,257,286,d),ft.static_d_desc=new ft(ft.static_dtree,ht.extra_dbits,0,30,d),ft.static_bl_desc=new ft(null,ht.extra_blbits,0,19,7);function n(t,e,n,r,i){var o=this;o.good_length=t,o.max_lazy=e,o.nice_length=n,o.max_chain=r,o.func=i}var pt=[new n(0,0,0,0,0),new n(4,4,8,4,1),new n(4,5,16,8,1),new n(4,6,32,32,1),new n(4,4,16,16,2),new n(8,16,32,32,2),new n(8,16,128,128,2),new n(8,32,128,256,2),new n(32,128,258,1024,2),new n(32,258,258,4096,2)],dt=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],gt=262;function mt(t,e,n,r){var i=t[2*e],o=t[2*n];return i>>8&255)}function $(t,e){var n,r=e;16-r>>16-W,W+=r-16):(H|=t<>>=8,W-=8)}function rt(t,e){var n,r,i;if(V.pending_buf[z+2*R]=t>>>8&255,V.pending_buf[z+2*R+1]=255&t,V.pending_buf[D+R]=255&e,R++,0===t?a[2*e]++:(o++,t--,a[2*(ht._length_code[e]+256+1)]++,M[2*ht.d_code(t)]++),0==(8191&R)&&2>>=3,o>>3,(i=V.static_len+3+7>>>3)<=r&&(r=i)):r=i=e+5,e+4<=r&&-1!=t?st(t,e,n):i==r?($(2+(n?1:0),3),it(ft.static_ltree,ft.static_dtree)):($(4+(n?1:0),3),function(t,e,n){var r;for($(t-257,5),$(e-1,5),$(n-4,4),r=0;r>=2),Ps&&0!=--r);return o<=P?o:P}function lt(t){return t.total_in=t.total_out=0,t.msg=null,V.pending=0,V.pending_out=0,c=113,h=0,G.dyn_tree=a,G.stat_desc=ft.static_l_desc,Y.dyn_tree=M,Y.stat_desc=ft.static_d_desc,J.dyn_tree=O,J.stat_desc=ft.static_bl_desc,W=H=0,U=8,X(),function(){var t;for(i=2*f,t=y[w-1]=0;t>1)&&(i=3),r|=i<<6,0!==_&&(r|=32),c=113,Z((a=r+=31-r%31)>>8&255),Z(255&a)),0!==V.pending){if(u.flush_pending(),0===u.avail_out)return h=-1,0}else if(0===u.avail_in&&e<=o&&4!=e)return u.msg=dt[7],-5;if(666==c&&0!==u.avail_in)return t.msg=dt[7],-5;if(0!==u.avail_in||0!==P||0!=e&&666!=c){switch(s=-1,pt[B].func){case 0:s=function(t){var e,n=65535;for(l-5t.avail_out&&(e=t.avail_out),0!==e&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index),t.next_out_index+=e,t.dstate.pending_out+=e,t.total_out+=e,t.avail_out-=e,t.dstate.pending-=e,0===t.dstate.pending&&(t.dstate.pending_out=0))}};var o=t.zip||t;o.Deflater=o._jzlib_Deflater=function(t){var a=new i,u=new Uint8Array(512),e=t?t.level:-1;void 0===e&&(e=-1),a.deflateInit(e),a.next_out=u,this.append=function(t,e){var n,r=[],i=0,o=0,s=0;if(t.length){a.next_in_index=0,a.next_in=t,a.avail_in=t.length;do{if(a.next_out_index=0,a.avail_out=512,0!=a.deflate(0))throw new Error("deflating: "+a.msg);a.next_out_index&&(512==a.next_out_index?r.push(new Uint8Array(u)):r.push(new Uint8Array(u.subarray(0,a.next_out_index)))),s+=a.next_out_index,e&&0>16),c((65280&i)>>8),c(255&i);return 2===o?c(255&(i=l(t.charAt(e))<<2|l(t.charAt(e+1))>>4)):1===o&&(c((i=l(t.charAt(e))<<10|l(t.charAt(e+1))<<4|l(t.charAt(e+2))>>2)>>8&255),c(255&i)),s}(n),e,r)},i.prototype.parse=function(){return this.directory=new e(this.contents),this.head=new p(this),this.name=new b(this),this.cmap=new y(this),this.toUnicode=new Map,this.hhea=new g(this),this.maxp=new N(this),this.hmtx=new L(this),this.post=new v(this),this.os2=new m(this),this.loca=new F(this),this.glyf=new A(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},i.prototype.registerTTF=function(){var i,t,e,n,r;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,e,n,r;for(r=[],t=0,e=(n=this.bbox).length;t>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+e)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(r=this.familyClass)||2===r||3===r||4===r||5===r||7===r,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},i.prototype.characterToGlyph=function(t){var e;return(null!=(e=this.cmap.unicode)?e.codeMap[t]:void 0)||0},i.prototype.widthOfGlyph=function(t){var e;return e=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*e},i.prototype.widthOfString=function(t,e,n){var r,i,o,s,a;for(i=s=o=0,a=(t=""+t).length;0<=a?s>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt32=function(){var t;return 2147483648<=(t=this.readUInt32())?t-4294967296:t},t.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},t.prototype.readInt16=function(){var t;return 32768<=(t=this.readUInt16())?t-65536:t},t.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},t.prototype.readString=function(t){var e,n,r;for(n=[],e=r=0;0<=t?r>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(t){return this.writeInt32(t)},t.prototype.read=function(t){var e,n;for(e=[],n=0;0<=t?n>8,u[4*c+1]=(16711680&n[c])>>16,u[4*c]=(4278190080&n[c])>>24;return u},e}(),P=function(){function t(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var t,e,n,r,i;for(e in r=this.font.cmap.tables[0].codeMap,t={},i=this.subset)n=i[e],t[e]=r[n];return t},t.prototype.glyphsFor=function(t){var e,n,r,i,o,s,a;for(r={},o=0,s=t.length;o>"),e.join("\n")},s}()}(jsPDF), /* # PNG.js # Copyright (c) 2011 Devon Govett @@ -270,7 +268,7 @@ function(t){function e(t){var e;this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t # # */ -function(t){var e;e=function(){var h,n,r;function i(t){var e,n,r,i,o,s,a,u,h,c,l,f,p,d;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},s=null;;){switch(e=this.readUInt32(),h=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":s&&this.animation.frames.push(s),this.pos+=4,s={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},o=this.readUInt16(),i=this.readUInt16()||100,s.delay=1e3*o/i,s.disposeOp=this.data[this.pos++],s.blendOp=this.data[this.pos++],s.data=[];break;case"IDAT":case"fdAT":for("fdAT"===h&&(this.pos+=4,e-=4),t=(null!=s?s.data:void 0)||this.imgData,f=0;0<=e?fr)throw new Error("More transparent colors than palette size");if(0<(c=r-this.transparency.indexed.length))for(p=0;0<=c?pthis.data.length)throw new Error("Incomplete or corrupt PNG file")}}i.load=function(t,e,n){var r;return"function"==typeof e&&(n=e),(r=new XMLHttpRequest).open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){var t;return t=new i(new Uint8Array(r.response||r.mozResponseArrayBuffer)),"function"==typeof(null!=e?e.getContext:void 0)&&t.render(e),"function"==typeof n?n(t):void 0},r.send(null)},i.prototype.read=function(t){var e,n;for(n=[],e=0;0<=t?er)throw new Error("More transparent colors than palette size");if(0<(l=r-this.transparency.indexed.length))for(p=0;0<=l?pthis.data.length)throw new Error("Incomplete or corrupt PNG file")}}i.load=function(t,e,n){var r;return"function"==typeof e&&(n=e),(r=new XMLHttpRequest).open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){var t;return t=new i(new Uint8Array(r.response||r.mozResponseArrayBuffer)),"function"==typeof(null!=e?e.getContext:void 0)&&t.render(e),"function"==typeof n?n(t):void 0},r.send(null)},i.prototype.read=function(t){var e,n;for(n=[],e=0;0<=t?e>t,this.codeSize=n-=t,this.bytesPos=o,e},t.prototype.getCode=function(t){for(var e=t[0],n=t[1],r=this.codeSize,i=this.codeBuf,o=this.bytes,s=this.bytesPos;r>16,c=65535&u;return(0==r||r>h,this.codeSize=r-h,this.bytesPos=s,c},t.prototype.generateHuffmanTable=function(t){for(var e=t.length,n=0,r=0;rn&&(n=t[r]);for(var i=1<>=1;for(r=c;r>=1)){var n,r;if(1==e)n=B,r=j;else if(2==e){for(var i=this.getBits(5)+257,o=this.getBits(5)+1,s=this.getBits(4)+4,a=Array(k.length),u=0;u>16;0>16)&&(y=this.getBits(y));var v=(65535&m)+y;d<=g+c&&(d=(_=this.ensureBuffer(g+c)).length);for(var w=0;w>t,this.codeSize=n-=t,this.bytesPos=o,e},t.prototype.getCode=function(t){for(var e=t[0],n=t[1],r=this.codeSize,i=this.codeBuf,o=this.bytes,s=this.bytesPos;r>16,l=65535&u;return(0==r||r>c,this.codeSize=r-c,this.bytesPos=s,l},t.prototype.generateHuffmanTable=function(t){for(var e=t.length,n=0,r=0;rn&&(n=t[r]);for(var i=1<>=1;for(r=l;r>=1)){var n,r;if(1==e)n=B,r=j;else if(2==e){for(var i=this.getBits(5)+257,o=this.getBits(5)+1,s=this.getBits(4)+4,a=Array(k.length),u=0;u>16;0>16)&&(y=this.getBits(y));var v=(65535&m)+y;d<=g+l&&(d=(_=this.ensureBuffer(g+l)).length);for(var w=0;w -

    Home

    Classes

    Modules

    Global

    +

    Home

    Classes

    Modules

    Global

    @@ -234,7 +234,7 @@

    deprecated/addhtml.js


    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:33 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/deprecated_from_html.js.html b/docs/deprecated_from_html.js.html index 799f14448..c243a8bbf 100644 --- a/docs/deprecated_from_html.js.html +++ b/docs/deprecated_from_html.js.html @@ -26,7 +26,7 @@
    @@ -1168,7 +1168,7 @@

    deprecated/from_html.js


    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:33 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/global.html b/docs/global.html index fa3157c1f..e427e0f50 100644 --- a/docs/global.html +++ b/docs/global.html @@ -26,7 +26,7 @@
    @@ -292,7 +292,7 @@

    Source:
    @@ -430,7 +430,7 @@
    Parameters:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:33 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/index.html b/docs/index.html index 5bf4a1cff..9aa475797 100644 --- a/docs/index.html +++ b/docs/index.html @@ -26,7 +26,7 @@
    @@ -50,15 +50,15 @@

    Home

    Classes

    @@ -1328,7 +1328,7 @@

    deletePage<
    Source:
    @@ -1367,6 +1367,10 @@

    deletePage< +
    +

    Deletes a page from the PDF.

    +
    + @@ -1414,7 +1418,7 @@

    Returns:
    -

    ellipse(x, y, rx, rx, style) → {jsPDF}

    +

    ellipse(x, y, rx, ry, style) → {jsPDF}

    @@ -1426,7 +1430,7 @@

    ellipseSource:
    @@ -1466,7 +1470,7 @@

    ellipse -

    Adds an ellipse to PDF

    +

    Adds an ellipse to PDF.

    @@ -1520,7 +1524,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against left edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against left edge of the page.

    @@ -1543,7 +1547,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against upper edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against upper edge of the page.

    @@ -1566,14 +1570,14 @@
    Parameters:
    -

    Radius along x axis (in units declared at inception of PDF document)

    +

    Radius along x axis (in units declared at inception of PDF document).

    - rx + ry @@ -1589,7 +1593,7 @@
    Parameters:
    -

    Radius along y axis (in units declared at inception of PDF document)

    +

    Radius along y axis (in units declared at inception of PDF document).

    @@ -1669,7 +1673,7 @@

    getCharSp
    Source:
    @@ -1709,7 +1713,7 @@

    getCharSp
    -

    Get global value of CharSpace

    +

    Get global value of CharSpace.

    @@ -1775,7 +1779,7 @@

    getCre
    Source:
    @@ -1922,7 +1926,7 @@

    getDrawCo
    Source:
    @@ -2028,7 +2032,7 @@

    getFileIdSource:
    @@ -2093,7 +2097,7 @@
    Returns:
    -

    GUID

    +

    GUID.

    @@ -2130,7 +2134,7 @@

    getFillCo
    Source:
    @@ -2236,7 +2240,7 @@

    getFontLis
    Source:
    @@ -2331,6 +2335,108 @@

    Returns:
    +

    getFontSize() → {number}

    + + + + + + +
    + + +
    Source:
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +

    Gets the fontsize for upcoming text elements.

    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    Returns:
    + + + + +
    +
    + Type +
    +
    + +number + + +
    +
    + + + + + + + + +

    getLineHeightFactor() → {number}

    @@ -2343,7 +2449,7 @@

    ge
    Source:
    @@ -2383,7 +2489,7 @@

    ge
    -

    Gets the LineHeightFactor, default: 1.25

    +

    Gets the LineHeightFactor, default: 1.15.

    @@ -2437,6 +2543,112 @@

    Returns:
    +

    getR2L() → {boolean}

    + + + + + + +
    + + +
    Source:
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +

    Get value of R2L functionality.

    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    Returns:
    + + +
    +

    jsPDF-instance

    +
    + + + +
    +
    + Type +
    +
    + +boolean + + +
    +
    + + + + + + + + +

    getTextColor() → {string}

    @@ -2449,7 +2661,7 @@

    getTextCo
    Source:
    @@ -2555,7 +2767,7 @@

    insertPage<
    Source:
    @@ -2702,7 +2914,7 @@

    lineSource:
    @@ -2742,7 +2954,7 @@

    line -

    Draw a line on the current page

    +

    Draw a line on the current page.

    @@ -2922,7 +3134,7 @@

    linesSource:
    @@ -3048,7 +3260,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against left edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against left edge of the page.

    @@ -3071,7 +3283,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against upper edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against upper edge of the page.

    @@ -3197,7 +3409,7 @@

    lstextSource:
    @@ -3422,7 +3634,7 @@

    movePageSource:
    @@ -3592,7 +3804,7 @@

    outputSource:
    @@ -3687,7 +3899,7 @@
    Parameters:
    -

    A string identifying one of the possible output types.

    +

    A string identifying one of the possible output types. Possible values are 'arraybuffer', 'blob', 'bloburi'/'bloburl', 'datauristring'/'dataurlstring', 'datauri'/'dataurl', 'dataurlnewwindow'.

    @@ -3710,7 +3922,7 @@
    Parameters:
    -

    An object providing some additional signalling to PDF generator.

    +

    An object providing some additional signalling to PDF generator. Possible options are 'filename'.

    @@ -3767,7 +3979,7 @@

    rectSource:
    @@ -3807,7 +4019,7 @@

    rect -

    Adds a rectangle to PDF

    +

    Adds a rectangle to PDF.

    @@ -3861,7 +4073,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against left edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against left edge of the page.

    @@ -3884,7 +4096,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against upper edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against upper edge of the page.

    @@ -3907,7 +4119,7 @@
    Parameters:
    -

    Width (in units declared at inception of PDF document)

    +

    Width (in units declared at inception of PDF document).

    @@ -3930,7 +4142,7 @@
    Parameters:
    -

    Height (in units declared at inception of PDF document)

    +

    Height (in units declared at inception of PDF document).

    @@ -3998,7 +4210,7 @@
    Returns:
    -

    roundedRect(x, y, w, h, rx, rx, style) → {jsPDF}

    +

    roundedRect(x, y, w, h, rx, ry, style) → {jsPDF}

    @@ -4010,7 +4222,7 @@

    roundedRec
    Source:
    @@ -4050,7 +4262,7 @@

    roundedRec
    -

    Adds a rectangle with rounded corners to PDF

    +

    Adds a rectangle with rounded corners to PDF.

    @@ -4104,7 +4316,7 @@

    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against left edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against left edge of the page.

    @@ -4127,7 +4339,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against upper edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against upper edge of the page.

    @@ -4150,7 +4362,7 @@
    Parameters:
    -

    Width (in units declared at inception of PDF document)

    +

    Width (in units declared at inception of PDF document).

    @@ -4173,7 +4385,7 @@
    Parameters:
    -

    Height (in units declared at inception of PDF document)

    +

    Height (in units declared at inception of PDF document).

    @@ -4196,14 +4408,14 @@
    Parameters:
    -

    Radius along x axis (in units declared at inception of PDF document)

    +

    Radius along x axis (in units declared at inception of PDF document).

    - rx + ry @@ -4219,7 +4431,7 @@
    Parameters:
    -

    Radius along y axis (in units declared at inception of PDF document)

    +

    Radius along y axis (in units declared at inception of PDF document).

    @@ -4287,7 +4499,7 @@
    Returns:
    -

    save(filename) → {jsPDF}

    +

    save(filename, options) → {jsPDF}

    @@ -4299,7 +4511,7 @@

    saveSource:
    @@ -4339,7 +4551,8 @@

    save -

    Saves as PDF document. An alias of jsPDF.output('save', 'filename.pdf')

    +

    Saves as PDF document. An alias of jsPDF.output('save', 'filename.pdf'). +Uses FileSaver.js-method saveAs.

    @@ -4397,6 +4610,29 @@
    Parameters:
    + + + + options + + + + + +Object + + + + + + + + + +

    An Object with additional options, possible options: 'returnPromise'.

    + + + @@ -4454,7 +4690,7 @@

    setCharSp
    Source:
    @@ -4494,7 +4730,7 @@

    setCharSp
    -

    Set global value of CharSpace

    +

    Set global value of CharSpace.

    @@ -4609,7 +4845,7 @@

    setCre
    Source:
    @@ -4756,7 +4992,7 @@

    setDisp
    Source:
    @@ -4857,7 +5093,7 @@

    Parameters:
    a string. 2 will scale the document up 2x, '200%' will scale up by the same amount. You can also set it to 'fullwidth', 'fullheight', 'fullpage', or 'original'.

    -

    Only certain PDF readers support this, such as Adobe Acrobat

    +

    Only certain PDF readers support this, such as Adobe Acrobat.

    @@ -4954,7 +5190,7 @@
    Returns:
    -

    setDrawColor(ch1, ch2, ch3, ch4) → {jsPDF}

    +

    setDocumentProperties(A) → {jsPDF}

    @@ -4966,7 +5202,7 @@

    setDrawCo
    Source:
    @@ -5006,17 +5242,168 @@

    setDrawCo
    -

    Sets the stroke color for upcoming elements.

    -

    Depending on the number of arguments given, Gray, RGB, or CMYK -color space is implied.

    -

    When only ch1 is given, "Gray" color space is implied and it -must be a value in the range from 0.00 (solid black) to to 1.00 (white) -if values are communicated as String types, or in range from 0 (black) -to 255 (white) if communicated as Number type. -The RGB-like 0-255 range is provided for backward compatibility.

    -

    When only ch1,ch2,ch3 are given, "RGB" color space is implied and each -value must be in the range from 0.00 (minimum intensity) to to 1.00 -(max intensity) if values are communicated as String types, or +

    Adds a properties to the PDF document.

    +
    + + + + + + + + + + + +

    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    A + + +Object + + + +

    property_name-to-property_value object structure.

    + + + + + + + + + + + + + + +
    Returns:
    + + + + +
    +
    + Type +
    +
    + +jsPDF + + +
    +
    + + + + + + + + + +

    setDrawColor(ch1, ch2, ch3, ch4) → {jsPDF}

    + + + + + + +
    + + +
    Source:
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +

    Sets the stroke color for upcoming elements.

    +

    Depending on the number of arguments given, Gray, RGB, or CMYK +color space is implied.

    +

    When only ch1 is given, "Gray" color space is implied and it +must be a value in the range from 0.00 (solid black) to to 1.00 (white) +if values are communicated as String types, or in range from 0 (black) +to 255 (white) if communicated as Number type. +The RGB-like 0-255 range is provided for backward compatibility.

    +

    When only ch1,ch2,ch3 are given, "RGB" color space is implied and each +value must be in the range from 0.00 (minimum intensity) to to 1.00 +(max intensity) if values are communicated as String types, or from 0 (min intensity) to to 255 (max intensity) if values are communicated as Number types. The RGB-like 0-255 range is provided for backward compatibility.

    @@ -5082,7 +5469,7 @@
    Parameters:
    -

    Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'

    +

    Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.

    @@ -5108,7 +5495,7 @@
    Parameters:
    -

    Color channel value

    +

    Color channel value.

    @@ -5134,7 +5521,7 @@
    Parameters:
    -

    Color channel value

    +

    Color channel value.

    @@ -5160,7 +5547,7 @@
    Parameters:
    -

    Color channel value

    +

    Color channel value.

    @@ -5217,7 +5604,7 @@

    setFileIdSource:
    @@ -5307,7 +5694,7 @@
    Parameters:
    -

    GUID

    +

    GUID.

    @@ -5364,7 +5751,7 @@

    setFillCo
    Source:
    @@ -5480,7 +5867,7 @@

    Parameters:
    -

    Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'

    +

    Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.

    @@ -5506,7 +5893,7 @@
    Parameters:
    -

    Color channel value

    +

    Color channel value.

    @@ -5532,7 +5919,7 @@
    Parameters:
    -

    Color channel value

    +

    Color channel value.

    @@ -5558,7 +5945,7 @@
    Parameters:
    -

    Color channel value

    +

    Color channel value.

    @@ -5615,7 +6002,7 @@

    setFontSource:
    @@ -5710,7 +6097,7 @@
    Parameters:
    -

    Font name or family. Example: "times"

    +

    Font name or family. Example: "times".

    @@ -5733,7 +6120,7 @@
    Parameters:
    -

    Font style or variant. Example: "italic"

    +

    Font style or variant. Example: "italic".

    @@ -5790,7 +6177,7 @@

    setFontSiz
    Source:
    @@ -5929,7 +6316,7 @@

    Returns:
    -

    setFontSize() → {number}

    +

    setFontStyle(style) → {jsPDF}

    @@ -5941,7 +6328,7 @@

    setFontSiz
    Source:
    @@ -5981,7 +6368,9 @@

    setFontSiz
    -

    Gets the fontsize for upcoming text elements.

    +

    Switches font style or variant for upcoming text elements, +while keeping the font face or family same. +See output of jsPDF.getFontList() for possible font names, styles.

    @@ -5994,6 +6383,55 @@

    setFontSiz +

    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    style + + +string + + + +

    Font style or variant. Example: "italic".

    + + @@ -6017,7 +6455,7 @@
    Returns:
    -number +jsPDF
    @@ -6031,7 +6469,7 @@
    Returns:
    -

    setFontStyle(style) → {jsPDF}

    +

    setLineCap(style) → {jsPDF}

    @@ -6043,7 +6481,7 @@

    setFontSt
    Source:
    @@ -6083,9 +6521,8 @@

    setFontSt
    -

    Switches font style or variant for upcoming text elements, -while keeping the font face or family same. -See output of jsPDF.getFontList() for possible font names, styles.

    +

    Sets the line cap styles. +See {jsPDF.CapJoinStyles} for variants.

    @@ -6129,7 +6566,10 @@

    Parameters:
    -string +String +| + +Number @@ -6139,7 +6579,7 @@
    Parameters:
    -

    Font style or variant. Example: "italic"

    +

    A string or number identifying the type of line cap.

    @@ -6184,7 +6624,7 @@
    Returns:
    -

    setLineCap(style) → {jsPDF}

    +

    setLineDash(dashArray, dashPhase) → {jsPDF}

    @@ -6196,7 +6636,7 @@

    setLineCap<
    Source:
    @@ -6236,8 +6676,8 @@

    setLineCap<
    -

    Sets the line cap styles -See {jsPDF.CapJoinStyles} for variants

    +

    Sets the dash pattern for upcoming lines.

    +

    To reset the settings simply call the method without any parameters.

    @@ -6275,16 +6715,36 @@

    Parameters:
    - style + dashArray -String -| +array -Number + + + + + + + + +

    The pattern of the line, expects numbers.

    + + + + + + + dashPhase + + + + + +number @@ -6294,7 +6754,7 @@
    Parameters:
    -

    A string or number identifying the type of line cap

    +

    The phase at which the dash pattern starts.

    @@ -6351,7 +6811,7 @@

    se
    Source:
    @@ -6391,7 +6851,7 @@

    se
    -

    Sets the LineHeightFactor,

    +

    Sets the LineHeightFactor of proportion.

    @@ -6445,7 +6905,7 @@

    Parameters:
    -

    of proportion. default: 1.25

    +

    LineHeightFactor value. Default: 1.15.

    @@ -6502,7 +6962,7 @@

    setLineJoi
    Source:
    @@ -6542,8 +7002,8 @@

    setLineJoi
    -

    Sets the line join styles -See {jsPDF.CapJoinStyles} for variants

    +

    Sets the line join styles. +See {jsPDF.CapJoinStyles} for variants.

    @@ -6600,7 +7060,7 @@

    Parameters:
    -

    A string or number identifying the type of line join

    +

    A string or number identifying the type of line join.

    @@ -6657,7 +7117,7 @@

    setLineWi
    Source:
    @@ -6751,7 +7211,7 @@

    Parameters:
    -

    Line width (in units declared at inception of PDF document)

    +

    Line width (in units declared at inception of PDF document).

    @@ -6796,7 +7256,7 @@
    Returns:
    -

    setPage(page) → {jsPDF}

    +

    setMiterLimit(length) → {jsPDF}

    @@ -6808,7 +7268,7 @@

    setPageSource:
    @@ -6848,7 +7308,7 @@

    setPage -

    Adds (and transfers the focus to) new page to the PDF document.

    +

    Sets the miterLimit property, which effects the maximum miter length.

    @@ -6859,11 +7319,6 @@

    setPageExample

    - -
    doc = jsPDF()
    doc.addPage()
    doc.addPage()
    doc.text('I am on page 3', 10, 10)
    doc.setPage(1)
    doc.text('I am on page 1', 10, 10)
    - -
    Parameters:
    @@ -6891,7 +7346,7 @@
    Parameters:
    - page + length @@ -6907,7 +7362,7 @@
    Parameters:
    -

    Switch the active page to the page number specified

    +

    The length of the miter

    @@ -6952,7 +7407,7 @@
    Returns:
    -

    setProperties(A) → {jsPDF}

    +

    setPage(page) → {jsPDF}

    @@ -6964,7 +7419,7 @@

    setPrope
    Source:
    @@ -7004,7 +7459,7 @@

    setPrope
    -

    Adds a properties to the PDF document

    +

    Adds (and transfers the focus to) new page to the PDF document.

    @@ -7015,6 +7470,11 @@

    setPrope +

    Example
    + +
    doc = jsPDF()
    doc.addPage()
    doc.addPage()
    doc.text('I am on page 3', 10, 10)
    doc.setPage(1)
    doc.text('I am on page 1', 10, 10)
    + +
    Parameters:
    @@ -7042,13 +7502,13 @@
    Parameters:
    - A + page -Object +number @@ -7058,7 +7518,7 @@
    Parameters:
    -

    property_name-to-property_value object structure.

    +

    Switch the active page to the page number specified.

    @@ -7103,112 +7563,6 @@
    Returns:
    -

    setR2L() → {boolean}

    - - - - - - -
    - - -
    Source:
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - -
    -

    Get value of R2L functionality

    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    jsPDF-instance

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - - - - - -

    setR2L(value) → {jsPDF}

    @@ -7221,7 +7575,7 @@

    setR2LSource:
    @@ -7261,7 +7615,7 @@

    setR2L -

    Set value of R2L functionality

    +

    Set value of R2L functionality.

    @@ -7376,7 +7730,7 @@

    setTextCo
    Source:
    @@ -7492,7 +7846,7 @@

    Parameters:
    -

    Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'

    +

    Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'.

    @@ -7518,7 +7872,7 @@
    Parameters:
    -

    Color channel value

    +

    Color channel value.

    @@ -7544,7 +7898,7 @@
    Parameters:
    -

    Color channel value

    +

    Color channel value.

    @@ -7570,7 +7924,7 @@
    Parameters:
    -

    Color channel value

    +

    Color channel value.

    @@ -7615,7 +7969,7 @@
    Returns:
    -

    text(text, x, y, options) → {jsPDF}

    +

    text(text, x, y, optionsopt) → {jsPDF}

    @@ -7627,7 +7981,7 @@

    textSource:
    @@ -7693,6 +8047,8 @@
    Parameters:
    Type + Attributes + @@ -7721,6 +8077,14 @@
    Parameters:
    + + + + + + + + @@ -7744,10 +8108,18 @@
    Parameters:
    + + + + + + + + -

    Coordinate (in units declared at inception of PDF document) against left edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against left edge of the page.

    @@ -7767,10 +8139,18 @@
    Parameters:
    + + + + + + + + -

    Coordinate (in units declared at inception of PDF document) against upper edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against upper edge of the page.

    @@ -7790,83 +8170,541 @@
    Parameters:
    + + + <optional>
    + + + + + -

    Collection of settings signalling how the text must be encoded. Defaults are sane. If you think you want to pass some flags, you likely can read the source.

    - + - - - +

    Collection of settings signaling how the text must be encoded.

    +
    Properties
    + + + + + + + + + + + + + + + + + + + + + + + + + + + -
    Returns:
    + + + - + + + -
    -
    - Type -
    -
    - -jsPDF +
    + + + + + + + - + + + -

    triangle(x1, y1, x2, y2, x3, y3, style) → {jsPDF}

    + + + + + + + - + + + - + + + - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributesDefaultDescription
    align + + +string + + + + <optional>
    + + + +
    + + left + +

    The alignment of the text, possible values: left, center, right, justify.

    baseline + + +string - - - + + + + <optional>
    + + - + +
    + + alphabetic + +

    Sets text baseline used when drawing the text, possible values: alphabetic, ideographic, bottom, top, middle.

    angle + + +string -
    - - -
    Source:
    -
    - + +
    + + <optional>
    + - + - + +
    + + 0 + +

    Rotate the text counterclockwise. Expects the angle in degree.

    charSpace + + +string + + + + + + <optional>
    + + + + + +
    + + 0 + +

    The space between each letter.

    lineHeightFactor + + +string + + + + + + <optional>
    + + + + + +
    + + 1.15 + +

    The lineheight of each line.

    flags + + +string + + + + + + <optional>
    + + + + + +
    + +

    Flags for to8bitStream.

    +
    Properties
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeAttributesDefaultDescription
    noBOM + + +string + + + + + + <optional>
    + + + + + +
    + + true + +

    Don't add BOM to Unicode-text.

    autoencode + + +string + + + + + + <optional>
    + + + + + +
    + + true + +

    Autoencode the Text.

    + +
    maxWidth + + +string + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Split the text by given width, 0 = no split.

    renderingMode + + +string + + + + + + <optional>
    + + + + + +
    + + fill + +

    Set how the text should be rendered, possible values: fill, stroke, fillThenStroke, invisible, fillAndAddForClipping, strokeAndAddPathForClipping, fillThenStrokeAndAddToPathForClipping, addToPathForClipping.

    + + + + + + + + + + + + + + + + + + + + + +
    Returns:
    + + + + +
    +
    + Type +
    +
    + +jsPDF + + +
    +
    + + + + + + + + + +

    triangle(x1, y1, x2, y2, x3, y3, style) → {jsPDF}

    + + + + + + +
    + + +
    Source:
    +
    + + + + + + + + + + + + + + + @@ -7890,7 +8728,7 @@

    triangle -

    Adds a triangle to PDF

    +

    Adds a triangle to PDF.

    @@ -7944,7 +8782,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against left edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against left edge of the page.

    @@ -7967,7 +8805,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against upper edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against upper edge of the page.

    @@ -7990,7 +8828,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against left edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against left edge of the page.

    @@ -8013,7 +8851,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against upper edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against upper edge of the page.

    @@ -8036,7 +8874,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against left edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against left edge of the page.

    @@ -8059,7 +8897,7 @@
    Parameters:
    -

    Coordinate (in units declared at inception of PDF document) against upper edge of the page

    +

    Coordinate (in units declared at inception of PDF document) against upper edge of the page.

    @@ -8142,7 +8980,7 @@
    Returns:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:33 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/jspdf.js.html b/docs/jspdf.js.html index 0a1c7ae1a..3ba193a60 100644 --- a/docs/jspdf.js.html +++ b/docs/jspdf.js.html @@ -26,7 +26,7 @@
    @@ -41,62 +41,16 @@

    jspdf.js

    -
    /** @license
    - * jsPDF - PDF Document creation from JavaScript
    - * Version ${versionID} Built on ${builtOn}
    - *                           CommitID ${commitID}
    - *
    - * Copyright (c) 2010-2016 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
    - *               2010 Aaron Spike, https://github.com/acspike
    - *               2012 Willow Systems Corporation, willow-systems.com
    - *               2012 Pablo Hess, https://github.com/pablohess
    - *               2012 Florian Jenett, https://github.com/fjenett
    - *               2013 Warren Weckesser, https://github.com/warrenweckesser
    - *               2013 Youssef Beddad, https://github.com/lifof
    - *               2013 Lee Driscoll, https://github.com/lsdriscoll
    - *               2013 Stefan Slonevskiy, https://github.com/stefslon
    - *               2013 Jeremy Morel, https://github.com/jmorel
    - *               2013 Christoph Hartmann, https://github.com/chris-rock
    - *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
    - *               2014 James Makes, https://github.com/dollaruw
    - *               2014 Diego Casorran, https://github.com/diegocr
    - *               2014 Steven Spungin, https://github.com/Flamenco
    - *               2014 Kenneth Glassey, https://github.com/Gavvers
    - *
    - * Permission is hereby granted, free of charge, to any person obtaining
    - * a copy of this software and associated documentation files (the
    - * "Software"), to deal in the Software without restriction, including
    - * without limitation the rights to use, copy, modify, merge, publish,
    - * distribute, sublicense, and/or sell copies of the Software, and to
    - * permit persons to whom the Software is furnished to do so, subject to
    - * the following conditions:
    - *
    - * The above copyright notice and this permission notice shall be
    - * included in all copies or substantial portions of the Software.
    - *
    - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    - *
    - * Contributor(s):
    - *    siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
    - *    kim3er, mfo, alnorth, Flamenco
    - */
    -
    -/**
    +            
    /**
      * Creates new jsPDF document object instance.
      * @name jsPDF
      * @class
    - * @param orientation {string/Object} Orientation of the first page. Possible values are "portrait" or "landscape" (or shortcuts "p" (Default), "l") <br />
    + * @param orientation {string/Object} Orientation of the first page. Possible values are "portrait" or "landscape" (or shortcuts "p" (Default), "l").<br />
      * Can also be an options object.
      * @param unit {string}  Measurement unit to be used when coordinates are specified.<br />
      * Possible values are "pt" (points), "mm" (Default), "cm", "in" or "px".
    - * @param format {string/Array} The format of the first page. Can be <ul><li>a0 - a10</li><li>b0 - b10</li><li>c0 - c10</li><li>c0 - c10</li><li>dl</li><li>letter</li><li>government-letter</li><li>legal</li><li>junior-legal</li><li>ledger</li><li>tabloid</li><li>credit-card</li></ul><br />
    - * Default is "a4". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array , e.g. [595.28, 841.89]
    + * @param format {string/Array} The format of the first page. Can be:<ul><li>a0 - a10</li><li>b0 - b10</li><li>c0 - c10</li><li>dl</li><li>letter</li><li>government-letter</li><li>legal</li><li>junior-legal</li><li>ledger</li><li>tabloid</li><li>credit-card</li></ul><br />
    + * Default is "a4". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89]
      * @returns {jsPDF} jsPDF-instance
      * @description
      * If the first parameter (orientation) is an object, it will be interpreted as an object of named parameters
    @@ -188,6 +142,7 @@ 

    jspdf.js

    function jsPDF(orientation, unit, format, compressPdf) { var options = {}; var filters = []; + var userUnit = 1.0; if (typeof orientation === 'object') { options = orientation; @@ -197,13 +152,14 @@

    jspdf.js

    format = options.format || format; compressPdf = options.compress || options.compressPdf || compressPdf; filters = options.filters || ((compressPdf === true) ? ['FlateEncode'] : filters); + userUnit = typeof options.userUnit === "number" ? Math.abs(options.userUnit) : 1.0; } - // Default options unit = unit || 'mm'; - format = format || 'a4'; orientation = ('' + (orientation || 'P')).toLowerCase(); - + var putOnlyUsedFonts = options.putOnlyUsedFonts || true; + var usedFonts = {}; + var API = { internal: {}, __private__: {} @@ -273,6 +229,11 @@

    jspdf.js

    return pageFormats[value]; }; + if (typeof format === "string") { + format = getPageFormat(format); + } + format = format || getPageFormat('a4'); + var f2 = API.f2 = API.__private__.f2 = function (number) { if (isNaN(number)) { throw new Error('Invalid argument passed to jsPDF.f2'); @@ -306,7 +267,7 @@

    jspdf.js

    * @memberOf jsPDF * @function * @instance - * @param {string} value GUID + * @param {string} value GUID. * @returns {jsPDF} */ API.setFileId = function (value) { @@ -320,7 +281,7 @@

    jspdf.js

    * @function * @instance * - * @returns {string} GUID + * @returns {string} GUID. */ API.getFileId = function () { return getFileId(); @@ -329,9 +290,6 @@

    jspdf.js

    var creationDate; var convertDateToPDFDate = API.__private__.convertDateToPDFDate = function (parmDate) { - var padd2 = function (number) { - return ('0' + parseInt(number)).slice(-2); - }; var result = ''; var tzoffset = parmDate.getTimezoneOffset(), tzsign = tzoffset < 0 ? '+' : '-', @@ -511,7 +469,7 @@

    jspdf.js

    * @instance * @returns {number} * @memberOf jsPDF - * @name setFontSize + * @name getFontSize */ var getFontSize = API.__private__.getFontSize = API.getFontSize = function () { return activeFontSize; @@ -521,7 +479,7 @@

    jspdf.js

    var R2L = options.R2L || false; /** - * Set value of R2L functionality + * Set value of R2L functionality. * * @param {boolean} value * @function @@ -536,13 +494,13 @@

    jspdf.js

    }; /** - * Get value of R2L functionality + * Get value of R2L functionality. * * @function * @instance * @returns {boolean} jsPDF-instance * @memberOf jsPDF - * @name setR2L + * @name getR2L */ var getR2L = API.__private__.getR2L = API.getR2L = function (value) { return R2L; @@ -608,7 +566,7 @@

    jspdf.js

    * same amount. You can also set it to 'fullwidth', 'fullheight', * 'fullpage', or 'original'. * - * Only certain PDF readers support this, such as Adobe Acrobat + * Only certain PDF readers support this, such as Adobe Acrobat. * * @param {string} layout Layout mode can be: 'continuous' - this is the * default continuous scroll. 'single' - the single page mode only shows one @@ -648,16 +606,16 @@

    jspdf.js

    }; /** - * Adds a properties to the PDF document + * Adds a properties to the PDF document. * * @param {Object} A property_name-to-property_value object structure. * @function * @instance * @returns {jsPDF} * @memberOf jsPDF - * @name setProperties + * @name setDocumentProperties */ - var setDocumentProperties = API.__private__.setDocumentProperties = API.setProperties = function (properties) { + var setDocumentProperties = API.__private__.setDocumentProperties = API.setProperties = API.setDocumentProperties = function (properties) { // copying only those properties we can render. for (var property in documentProperties) { if (documentProperties.hasOwnProperty(property) && properties[ @@ -675,7 +633,7 @@

    jspdf.js

    return documentProperties[key] = value; }; - var objectNumber = 2; // 'n' Current object number + var objectNumber = 0; // 'n' Current object number var offsets = []; // List of offsets. Activated and reset by buildDocument(). Pupulated by various calls buildDocument makes. var fonts = {}; // collection of font objects, where key is fontKey - a dynamically created label for a given font. var fontmap = {}; // mapping structure fontName > fontStyle > font key - performance layer. See addFont() @@ -686,6 +644,45 @@

    jspdf.js

    var additionalObjects = []; var events = new PubSub(API); var hotfixes = options.hotfixes || []; + var newObject = API.__private__.newObject = function () { + var oid = newObjectDeferred(); + newObjectDeferredBegin(oid, true); + return oid; + }; + + // Does not output the object. The caller must call newObjectDeferredBegin(oid) before outputing any data + var newObjectDeferred = API.__private__.newObjectDeferred = function () { + objectNumber++; + offsets[objectNumber] = function () { + return content_length; + }; + return objectNumber; + }; + + var newObjectDeferredBegin = function (oid, doOutput) { + doOutput = typeof (doOutput) === 'boolean' ? doOutput : false; + offsets[oid] = content_length; + if (doOutput) { + out(oid + ' 0 obj'); + } + return oid; + }; + // Does not output the object until after the pages have been output. + // Returns an object containing the objectId and content. + // All pages have been added so the object ID can be estimated to start right after. + // This does not modify the current objectNumber; It must be updated after the newObjects are output. + var newAdditionalObject = API.__private__.newAdditionalObject = function () { + var objId = newObjectDeferred(); + var obj = { + objId: objId, + content: '' + }; + additionalObjects.push(obj); + return obj; + }; + + var rootDictionaryObjId = newObjectDeferred(); + var resourceDictionaryObjId = newObjectDeferred(); ///////////////////// // Private functions @@ -797,41 +794,7 @@

    jspdf.js

    var getFilters = API.__private__.getFilters = function () { return filters; }; - - var newObject = API.__private__.newObject = function () { - // Begin a new object - objectNumber++; - offsets[objectNumber] = content_length; - out(objectNumber + ' 0 obj'); - return objectNumber; - }; - // Does not output the object until after the pages have been output. - // Returns an object containing the objectId and content. - // All pages have been added so the object ID can be estimated to start right after. - // This does not modify the current objectNumber; It must be updated after the newObjects are output. - var newAdditionalObject = API.__private__.newAdditionalObject = function () { - var objId = pages.length * 2 + 1; - objId += additionalObjects.length; - var obj = { - objId: objId, - content: '' - }; - additionalObjects.push(obj); - return obj; - }; - // Does not output the object. The caller must call newObjectDeferredBegin(oid) before outputing any data - var newObjectDeferred = API.__private__.newObjectDeferred = function () { - objectNumber++; - offsets[objectNumber] = function () { - return content_length; - }; - return objectNumber; - }; - - var newObjectDeferredBegin = function (oid) { - offsets[oid] = content_length; - }; - + var putStream = API.__private__.putStream = function (options) { options = options || {}; var data = options.data || ''; @@ -845,7 +808,11 @@

    jspdf.js

    filters = ['FlateEncode']; } var keyValues = options.additionalKeyValues || []; - processedData = jsPDF.API.processDataByFilters(data, filters); + if (typeof jsPDF.API.processDataByFilters !== 'undefined') { + processedData = jsPDF.API.processDataByFilters(data, filters); + } else { + processedData = {data: data, reverseChain : []} + } var filterAsString = processedData.reverseChain + ((Array.isArray(alreadyAppliedFilters)) ? alreadyAppliedFilters.join(' ') : alreadyAppliedFilters.toString()); if (processedData.data.length !== 0) { @@ -889,27 +856,51 @@

    jspdf.js

    }; var putPage = API.__private__.putPage = function (page) { - var dimensions = page.dimensions; + var mediaBox = page.mediaBox; var pageNumber = page.number; var data = page.data; + var pageObjectNumber = page.objId; + var pageContentsObjId = page.contentsObjId; - var pageObjectNumber = newObject(); - var wPt = dimensions.width * k; - var hPt = dimensions.height * k; + newObjectDeferredBegin(pageObjectNumber, true); + var wPt = pagesContext[currentPage].mediaBox.topRightX - pagesContext[currentPage].mediaBox.bottomLeftX; + var hPt = pagesContext[currentPage].mediaBox.topRightY - pagesContext[currentPage].mediaBox.bottomLeftY; out('<</Type /Page'); - out('/Parent 1 0 R'); - out('/Resources 2 0 R'); - out('/MediaBox [0 0 ' + f2(wPt) + ' ' + f2(hPt) + ']'); + out('/Parent ' + page.rootDictionaryObjId + ' 0 R'); + out('/Resources ' + page.resourceDictionaryObjId + ' 0 R'); + out('/MediaBox [' + parseFloat(f2(page.mediaBox.bottomLeftX)) + ' ' + parseFloat(f2(page.mediaBox.bottomLeftY)) + ' ' + f2(page.mediaBox.topRightX) + ' ' + f2(page.mediaBox.topRightY) + ']'); + if (page.cropBox !== null) { + out('/CropBox [' + f2(page.cropBox.bottomLeftX) + ' ' + f2(page.cropBox.bottomLeftY) + ' ' + f2(page.cropBox.topRightX) + ' ' + f2(page.cropBox.topRightY) + ']'); + } + + if (page.bleedBox !== null) { + out('/BleedBox [' + f2(page.bleedBox.bottomLeftX) + ' ' + f2(page.bleedBox.bottomLeftY) + ' ' + f2(page.bleedBox.topRightX) + ' ' + f2(page.bleedBox.topRightY) + ']'); + } + + if (page.trimBox !== null) { + out('/TrimBox [' + f2(page.trimBox.bottomLeftX) + ' ' + f2(page.trimBox.bottomLeftY) + ' ' + f2(page.trimBox.topRightX) + ' ' + f2(page.trimBox.topRightY) + ']'); + } + + if (page.artBox !== null) { + out('/ArtBox [' + f2(page.artBox.bottomLeftX) + ' ' + f2(page.artBox.bottomLeftY) + ' ' + f2(page.artBox.topRightX) + ' ' + f2(page.artBox.topRightY) + ']'); + } + + if (typeof page.userUnit === "number" && page.userUnit !== 1.0) { + out('/UserUnit ' + page.userUnit); + } + events.publish('putPage', { + objId : pageObjectNumber, + pageContext: pagesContext[pageNumber], pageNumber: pageNumber, page: data }); - out('/Contents ' + (objectNumber + 1) + ' 0 R'); + out('/Contents ' + pageContentsObjId + ' 0 R'); out('>>'); out('endobj'); // Page content var pageContent = data.join('\n'); - newObject(); + newObjectDeferredBegin(pageContentsObjId, true); putStream({ data: pageContent, filters: getFilters() @@ -919,16 +910,29 @@

    jspdf.js

    } var putPages = API.__private__.putPages = function () { var n, p, i, pageObjectNumbers = []; + + for (n = 1; n <= page; n++) { + pagesContext[n].objId = newObjectDeferred(); + pagesContext[n].contentsObjId = newObjectDeferred(); + } for (n = 1; n <= page; n++) { pageObjectNumbers.push(putPage({ number: n, data: pages[n], - dimensions: pagesContext[n].dimensions + objId: pagesContext[n].objId, + contentsObjId: pagesContext[n].contentsObjId, + mediaBox: pagesContext[n].mediaBox, + cropBox: pagesContext[n].cropBox, + bleedBox: pagesContext[n].bleedBox, + trimBox: pagesContext[n].trimBox, + artBox: pagesContext[n].artBox, + userUnit: pagesContext[n].userUnit, + rootDictionaryObjId: rootDictionaryObjId, + resourceDictionaryObjId: resourceDictionaryObjId })); } - offsets[1] = content_length; - out('1 0 obj'); + newObjectDeferredBegin(rootDictionaryObjId, true); out('<</Type /Pages'); var kids = '/Kids ['; for (i = 0; i < page; i++) { @@ -967,7 +971,9 @@

    jspdf.js

    var putFonts = function () { for (var fontKey in fonts) { if (fonts.hasOwnProperty(fontKey)) { - putFont(fonts[fontKey]); + if (putOnlyUsedFonts === false || (putOnlyUsedFonts === true && usedFonts.hasOwnProperty(fontKey))) { + putFont(fonts[fontKey]); + } } } }; @@ -979,7 +985,9 @@

    jspdf.js

    // Do this for each font, the '1' bit is the index of the font for (var fontKey in fonts) { if (fonts.hasOwnProperty(fontKey)) { - out('/' + fontKey + ' ' + fonts[fontKey].objectNumber + ' 0 R'); + if (putOnlyUsedFonts === false || (putOnlyUsedFonts === true && usedFonts.hasOwnProperty(fontKey))) { + out('/' + fontKey + ' ' + fonts[fontKey].objectNumber + ' 0 R'); + } } } out('>>'); @@ -991,9 +999,7 @@

    jspdf.js

    var putResources = function () { putFonts(); events.publish('putResources'); - // Resource dictionary - offsets[2] = content_length; - out('2 0 obj'); + newObjectDeferredBegin(resourceDictionaryObjId, true); out('<<'); putResourceDictionary(); out('>>'); @@ -1005,12 +1011,10 @@

    jspdf.js

    events.publish('putAdditionalObjects'); for (var i = 0; i < additionalObjects.length; i++) { var obj = additionalObjects[i]; - offsets[obj.objId] = content_length; - out(obj.objId + ' 0 obj'); - out(obj.content);; + newObjectDeferredBegin(obj.objId, true); + out(obj.content); out('endobj'); } - objectNumber += additionalObjects.length; events.publish('postPutAdditionalObjects'); }; @@ -1023,18 +1027,19 @@

    jspdf.js

    } fontmap[fontName][fontStyle] = fontKey; }; - var addFont = function (postScriptName, fontName, fontStyle, encoding) { + var addFont = function (postScriptName, fontName, fontStyle, encoding, isStandardFont) { + isStandardFont = isStandardFont || false; var fontKey = 'F' + (Object.keys(fonts).length + 1).toString(10), // This is FontObject - font = fonts[fontKey] = { + font = { 'id': fontKey, 'postScriptName': postScriptName, 'fontName': fontName, 'fontStyle': fontStyle, 'encoding': encoding, + 'isStandardFont': isStandardFont, 'metadata': {} }; - addToFontDictionary(fontKey, fontName, fontStyle); var instance = this; events.publish('addFont', { @@ -1042,6 +1047,10 @@

    jspdf.js

    instance: instance }); + if (fontKey !== undefined) { + fonts[fontKey] = font; + addToFontDictionary(fontKey, fontName, fontStyle); + } return fontKey; }; @@ -1051,8 +1060,10 @@

    jspdf.js

    arrayOfFonts[i][0], arrayOfFonts[i][1], arrayOfFonts[i][2], - standardFonts[i][3]); - + standardFonts[i][3], + true); + + usedFonts[fontKey] = true; // adding aliases for standard fonts, this time matching the capitalization var parts = arrayOfFonts[i][0].split('-'); addToFontDictionary(fontKey, parts[0], parts[1] || ''); @@ -1246,10 +1257,9 @@

    jspdf.js

    var orientation = typeof height === 'string' && height.toLowerCase(); if (typeof width === 'string') { - var format = width.toLowerCase(); - if (getPageFormat(format)) { - width = getPageFormat(format)[0] / k; - height = getPageFormat(format)[1] / k; + if (tmp = getPageFormat(width.toLowerCase())) { + width = tmp[0]; + height = tmp[1]; } } if (Array.isArray(width)) { @@ -1257,8 +1267,8 @@

    jspdf.js

    width = width[0]; } if (isNaN(width) || isNaN(height)) { - width = getPageFormat('a4')[0] / k; - height = getPageFormat('a4')[1] / k; + width = format[0]; + height = format[1]; } if (orientation) { switch (orientation.substr(0, 1)) { @@ -1275,12 +1285,29 @@

    jspdf.js

    height = tmp; } } + + if (width > 14400 || height > 14400) { + console.warn('A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400'); + width = Math.min(14400, width); + height = Math.min(14400, height); + } + + format = [width, height]; outToPages = true; pages[++page] = []; pagesContext[page] = { - dimensions: { - width: Number(width), - height: Number(height), + objId: 0, + contentsObjId: 0, + userUnit : Number(userUnit), + artBox: null, + bleedBox: null, + cropBox: null, + trimBox: null, + mediaBox: { + bottomLeftX: 0, + bottomLeftY: 0, + topRightX: Number(width), + topRightY: Number(height) } }; _setPage(page); @@ -1317,12 +1344,10 @@

    jspdf.js

    var _setPage = function (n) { if (n > 0 && n <= page) { currentPage = n; - pagesContext[currentPage].dimensions.width; - pagesContext[currentPage].dimensions.height; } }; - var getNumberOfPages = API.__private__.getNumberOfPages = function () { + var getNumberOfPages = API.__private__.getNumberOfPages = API.getNumberOfPages = function () { return pages.length - 1; } /** @@ -1383,11 +1408,13 @@

    jspdf.js

    out('endobj'); }; - var putCatalog = API.__private__.putCatalog = function () { + var putCatalog = API.__private__.putCatalog = function (options) { + options = options || {}; + var tmpRootDictionaryObjId = options.rootDictionaryObjId || rootDictionaryObjId; newObject(); out('<<'); out('/Type /Catalog'); - out('/Pages 1 0 R'); + out('/Pages ' + tmpRootDictionaryObjId + ' 0 R'); // PDF13ref Section 7.2.1 if (!zoomMode) zoomMode = 'fullwidth'; switch (zoomMode) { @@ -1481,11 +1508,14 @@

    jspdf.js

    var buildDocument = API.__private__.buildDocument = function () { outToPages = false; // switches out() to content - objectNumber = 2; + //reset fields relevant for objectNumber generation and xref. + objectNumber = 0; content_length = 0; content = []; offsets = []; additionalObjects = []; + rootDictionaryObjId = newObjectDeferred(); + resourceDictionaryObjId = newObjectDeferred(); events.publish('buildDocument'); @@ -1514,7 +1544,21 @@

    jspdf.js

    }); }; - var output = API.__private__.output = SAFE(function output(type, options) { + /** + * Generates the PDF document. + * + * If `type` argument is undefined, output is raw body of resulting PDF returned as a string. + * + * @param {string} type A string identifying one of the possible output types. Possible values are 'arraybuffer', 'blob', 'bloburi'/'bloburl', 'datauristring'/'dataurlstring', 'datauri'/'dataurl', 'dataurlnewwindow'. + * @param {Object} options An object providing some additional signalling to PDF generator. Possible options are 'filename'. + * + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name output + */ + var output = API.output = API.__private__.output = SAFE(function output(type, options) { options = options || {}; var pdfDocument = buildDocument(); @@ -1525,25 +1569,12 @@

    jspdf.js

    } else { options.filename = options.filename || 'generated.pdf'; } - var datauri = ('' + type).substr(0, 6) === 'dataur' ? - 'data:application/pdf;filename=' + options.filename + ';base64,' + btoa(pdfDocument) : 0; switch (type) { case undefined: return pdfDocument; case 'save': - if (typeof navigator === "object" && navigator.getUserMedia) { - if (global.URL === undefined || global.URL.createObjectURL === - undefined) { - return API.output('dataurlnewwindow'); - } - } - saveAs(getBlob(pdfDocument), options.filename); - if (typeof saveAs.unload === 'function') { - if (global.setTimeout) { - setTimeout(saveAs.unload, 911); - } - } + API.save(options.filename); break; case 'arraybuffer': return getArrayBuffer(pdfDocument); @@ -1551,12 +1582,16 @@

    jspdf.js

    return getBlob(pdfDocument); case 'bloburi': case 'bloburl': - // User is responsible of calling revokeObjectURL - return global.URL && global.URL.createObjectURL(getBlob(pdfDocument)) || - void 0; + // Developer is responsible of calling revokeObjectURL + if (typeof global.URL !== "undefined" && typeof global.URL.createObjectURL === "function") { + return global.URL && global.URL.createObjectURL(getBlob(pdfDocument)) || void 0; + } else {f + console.warn('bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.'); + } + break; case 'datauristring': case 'dataurlstring': - return datauri; + return 'data:application/pdf;filename=' + options.filename + ';base64,' + btoa(pdfDocument); case 'dataurlnewwindow': var htmlForNewWindow = '<html>' + '<style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style>' + @@ -1571,11 +1606,10 @@

    jspdf.js

    /* pass through */ case 'datauri': case 'dataurl': - return global.document.location.href = datauri; + return global.document.location.href = 'data:application/pdf;filename=' + options.filename + ';base64,' + btoa(pdfDocument); default: return null; } - // @TODO: Add different output options }); /** @@ -1626,12 +1660,12 @@

    jspdf.js

    //--------------------------------------- // Public API - + var getPageInfo = API.__private__.getPageInfo = function (pageNumberOneBased) { if (isNaN(pageNumberOneBased) || (pageNumberOneBased % 1 !== 0)) { throw new Error('Invalid argument passed to jsPDF.getPageInfo'); } - var objId = (pageNumberOneBased - 1) * 2 + 3; + var objId = pagesContext[pageNumberOneBased].objId; return { objId: objId, pageNumber: pageNumberOneBased, @@ -1639,10 +1673,23 @@

    jspdf.js

    }; }; + var getPageInfoByObjId = API.__private__.getPageInfoByObjId = function (objId) { + var pageNumberWithObjId; + for (var pageNumber in pagesContext) { + if (pagesContext[pageNumber].objId === objId) { + pageNumberWithObjId = pageNumber; + break; + } + } + if (isNaN(objId) || (objId % 1 !== 0)) { + throw new Error('Invalid argument passed to jsPDF.getPageInfoByObjId'); + } + return getPageInfo(pageNumber); + }; + var getCurrentPageInfo = API.__private__.getCurrentPageInfo = function () { - var objId = (currentPage - 1) * 2 + 3; return { - objId: objId, + objId: pagesContext[currentPage].objId, pageNumber: currentPage, pageContext: pagesContext[currentPage] }; @@ -1650,9 +1697,9 @@

    jspdf.js

    /** * Adds (and transfers the focus to) new page to the PDF document. - * @param format {String/Array} The format of the new page. Can be <ul><li>a0 - a10</li><li>b0 - b10</li><li>c0 - c10</li><li>c0 - c10</li><li>dl</li><li>letter</li><li>government-letter</li><li>legal</li><li>junior-legal</li><li>ledger</li><li>tabloid</li><li>credit-card</li></ul><br /> - * Default is "a4". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array , e.g. [595.28, 841.89] - * @param orientation {string} Orientation of the new page. Possible values are "portrait" or "landscape" (or shortcuts "p" (Default), "l") + * @param format {String/Array} The format of the new page. Can be: <ul><li>a0 - a10</li><li>b0 - b10</li><li>c0 - c10</li><li>dl</li><li>letter</li><li>government-letter</li><li>legal</li><li>junior-legal</li><li>ledger</li><li>tabloid</li><li>credit-card</li></ul><br /> + * Default is "a4". If you want to use your own format just pass instead of one of the above predefined formats the size as an number-array, e.g. [595.28, 841.89] + * @param orientation {string} Orientation of the new page. Possible values are "portrait" or "landscape" (or shortcuts "p" (Default), "l"). * @function * @instance * @returns {jsPDF} @@ -1672,7 +1719,7 @@

    jspdf.js

    * * @memberOf jsPDF * @name setPage - * @param {number} page Switch the active page to the page number specified + * @param {number} page Switch the active page to the page number specified. * @example * doc = jsPDF() * doc.addPage() @@ -1736,6 +1783,7 @@

    jspdf.js

    }; /** + * Deletes a page from the PDF. * @name deletePage * @memberOf jsPDF * @function @@ -1747,16 +1795,25 @@

    jspdf.js

    return this; }; - /** * Adds text to page. Supports adding multiline text when 'text' argument is an Array of Strings. * * @function * @instance * @param {String|Array} text String or array of strings to be added to the page. Each line is shifted one line down per font, spacing settings declared before this call. - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {Object} options Collection of settings signalling how the text must be encoded. Defaults are sane. If you think you want to pass some flags, you likely can read the source. + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {Object} [options] - Collection of settings signaling how the text must be encoded. + * @param {string} [options.align=left] - The alignment of the text, possible values: left, center, right, justify. + * @param {string} [options.baseline=alphabetic] - Sets text baseline used when drawing the text, possible values: alphabetic, ideographic, bottom, top, middle. + * @param {string} [options.angle=0] - Rotate the text counterclockwise. Expects the angle in degree. + * @param {string} [options.charSpace=0] - The space between each letter. + * @param {string} [options.lineHeightFactor=1.15] - The lineheight of each line. + * @param {string} [options.flags] - Flags for to8bitStream. + * @param {string} [options.flags.noBOM=true] - Don't add BOM to Unicode-text. + * @param {string} [options.flags.autoencode=true] - Autoencode the Text. + * @param {string} [options.maxWidth=0] - Split the text by given width, 0 = no split. + * @param {string} [options.renderingMode=fill] - Set how the text should be rendered, possible values: fill, stroke, fillThenStroke, invisible, fillAndAddForClipping, strokeAndAddPathForClipping, fillThenStrokeAndAddToPathForClipping, addToPathForClipping. * @returns {jsPDF} * @memberOf jsPDF * @name text @@ -1782,7 +1839,7 @@

    jspdf.js

    // function(data, coordinates... , miscellaneous) // this method had its args flipped. // code below allows backward compatibility with old arg order. - if (typeof text === 'number') { + if (typeof text === 'number' && typeof x === 'number' && (typeof y === 'string' || Array.isArray(y))) { tmp = y; y = x; x = text; @@ -1812,18 +1869,22 @@

    jspdf.js

    align: align }; } - - flags = flags || {}; - flags.noBOM = flags.noBOM || true; - flags.autoencode = flags.autoencode || true; - if (isNaN(x) || isNaN(y) || typeof text === "undefined") { + flags = flags || {}; + flags.noBOM = flags.noBOM || true; + flags.autoencode = flags.autoencode || true; + + if (isNaN(x) || isNaN(y) || typeof text === "undefined" || text === null) { throw new Error('Invalid arguments passed to jsPDF.text'); } + if (text.length === 0) { + return scope; + } + var xtra = ''; var isHex = false; - var lineHeight = options.lineHeightFactor || lineHeightFactor; + var lineHeight = typeof options.lineHeightFactor === 'number' ? options.lineHeightFactor : lineHeightFactor; var scope = options.scope || this; @@ -1845,7 +1906,7 @@

    jspdf.js

    if (typeof curDa === "string") { da.push(curDa); } else { - if (Object.prototype.toString.call(text) === '[object Array]' && curDa.length === 1) { + if (Array.isArray(text) && curDa.length === 1) { da.push(curDa[0]); } else { da.push([curDa[0], curDa[1], curDa[2]]); @@ -1859,7 +1920,7 @@

    jspdf.js

    var result; if (typeof text === 'string') { result = processingFunction(text)[0]; - } else if (Object.prototype.toString.call(text) === '[object Array]') { + } else if (Array.isArray(text)) { //we don't want to destroy original text array, so cloning it var sa = text.concat(); var da = []; @@ -1872,7 +1933,7 @@

    jspdf.js

    curDa = sa.shift(); if (typeof curDa === "string") { da.push(processingFunction(curDa)[0]); - } else if (((Object.prototype.toString.call(curDa) === '[object Array]') && curDa[0] === "string")) { + } else if ((Array.isArray(curDa) && curDa[0] === "string")) { tmpResult = processingFunction(curDa[0], curDa[1], curDa[2]); da.push([tmpResult[0], tmpResult[1], tmpResult[2]]); } @@ -1888,7 +1949,7 @@

    jspdf.js

    if (typeof text === 'string') { textIsOfTypeString = true; - } else if (Object.prototype.toString.call(text) === '[object Array]') { + } else if (Array.isArray(text)) { //we don't want to destroy original text array, so cloning it var sa = text.concat(); var da = []; @@ -1898,7 +1959,7 @@

    jspdf.js

    //thus, pdfEscape each component separately while (len--) { curDa = sa.shift(); - if (typeof curDa !== "string" || ((Object.prototype.toString.call(curDa) === '[object Array]') && typeof curDa[0] !== "string")) { + if (typeof curDa !== "string" || (Array.isArray(curDa) && typeof curDa[0] !== "string")) { tmpTextIsOfTypeString = false; } } @@ -1931,6 +1992,29 @@

    jspdf.js

    } } + //baseline + var height = activeFontSize / scope.internal.scaleFactor; + var descent = height * (lineHeightFactor - 1); + switch (options.baseline) { + case 'bottom': + y -= descent; + break; + case 'top': + y += height - descent; + break; + case 'hanging': + y += height - 2 * descent; + break; + case 'middle': + y += height / 2 - descent; + break; + case 'ideographic': + case 'alphabetic': + default: + // do nothing, everything is fine + break; + } + //multiline var maxWidth = options.maxWidth || 0; @@ -1964,16 +2048,12 @@

    jspdf.js

    var angle = options.angle; var k = scope.internal.scaleFactor; - var curY = (scope.internal.pageSize.getHeight() - y) * k; var transformationMatrix = []; if (angle) { angle *= (Math.PI / 180); var c = Math.cos(angle), s = Math.sin(angle); - var f2 = function (number) { - return number.toFixed(2); - } transformationMatrix = [f2(c), f2(s), f2(s * -1), f2(c)]; } @@ -1981,7 +2061,7 @@

    jspdf.js

    var charSpace = options.charSpace; - if (charSpace !== undefined) { + if (typeof charSpace !== 'undefined') { xtra += f3(charSpace * k) + " Tc\n"; } @@ -2037,7 +2117,7 @@

    jspdf.js

    break; } - var usedRenderingMode = pageContext.usedRenderingMode || -1; + var usedRenderingMode = typeof pageContext.usedRenderingMode !== 'undefined' ? pageContext.usedRenderingMode : -1; //if the coder wrote it explicitly to use a specific //renderingMode, then use it @@ -2057,7 +2137,6 @@

    jspdf.js

    var align = options.align || 'left'; var leading = activeFontSize * lineHeight; - var pageHeight = scope.internal.pageSize.getHeight(); var pageWidth = scope.internal.pageSize.getWidth(); var k = scope.internal.scaleFactor; var lineWidth = lineWidth; @@ -2101,8 +2180,8 @@

    jspdf.js

    for (var i = 0, len = da.length; i < len; i++) { delta = maxLineLength - lineWidths[i]; if (i === 0) { - newX = x * k; - newY = (pageHeight - y) * k; + newX = getHorizontalCoordinate(x); + newY = getVerticalCoordinate(y); } else { newX = (prevWidth - lineWidths[i]) * k; newY = -leading; @@ -2119,8 +2198,8 @@

    jspdf.js

    for (var i = 0, len = da.length; i < len; i++) { delta = (maxLineLength - lineWidths[i]) / 2; if (i === 0) { - newX = x * k; - newY = (pageHeight - y) * k; + newX = getHorizontalCoordinate(x); + newY = getVerticalCoordinate(y); } else { newX = (prevWidth - lineWidths[i]) / 2 * k; newY = -leading; @@ -2131,8 +2210,8 @@

    jspdf.js

    } else if (align === "left") { text = []; for (var i = 0, len = da.length; i < len; i++) { - newY = (i === 0) ? (pageHeight - y) * k : -leading; - newX = (i === 0) ? x * k : 0; + newY = (i === 0) ? getVerticalCoordinate(y) : -leading; + newX = (i === 0) ? getHorizontalCoordinate(x) : 0; //text.push([da[i], newX, newY]); text.push(da[i]); } @@ -2141,8 +2220,8 @@

    jspdf.js

    var maxWidth = (maxWidth !== 0) ? maxWidth : pageWidth; for (var i = 0, len = da.length; i < len; i++) { - newY = (i === 0) ? (pageHeight - y) * k : -leading; - newX = (i === 0) ? x * k : 0; + newY = (i === 0) ? getVerticalCoordinate(y) : -leading; + newX = (i === 0) ? getHorizontalCoordinate(x) : 0; if (i < (len - 1)) { wordSpacingPerLine.push(((maxWidth - lineWidths[i]) / (da[i].split(" ").length - 1) * k).toFixed(2)); } @@ -2194,25 +2273,25 @@

    jspdf.js

    for (var i = 0; i < len; i++) { wordSpacing = ''; - if ((Object.prototype.toString.call(da[i]) !== '[object Array]')) { - posX = (parseFloat(x * k)).toFixed(2); - posY = (parseFloat((pageHeight - y) * k)).toFixed(2); + if (!Array.isArray(da[i])) { + posX = getHorizontalCoordinate(x); + posY = getVerticalCoordinate(y); content = (((isHex) ? "<" : "(")) + da[i] + ((isHex) ? ">" : ")"); - } else if (Object.prototype.toString.call(da[i]) === '[object Array]') { - posX = (parseFloat(da[i][1])).toFixed(2); - posY = (parseFloat(da[i][2])).toFixed(2); + } else { + posX = parseFloat(da[i][1]); + posY = parseFloat(da[i][2]); content = (((isHex) ? "<" : "(")) + da[i][0] + ((isHex) ? ">" : ")"); variant = 1; } if (wordSpacingPerLine !== undefined && wordSpacingPerLine[i] !== undefined) { wordSpacing = wordSpacingPerLine[i] + " Tw\n"; } - //TODO: Kind of a hack? + if (transformationMatrix.length !== 0 && i === 0) { - text.push(wordSpacing + transformationMatrix.join(" ") + " " + posX + " " + posY + " Tm\n" + content); + text.push(wordSpacing + transformationMatrix.join(" ") + " " + posX.toFixed(2) + " " + posY.toFixed(2) + " Tm\n" + content); } else if (variant === 1 || (variant === 0 && i === 0)) { - text.push(wordSpacing + posX + " " + posY + " Td\n" + content); + text.push(wordSpacing + posX.toFixed(2) + " " + posY.toFixed(2) + " Td\n" + content); } else { text.push(wordSpacing + content); } @@ -2234,6 +2313,7 @@

    jspdf.js

    result += "ET"; out(result); + usedFonts[activeFontKey] = true; return scope; }; @@ -2266,7 +2346,7 @@

    jspdf.js

    * @param {string} rule * @returns {jsPDF} * @memberOf jsPDF - * @description all .clip() after calling drawing ops with a style argument of null + * @description All .clip() after calling drawing ops with a style argument of null. */ var clip = API.__private__.clip = API.clip = function (rule) { // Call .clip() after calling drawing ops with a style argument of null @@ -2326,7 +2406,7 @@

    jspdf.js

    }; /** - * Draw a line on the current page + * Draw a line on the current page. * * @name line * @function @@ -2356,8 +2436,8 @@

    jspdf.js

    * * @example .lines([[2,2],[-2,2],[1,1,2,2,3,3],[2,1]], 212,110, [1,1], 'F', false) // line, line, bezier curve, line * @param {Array} lines Array of *vector* shifts as pairs (lines) or sextets (cubic bezier curves). - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. * @param {number} scale (Defaults to [1.0,1.0]) x,y Scaling factor for all vectors. Elements can be any floating number Sub-one makes drawing smaller. Over-one grows the drawing. Negative flips the direction. * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. * @param {boolean} closed If true, the path is closed with a straight line from the end of the last curve to the starting point. @@ -2369,7 +2449,6 @@

    jspdf.js

    */ var lines = API.__private__.lines = API.lines = function (lines, x, y, scale, style, closed) { var scalex, scaley, i, l, leg, x2, y2, x3, y3, x4, y4, tmp; - var pageHeight = pagesContext[currentPage].dimensions.height; // Pre-August-2012 the order of arguments was function(x, y, lines, scale, style) // in effort to make all calls have similar signature like @@ -2391,7 +2470,7 @@

    jspdf.js

    } // starting point - out(f3(x * k) + ' ' + f3((pageHeight - y) * k) + ' m '); + out(f3(getHorizontalCoordinate(x)) + ' ' + f3(getVerticalCoordinate(y)) + ' m '); scalex = scale[0]; scaley = scale[1]; @@ -2408,7 +2487,7 @@

    jspdf.js

    // simple line x4 = leg[0] * scalex + x4; // here last x4 was prior ending point y4 = leg[1] * scaley + y4; // here last y4 was prior ending point - out(f3(x4 * k) + ' ' + f3((pageHeight - y4) * k) + ' l'); + out(f3(getHorizontalCoordinate(x4)) + ' ' + f3(getVerticalCoordinate(y4)) + ' l'); } else { // bezier curve x2 = leg[0] * scalex + x4; // here last x4 is prior ending point @@ -2418,12 +2497,12 @@

    jspdf.js

    x4 = leg[4] * scalex + x4; // here last x4 was prior ending point y4 = leg[5] * scaley + y4; // here last y4 was prior ending point out( - f3(x2 * k) + ' ' + - f3((pageHeight - y2) * k) + ' ' + - f3(x3 * k) + ' ' + - f3((pageHeight - y3) * k) + ' ' + - f3(x4 * k) + ' ' + - f3((pageHeight - y4) * k) + ' c'); + f3(getHorizontalCoordinate(x2)) + ' ' + + f3(getVerticalCoordinate(y2)) + ' ' + + f3(getHorizontalCoordinate(x3)) + ' ' + + f3(getVerticalCoordinate(y3)) + ' ' + + f3(getHorizontalCoordinate(x4)) + ' ' + + f3(getVerticalCoordinate(y4)) + ' c'); } } @@ -2439,12 +2518,12 @@

    jspdf.js

    }; /** - * Adds a rectangle to PDF + * Adds a rectangle to PDF. * - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {number} w Width (in units declared at inception of PDF document) - * @param {number} h Height (in units declared at inception of PDF document) + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} w Width (in units declared at inception of PDF document). + * @param {number} h Height (in units declared at inception of PDF document). * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. * @function * @instance @@ -2458,8 +2537,8 @@

    jspdf.js

    } out([ - f2(x * k), - f2((pagesContext[currentPage].dimensions.height - y) * k), + f2(getHorizontalCoordinate(x)), + f2(getVerticalCoordinate(y)), f2(w * k), f2(-h * k), 're' @@ -2473,14 +2552,14 @@

    jspdf.js

    }; /** - * Adds a triangle to PDF + * Adds a triangle to PDF. * - * @param {number} x1 Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y1 Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {number} x2 Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y2 Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {number} x3 Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y3 Coordinate (in units declared at inception of PDF document) against upper edge of the page + * @param {number} x1 Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y1 Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} x2 Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y2 Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} x3 Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y3 Coordinate (in units declared at inception of PDF document) against upper edge of the page. * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. * @function * @instance @@ -2507,14 +2586,14 @@

    jspdf.js

    }; /** - * Adds a rectangle with rounded corners to PDF + * Adds a rectangle with rounded corners to PDF. * - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {number} w Width (in units declared at inception of PDF document) - * @param {number} h Height (in units declared at inception of PDF document) - * @param {number} rx Radius along x axis (in units declared at inception of PDF document) - * @param {number} rx Radius along y axis (in units declared at inception of PDF document) + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} w Width (in units declared at inception of PDF document). + * @param {number} h Height (in units declared at inception of PDF document). + * @param {number} rx Radius along x axis (in units declared at inception of PDF document). + * @param {number} ry Radius along y axis (in units declared at inception of PDF document). * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. * @function * @instance @@ -2546,12 +2625,12 @@

    jspdf.js

    }; /** - * Adds an ellipse to PDF + * Adds an ellipse to PDF. * - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {number} rx Radius along x axis (in units declared at inception of PDF document) - * @param {number} rx Radius along y axis (in units declared at inception of PDF document) + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} rx Radius along x axis (in units declared at inception of PDF document). + * @param {number} ry Radius along y axis (in units declared at inception of PDF document). * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. * @function * @instance @@ -2565,45 +2644,44 @@

    jspdf.js

    } var lx = 4 / 3 * (Math.SQRT2 - 1) * rx, ly = 4 / 3 * (Math.SQRT2 - 1) * ry; - var pageHeight = pagesContext[currentPage].dimensions.height; out([ - f2((x + rx) * k), - f2((pageHeight - y) * k), + f2(getHorizontalCoordinate(x + rx)), + f2(getVerticalCoordinate(y)), 'm', - f2((x + rx) * k), - f2((pageHeight - (y - ly)) * k), - f2((x + lx) * k), - f2((pageHeight - (y - ry)) * k), - f2(x * k), - f2((pageHeight - (y - ry)) * k), + f2(getHorizontalCoordinate(x + rx)), + f2(getVerticalCoordinate(y - ly)), + f2(getHorizontalCoordinate(x + lx)), + f2(getVerticalCoordinate(y - ry)), + f2(getHorizontalCoordinate(x)), + f2(getVerticalCoordinate(y - ry)), 'c' ].join(' ')); out([ - f2((x - lx) * k), - f2((pageHeight - (y - ry)) * k), - f2((x - rx) * k), - f2((pageHeight - (y - ly)) * k), - f2((x - rx) * k), - f2((pageHeight - y) * k), + f2(getHorizontalCoordinate(x - lx)), + f2(getVerticalCoordinate(y - ry)), + f2(getHorizontalCoordinate(x - rx)), + f2(getVerticalCoordinate(y - ly)), + f2(getHorizontalCoordinate(x - rx)), + f2(getVerticalCoordinate(y)), 'c' ].join(' ')); out([ - f2((x - rx) * k), - f2((pageHeight - (y + ly)) * k), - f2((x - lx) * k), - f2((pageHeight - (y + ry)) * k), - f2(x * k), - f2((pageHeight - (y + ry)) * k), + f2(getHorizontalCoordinate(x - rx)), + f2(getVerticalCoordinate(y + ly)), + f2(getHorizontalCoordinate(x - lx)), + f2(getVerticalCoordinate(y + ry)), + f2(getHorizontalCoordinate(x)), + f2(getVerticalCoordinate(y + ry)), 'c' ].join(' ')); out([ - f2((x + lx) * k), - f2((pageHeight - (y + ry)) * k), - f2((x + rx) * k), - f2((pageHeight - (y + ly)) * k), - f2((x + rx) * k), - f2((pageHeight - y) * k), + f2(getHorizontalCoordinate(x + lx)), + f2(getVerticalCoordinate(y + ry)), + f2(getHorizontalCoordinate(x + rx)), + f2(getVerticalCoordinate(y + ly)), + f2(getHorizontalCoordinate(x + rx)), + f2(getVerticalCoordinate(y)), 'c' ].join(' ')); @@ -2615,11 +2693,11 @@

    jspdf.js

    }; /** - * Adds an circle to PDF + * Adds an circle to PDF. * - * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page - * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page - * @param {number} r Radius (in units declared at inception of PDF document) + * @param {number} x Coordinate (in units declared at inception of PDF document) against left edge of the page. + * @param {number} y Coordinate (in units declared at inception of PDF document) against upper edge of the page. + * @param {number} r Radius (in units declared at inception of PDF document). * @param {string} style A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument. * @function * @instance @@ -2638,8 +2716,8 @@

    jspdf.js

    * Sets text font face, variant for upcoming text elements. * See output of jsPDF.getFontList() for possible font names, styles. * - * @param {string} fontName Font name or family. Example: "times" - * @param {string} fontStyle Font style or variant. Example: "italic" + * @param {string} fontName Font name or family. Example: "times". + * @param {string} fontStyle Font style or variant. Example: "italic". * @function * @instance * @returns {jsPDF} @@ -2658,7 +2736,7 @@

    jspdf.js

    * while keeping the font face or family same. * See output of jsPDF.getFontList() for possible font names, styles. * - * @param {string} style Font style or variant. Example: "italic" + * @param {string} style Font style or variant. Example: "italic". * @function * @instance * @returns {jsPDF} @@ -2704,7 +2782,7 @@

    jspdf.js

    /** * Add a custom font to the current instance. * - * @property {string} postScriptName PDF specification full name for the font + * @property {string} postScriptName PDF specification full name for the font. * @property {string} id PDF-document-instance-specific label assinged to the font. * @property {string} fontStyle Style of the Font. * @property {Object} encoding Encoding_name-to-Font_metrics_object mapping. @@ -2722,7 +2800,7 @@

    jspdf.js

    /** * Sets line width for upcoming lines. * - * @param {number} width Line width (in units declared at inception of PDF document) + * @param {number} width Line width (in units declared at inception of PDF document). * @function * @instance * @returns {jsPDF} @@ -2734,16 +2812,49 @@

    jspdf.js

    return this; }; - var lineHeightFactor = options.lineHeight || 1.15; + /** + * Sets the dash pattern for upcoming lines. + * + * To reset the settings simply call the method without any parameters. + * @param {array} dashArray The pattern of the line, expects numbers. + * @param {number} dashPhase The phase at which the dash pattern starts. + * @function + * @instance + * @returns {jsPDF} + * @memberOf jsPDF + * @name setLineDash + */ + var setLineDash = API.__private__.setLineDash = jsPDF.API.setLineDash = function (dashArray, dashPhase) { + dashArray = dashArray || []; + dashPhase = dashPhase || 0; + + if (isNaN(dashPhase) || !Array.isArray(dashArray)) { + throw new Error('Invalid arguments passed to jsPDF.setLineDash'); + } + + dashArray = dashArray.map(function (x) {return (x * k).toFixed(3)}).join(' '); + dashPhase = parseFloat((dashPhase * k).toFixed(3)); + + out('[' + dashArray + '] ' + dashPhase + ' d'); + return this; + }; + + var lineHeightFactor; + + var getLineHeight = API.__private__.getLineHeight = API.getLineHeight = function () { + return activeFontSize * lineHeightFactor; + }; + + var lineHeightFactor; - var getLineHeight = API.__private__.getLineHeight = function () { + var getLineHeight = API.__private__.getLineHeight = API.getLineHeight = function () { return activeFontSize * lineHeightFactor; }; /** - * Sets the LineHeightFactor, + * Sets the LineHeightFactor of proportion. * - * @param {number} value of proportion. default: 1.25 + * @param {number} value LineHeightFactor value. Default: 1.15. * @function * @instance * @returns {jsPDF} @@ -2751,7 +2862,7 @@

    jspdf.js

    * @name setLineHeightFactor */ var setLineHeightFactor = API.__private__.setLineHeightFactor = API.setLineHeightFactor = function (value) { - value = value || 1.25; + value = value || 1.15; if (typeof value === "number") { lineHeightFactor = value; } @@ -2759,7 +2870,7 @@

    jspdf.js

    }; /** - * Gets the LineHeightFactor, default: 1.25 + * Gets the LineHeightFactor, default: 1.15. * * @function * @instance @@ -2770,13 +2881,23 @@

    jspdf.js

    var getLineHeightFactor = API.__private__.getLineHeightFactor = API.getLineHeightFactor = function () { return lineHeightFactor; }; + + setLineHeightFactor(options.lineHeight); var getHorizontalCoordinate = API.__private__.getHorizontalCoordinate = function (value) { - return f2(value * k); + return value * k; }; var getVerticalCoordinate = API.__private__.getVerticalCoordinate = function (value) { - return f2((pagesContext[currentPage].dimensions.height - value) * k); + return pagesContext[currentPage].mediaBox.topRightY - pagesContext[currentPage].mediaBox.bottomLeftY - (value * k); + }; + + var getHorizontalCoordinateString = API.__private__.getHorizontalCoordinateString = function (value) { + return f2(value * k); + }; + + var getVerticalCoordinateString = API.__private__.getVerticalCoordinateString = function (value) { + return f2(pagesContext[currentPage].mediaBox.topRightY - pagesContext[currentPage].mediaBox.bottomLeftY - (value * k)); }; var strokeColor = options.strokeColor || '0 G'; @@ -2821,10 +2942,10 @@

    jspdf.js

    * floating point nearest to binary representation) it is highly advised to * communicate the fractional numbers as String types, not JavaScript Number type. * - * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF' - * @param {Number|String} ch2 Color channel value - * @param {Number|String} ch3 Color channel value - * @param {Number|String} ch4 Color channel value + * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'. + * @param {Number|String} ch2 Color channel value. + * @param {Number|String} ch3 Color channel value. + * @param {Number|String} ch4 Color channel value. * * @function * @instance @@ -2888,10 +3009,10 @@

    jspdf.js

    * floating point nearest to binary representation) it is highly advised to * communicate the fractional numbers as String types, not JavaScript Number type. * - * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF' - * @param {Number|String} ch2 Color channel value - * @param {Number|String} ch3 Color channel value - * @param {Number|String} ch4 Color channel value + * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'. + * @param {Number|String} ch2 Color channel value. + * @param {Number|String} ch3 Color channel value. + * @param {Number|String} ch4 Color channel value. * * @function * @instance @@ -2954,10 +3075,10 @@

    jspdf.js

    * floating point nearest to binary representation) it is highly advised to * communicate the fractional numbers as String types, not JavaScript Number type. * - * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF' - * @param {Number|String} ch2 Color channel value - * @param {Number|String} ch3 Color channel value - * @param {Number|String} ch4 Color channel value + * @param {Number|String} ch1 Color channel value or {string} ch1 color value in hexadecimal, example: '#FFFFFF'. + * @param {Number|String} ch2 Color channel value. + * @param {Number|String} ch3 Color channel value. + * @param {Number|String} ch4 Color channel value. * * @function * @instance @@ -2982,7 +3103,7 @@

    jspdf.js

    var activeCharSpace = options.charSpace || 0; /** - * Get global value of CharSpace + * Get global value of CharSpace. * * @function * @instance @@ -2995,7 +3116,7 @@

    jspdf.js

    }; /** - * Set global value of CharSpace + * Set global value of CharSpace. * * @param {number} charSpace * @function @@ -3038,10 +3159,10 @@

    jspdf.js

    }; /** - * Sets the line cap styles - * See {jsPDF.CapJoinStyles} for variants + * Sets the line cap styles. + * See {jsPDF.CapJoinStyles} for variants. * - * @param {String|Number} style A string or number identifying the type of line cap + * @param {String|Number} style A string or number identifying the type of line cap. * @function * @instance * @returns {jsPDF} @@ -3061,10 +3182,10 @@

    jspdf.js

    var lineJoinID = 0; /** - * Sets the line join styles - * See {jsPDF.CapJoinStyles} for variants + * Sets the line join styles. + * See {jsPDF.CapJoinStyles} for variants. * - * @param {String|Number} style A string or number identifying the type of line join + * @param {String|Number} style A string or number identifying the type of line join. * @function * @instance * @returns {jsPDF} @@ -3082,34 +3203,68 @@

    jspdf.js

    return this; }; + var miterLimit; /** - * Generates the PDF document. - * - * If `type` argument is undefined, output is raw body of resulting PDF returned as a string. - * - * @param {string} type A string identifying one of the possible output types. - * @param {Object} options An object providing some additional signalling to PDF generator. + * Sets the miterLimit property, which effects the maximum miter length. * + * @param {number} length The length of the miter * @function * @instance * @returns {jsPDF} * @memberOf jsPDF - * @name output + * @name setMiterLimit */ - API.output = output; + var setMiterLimit = API.__private__.setMiterLimit = API.setMiterLimit = function (length) { + length = length || 0; + if (isNaN(length)) { + throw new Error('Invalid argument passed to jsPDF.setMiterLimit'); + } + miterLimit = parseFloat(f2(length * k)); + out(miterLimit + ' M'); + + return this; + }; /** - * Saves as PDF document. An alias of jsPDF.output('save', 'filename.pdf') + * Saves as PDF document. An alias of jsPDF.output('save', 'filename.pdf'). + * Uses FileSaver.js-method saveAs. * * @memberOf jsPDF * @name save * @function * @instance * @param {string} filename The filename including extension. + * @param {Object} options An Object with additional options, possible options: 'returnPromise'. * @returns {jsPDF} jsPDF-instance */ - API.save = function (filename) { - API.output('save', filename); + API.save = function (filename, options) { + filename = filename || 'generated.pdf'; + + options = options || {}; + options.returnPromise = options.returnPromise || false; + + if (options.returnPromise === false) { + saveAs(getBlob(buildDocument()), filename); + if (typeof saveAs.unload === 'function') { + if (global.setTimeout) { + setTimeout(saveAs.unload, 911); + } + } + } else { + return new Promise(function(resolve, reject) { + try { + var result = saveAs(getBlob(buildDocument()), filename); + if (typeof saveAs.unload === 'function') { + if (global.setTimeout) { + setTimeout(saveAs.unload, 911); + } + } + resolve(result); + } catch(e) { + reject(e.message); + } + }); + } }; // applying plugins (more methods) ON TOP of built-in API. @@ -3163,9 +3318,12 @@

    jspdf.js

    'getCharSpace': getCharSpace, 'getTextColor': getTextColor, 'getLineHeight': getLineHeight, + 'getLineHeightFactor' : getLineHeightFactor, 'write': write, - 'getCoordinateString': getHorizontalCoordinate, - 'getVerticalCoordinateString': getVerticalCoordinate, + 'getHorizontalCoordinate': getHorizontalCoordinate, + 'getVerticalCoordinate': getVerticalCoordinate, + 'getCoordinateString': getHorizontalCoordinateString, + 'getVerticalCoordinateString': getVerticalCoordinateString, 'collections': {}, 'newObject': newObject, 'newAdditionalObject': newAdditionalObject, @@ -3183,16 +3341,16 @@

    jspdf.js

    'scaleFactor': k, 'pageSize': { getWidth: function () { - return pagesContext[currentPage].dimensions.width; + return (pagesContext[currentPage].mediaBox.topRightX - pagesContext[currentPage].mediaBox.bottomLeftX) / k; }, setWidth: function (value) { - pagesContext[currentPage].dimensions.width = value; + pagesContext[currentPage].mediaBox.topRightX = (value * k) + pagesContext[currentPage].mediaBox.bottomLeftX; }, getHeight: function () { - return pagesContext[currentPage].dimensions.height; + return (pagesContext[currentPage].mediaBox.topRightY - pagesContext[currentPage].mediaBox.bottomLeftY) / k; }, setHeight: function (value) { - pagesContext[currentPage].dimensions.height = value; + pagesContext[currentPage].mediaBox.topRightY = (value * k) + pagesContext[currentPage].mediaBox.bottomLeftY; }, }, 'output': output, @@ -3200,7 +3358,9 @@

    jspdf.js

    'pages': pages, 'out': out, 'f2': f2, + 'f3': f3, 'getPageInfo': getPageInfo, + 'getPageInfoByObjId': getPageInfoByObjId, 'getCurrentPageInfo': getCurrentPageInfo, 'getPDFVersion': getPdfVersion, 'hasHotfix': hasHotfix //Expose the hasHotfix check so plugins can also check them. @@ -3208,20 +3368,20 @@

    jspdf.js

    Object.defineProperty(API.internal.pageSize, 'width', { get: function () { - return pagesContext[currentPage].dimensions.width + return (pagesContext[currentPage].mediaBox.topRightX - pagesContext[currentPage].mediaBox.bottomLeftX) / k; }, set: function (value) { - pagesContext[currentPage].dimensions.width = value; + pagesContext[currentPage].mediaBox.topRightX = (value * k) + pagesContext[currentPage].mediaBox.bottomLeftX; }, enumerable: true, configurable: true }); Object.defineProperty(API.internal.pageSize, 'height', { get: function () { - return pagesContext[currentPage].dimensions.height + return (pagesContext[currentPage].mediaBox.topRightY - pagesContext[currentPage].mediaBox.bottomLeftY) / k; }, set: function (value) { - pagesContext[currentPage].dimensions.height = value; + pagesContext[currentPage].mediaBox.topRightY = (value * k) + pagesContext[currentPage].mediaBox.bottomLeftY; }, enumerable: true, configurable: true @@ -3267,12 +3427,12 @@

    jspdf.js

    events: [] }; /** - * The version of jsPDF + * The version of jsPDF. * @name version - * @type {number} + * @type {string} * @memberOf jsPDF */ - jsPDF.version = ("${versionID}" === ("${vers" + "ionID}")) ? "0.0.0" : "${versionID}"; + jsPDF.version = '0.0.0'; if (typeof define === 'function' && define.amd) { define('jsPDF', function () { @@ -3303,7 +3463,7 @@

    jspdf.js


    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:33 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/libs_BMPDecoder.js.html b/docs/libs_BMPDecoder.js.html index dddbab1e6..af1438ccf 100644 --- a/docs/libs_BMPDecoder.js.html +++ b/docs/libs_BMPDecoder.js.html @@ -26,7 +26,7 @@
    @@ -318,17 +318,6 @@

    libs/BMPDecoder.js

    BmpDecoder.prototype.getData = function() { return this.data; }; - -try { - module.exports = function(bmpData) { - var decoder = new BmpDecoder(bmpData); - return { - data: decoder.getData(), - width: decoder.width, - height: decoder.height - }; - }; -} catch(e) { } // CommonJS.
    @@ -343,7 +332,7 @@

    libs/BMPDecoder.js


    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:33 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/modules_bidiEngine.js.html b/docs/libs_bidiEngine.js.html similarity index 67% rename from docs/modules_bidiEngine.js.html rename to docs/libs_bidiEngine.js.html index b7538ec80..f83be7bdd 100644 --- a/docs/modules_bidiEngine.js.html +++ b/docs/libs_bidiEngine.js.html @@ -3,7 +3,7 @@ - modules/bidiEngine.js - Documentation + libs/bidiEngine.js - Documentation @@ -26,12 +26,12 @@
    -

    modules/bidiEngine.js

    +

    libs/bidiEngine.js

    @@ -730,7 +730,7 @@

    modules/bidiEngine.js


    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:33 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormButton.html b/docs/module-AcroForm-AcroFormButton.html index a9b74cd33..4c6ae9b76 100644 --- a/docs/module-AcroForm-AcroFormButton.html +++ b/docs/module-AcroForm-AcroFormButton.html @@ -26,7 +26,7 @@
    @@ -72,7 +72,7 @@

    new Acr
    Source:
    @@ -176,7 +176,7 @@

    colorSource:
    @@ -262,7 +262,7 @@

    defaultVa
    Source:
    @@ -345,7 +345,7 @@

    fieldNameSource:
    @@ -428,7 +428,7 @@

    fontNameSource:
    @@ -511,7 +511,7 @@

    fontSizeSource:
    @@ -594,7 +594,7 @@

    fontStyleSource:
    @@ -677,7 +677,7 @@

    (readonly) Source:
    @@ -755,7 +755,7 @@

    (readonly
    Source:
    @@ -833,7 +833,7 @@

    heightSource:
    @@ -916,7 +916,7 @@

    maxFontSiz
    Source:
    @@ -999,7 +999,7 @@

    noExportSource:
    @@ -1082,7 +1082,7 @@

    pageSource:
    @@ -1160,7 +1160,7 @@

    readOnlySource:
    @@ -1243,7 +1243,7 @@

    requiredSource:
    @@ -1326,7 +1326,7 @@

    showWh
    Source:
    @@ -1410,7 +1410,7 @@

    textAlignSource:
    @@ -1494,7 +1494,7 @@

    valueSource:
    @@ -1577,7 +1577,7 @@

    widthSource:
    @@ -1660,7 +1660,7 @@

    xSource:
    @@ -1743,7 +1743,7 @@

    ySource:
    @@ -1835,7 +1835,7 @@
    Type:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:33 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormCheckBox.html b/docs/module-AcroForm-AcroFormCheckBox.html index 9d28e97e8..e410e08ab 100644 --- a/docs/module-AcroForm-AcroFormCheckBox.html +++ b/docs/module-AcroForm-AcroFormCheckBox.html @@ -26,7 +26,7 @@
    @@ -72,7 +72,7 @@

    new A
    Source:
    @@ -178,7 +178,7 @@

    appear
    Source:
    @@ -256,7 +256,7 @@

    captionSource:
    @@ -341,7 +341,7 @@

    colorSource:
    @@ -427,7 +427,7 @@

    defaultVa
    Source:
    @@ -510,7 +510,7 @@

    fieldNameSource:
    @@ -593,7 +593,7 @@

    fontNameSource:
    @@ -676,7 +676,7 @@

    fontSizeSource:
    @@ -759,7 +759,7 @@

    fontStyleSource:
    @@ -842,7 +842,7 @@

    (readonly) Source:
    @@ -920,7 +920,7 @@

    (readonly
    Source:
    @@ -998,7 +998,7 @@

    heightSource:
    @@ -1081,7 +1081,7 @@

    maxFontSiz
    Source:
    @@ -1164,7 +1164,7 @@

    noExportSource:
    @@ -1247,7 +1247,7 @@

    noToggle
    Source:
    @@ -1325,7 +1325,7 @@

    pageSource:
    @@ -1403,7 +1403,7 @@

    pushButton<
    Source:
    @@ -1481,7 +1481,7 @@

    radioSource:
    @@ -1559,7 +1559,7 @@

    radioIsU
    Source:
    @@ -1637,7 +1637,7 @@

    readOnlySource:
    @@ -1720,7 +1720,7 @@

    requiredSource:
    @@ -1803,7 +1803,7 @@

    showWh
    Source:
    @@ -1887,7 +1887,7 @@

    textAlignSource:
    @@ -1971,7 +1971,7 @@

    valueSource:
    @@ -2054,7 +2054,7 @@

    widthSource:
    @@ -2137,7 +2137,7 @@

    xSource:
    @@ -2220,7 +2220,7 @@

    ySource:
    @@ -2312,7 +2312,7 @@
    Type:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:33 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormChoiceField.html b/docs/module-AcroForm-AcroFormChoiceField.html index 8ed50645f..7b76ec2e6 100644 --- a/docs/module-AcroForm-AcroFormChoiceField.html +++ b/docs/module-AcroForm-AcroFormChoiceField.html @@ -26,7 +26,7 @@
    @@ -72,7 +72,7 @@

    ne
    Source:
    @@ -176,7 +176,7 @@

    colorSource:
    @@ -262,7 +262,7 @@

    defaultVa
    Source:
    @@ -345,7 +345,7 @@

    fieldNameSource:
    @@ -428,7 +428,7 @@

    fontNameSource:
    @@ -511,7 +511,7 @@

    fontSizeSource:
    @@ -594,7 +594,7 @@

    fontStyleSource:
    @@ -677,7 +677,7 @@

    (readonly) Source:
    @@ -755,7 +755,7 @@

    (readonly
    Source:
    @@ -833,7 +833,7 @@

    heightSource:
    @@ -916,7 +916,7 @@

    maxFontSiz
    Source:
    @@ -999,7 +999,7 @@

    noExportSource:
    @@ -1082,7 +1082,7 @@

    pageSource:
    @@ -1160,7 +1160,7 @@

    readOnlySource:
    @@ -1243,7 +1243,7 @@

    requiredSource:
    @@ -1326,7 +1326,7 @@

    showWh
    Source:
    @@ -1410,7 +1410,7 @@

    textAlignSource:
    @@ -1494,7 +1494,7 @@

    valueSource:
    @@ -1577,7 +1577,7 @@

    widthSource:
    @@ -1660,7 +1660,7 @@

    xSource:
    @@ -1743,7 +1743,7 @@

    ySource:
    @@ -1835,7 +1835,7 @@
    Type:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormComboBox.html b/docs/module-AcroForm-AcroFormComboBox.html index 36385f292..598d714d8 100644 --- a/docs/module-AcroForm-AcroFormComboBox.html +++ b/docs/module-AcroForm-AcroFormComboBox.html @@ -26,7 +26,7 @@
    @@ -72,7 +72,7 @@

    new A
    Source:
    @@ -180,7 +180,7 @@

    colorSource:
    @@ -266,7 +266,7 @@

    comboSource:
    @@ -349,7 +349,7 @@

    comm
    Source:
    @@ -433,7 +433,7 @@

    defaultVa
    Source:
    @@ -516,7 +516,7 @@

    doNotS
    Source:
    @@ -599,7 +599,7 @@

    editSource:
    @@ -682,7 +682,7 @@

    fieldNameSource:
    @@ -765,7 +765,7 @@

    fontNameSource:
    @@ -848,7 +848,7 @@

    fontSizeSource:
    @@ -931,7 +931,7 @@

    fontStyleSource:
    @@ -1014,7 +1014,7 @@

    (readonly) Source:
    @@ -1092,7 +1092,7 @@

    (readonly
    Source:
    @@ -1170,7 +1170,7 @@

    heightSource:
    @@ -1253,7 +1253,7 @@

    maxFontSiz
    Source:
    @@ -1336,7 +1336,7 @@

    multiSelec
    Source:
    @@ -1419,7 +1419,7 @@

    noExportSource:
    @@ -1502,7 +1502,7 @@

    pageSource:
    @@ -1580,7 +1580,7 @@

    readOnlySource:
    @@ -1663,7 +1663,7 @@

    requiredSource:
    @@ -1746,7 +1746,7 @@

    showWh
    Source:
    @@ -1830,7 +1830,7 @@

    sortSource:
    @@ -1913,7 +1913,7 @@

    textAlignSource:
    @@ -1997,7 +1997,7 @@

    topIndexSource:
    @@ -2080,7 +2080,7 @@

    valueSource:
    @@ -2163,7 +2163,7 @@

    widthSource:
    @@ -2246,7 +2246,7 @@

    xSource:
    @@ -2329,7 +2329,7 @@

    ySource:
    @@ -2422,7 +2422,7 @@

    addOptionSource:
    @@ -2556,7 +2556,7 @@

    getOptions<
    Source:
    @@ -2663,7 +2663,7 @@

    removeOpt
    Source:
    @@ -2820,7 +2820,7 @@

    setOptions<
    Source:
    @@ -2957,7 +2957,7 @@

    Parameters:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormEditBox.html b/docs/module-AcroForm-AcroFormEditBox.html index 1c2fd8692..191591408 100644 --- a/docs/module-AcroForm-AcroFormEditBox.html +++ b/docs/module-AcroForm-AcroFormEditBox.html @@ -26,7 +26,7 @@
    @@ -72,7 +72,7 @@

    new Ac
    Source:
    @@ -182,7 +182,7 @@

    colorSource:
    @@ -268,7 +268,7 @@

    comboSource:
    @@ -351,7 +351,7 @@

    comm
    Source:
    @@ -435,7 +435,7 @@

    defaultVa
    Source:
    @@ -518,7 +518,7 @@

    doNotS
    Source:
    @@ -601,7 +601,7 @@

    editSource:
    @@ -684,7 +684,7 @@

    fieldNameSource:
    @@ -767,7 +767,7 @@

    fontNameSource:
    @@ -850,7 +850,7 @@

    fontSizeSource:
    @@ -933,7 +933,7 @@

    fontStyleSource:
    @@ -1016,7 +1016,7 @@

    (readonly) Source:
    @@ -1094,7 +1094,7 @@

    (readonly
    Source:
    @@ -1172,7 +1172,7 @@

    heightSource:
    @@ -1255,7 +1255,7 @@

    maxFontSiz
    Source:
    @@ -1338,7 +1338,7 @@

    multiSelec
    Source:
    @@ -1421,7 +1421,7 @@

    noExportSource:
    @@ -1504,7 +1504,7 @@

    pageSource:
    @@ -1582,7 +1582,7 @@

    readOnlySource:
    @@ -1665,7 +1665,7 @@

    requiredSource:
    @@ -1748,7 +1748,7 @@

    showWh
    Source:
    @@ -1832,7 +1832,7 @@

    sortSource:
    @@ -1915,7 +1915,7 @@

    textAlignSource:
    @@ -1999,7 +1999,7 @@

    topIndexSource:
    @@ -2082,7 +2082,7 @@

    valueSource:
    @@ -2165,7 +2165,7 @@

    widthSource:
    @@ -2248,7 +2248,7 @@

    xSource:
    @@ -2331,7 +2331,7 @@

    ySource:
    @@ -2424,7 +2424,7 @@

    addOptionSource:
    @@ -2558,7 +2558,7 @@

    getOptions<
    Source:
    @@ -2665,7 +2665,7 @@

    removeOpt
    Source:
    @@ -2822,7 +2822,7 @@

    setOptions<
    Source:
    @@ -2959,7 +2959,7 @@

    Parameters:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormField.html b/docs/module-AcroForm-AcroFormField.html index 98f443aeb..8412c2917 100644 --- a/docs/module-AcroForm-AcroFormField.html +++ b/docs/module-AcroForm-AcroFormField.html @@ -26,7 +26,7 @@
    @@ -76,7 +76,7 @@

    new Acro
    Source:
    @@ -178,7 +178,7 @@

    new Acro
    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormListBox.html b/docs/module-AcroForm-AcroFormListBox.html index 889b303d3..6ffd06619 100644 --- a/docs/module-AcroForm-AcroFormListBox.html +++ b/docs/module-AcroForm-AcroFormListBox.html @@ -26,7 +26,7 @@
    @@ -72,7 +72,7 @@

    new Ac
    Source:
    @@ -178,7 +178,7 @@

    colorSource:
    @@ -264,7 +264,7 @@

    comboSource:
    @@ -347,7 +347,7 @@

    comm
    Source:
    @@ -431,7 +431,7 @@

    defaultVa
    Source:
    @@ -514,7 +514,7 @@

    doNotS
    Source:
    @@ -597,7 +597,7 @@

    editSource:
    @@ -680,7 +680,7 @@

    fieldNameSource:
    @@ -763,7 +763,7 @@

    fontNameSource:
    @@ -846,7 +846,7 @@

    fontSizeSource:
    @@ -929,7 +929,7 @@

    fontStyleSource:
    @@ -1012,7 +1012,7 @@

    (readonly) Source:
    @@ -1090,7 +1090,7 @@

    (readonly
    Source:
    @@ -1168,7 +1168,7 @@

    heightSource:
    @@ -1251,7 +1251,7 @@

    maxFontSiz
    Source:
    @@ -1334,7 +1334,7 @@

    multiSelec
    Source:
    @@ -1417,7 +1417,7 @@

    noExportSource:
    @@ -1500,7 +1500,7 @@

    pageSource:
    @@ -1578,7 +1578,7 @@

    readOnlySource:
    @@ -1661,7 +1661,7 @@

    requiredSource:
    @@ -1744,7 +1744,7 @@

    showWh
    Source:
    @@ -1828,7 +1828,7 @@

    sortSource:
    @@ -1911,7 +1911,7 @@

    textAlignSource:
    @@ -1995,7 +1995,7 @@

    topIndexSource:
    @@ -2078,7 +2078,7 @@

    valueSource:
    @@ -2161,7 +2161,7 @@

    widthSource:
    @@ -2244,7 +2244,7 @@

    xSource:
    @@ -2327,7 +2327,7 @@

    ySource:
    @@ -2420,7 +2420,7 @@

    addOptionSource:
    @@ -2554,7 +2554,7 @@

    getOptions<
    Source:
    @@ -2661,7 +2661,7 @@

    removeOpt
    Source:
    @@ -2818,7 +2818,7 @@

    setOptions<
    Source:
    @@ -2955,7 +2955,7 @@

    Parameters:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormPDFObject.html b/docs/module-AcroForm-AcroFormPDFObject.html index 69e6b2419..3d6ac4bf3 100644 --- a/docs/module-AcroForm-AcroFormPDFObject.html +++ b/docs/module-AcroForm-AcroFormPDFObject.html @@ -26,7 +26,7 @@
    @@ -76,7 +76,7 @@

    new
    Source:
    @@ -174,7 +174,7 @@

    new
    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormPasswordField.html b/docs/module-AcroForm-AcroFormPasswordField.html index 7f67b89c0..22b6d0108 100644 --- a/docs/module-AcroForm-AcroFormPasswordField.html +++ b/docs/module-AcroForm-AcroFormPasswordField.html @@ -26,7 +26,7 @@
    @@ -72,7 +72,7 @@

    Source:
    @@ -178,7 +178,7 @@

    colorSource:
    @@ -264,7 +264,7 @@

    combSource:
    @@ -342,7 +342,7 @@

    defaultVa
    Source:
    @@ -425,7 +425,7 @@

    doNotScrol
    Source:
    @@ -503,7 +503,7 @@

    doNotS
    Source:
    @@ -581,7 +581,7 @@

    fieldNameSource:
    @@ -664,7 +664,7 @@

    fileSelect<
    Source:
    @@ -742,7 +742,7 @@

    fontNameSource:
    @@ -825,7 +825,7 @@

    fontSizeSource:
    @@ -908,7 +908,7 @@

    fontStyleSource:
    @@ -991,7 +991,7 @@

    (readonly) Source:
    @@ -1069,7 +1069,7 @@

    (readonly
    Source:
    @@ -1147,7 +1147,7 @@

    heightSource:
    @@ -1230,7 +1230,7 @@

    maxFontSiz
    Source:
    @@ -1313,7 +1313,7 @@

    maxLengthSource:
    @@ -1391,7 +1391,7 @@

    multilineSource:
    @@ -1469,7 +1469,7 @@

    noExportSource:
    @@ -1552,7 +1552,7 @@

    pageSource:
    @@ -1630,7 +1630,7 @@

    passwordSource:
    @@ -1709,7 +1709,7 @@

    readOnlySource:
    @@ -1792,7 +1792,7 @@

    requiredSource:
    @@ -1875,7 +1875,7 @@

    richTextSource:
    @@ -1953,7 +1953,7 @@

    showWh
    Source:
    @@ -2037,7 +2037,7 @@

    textAlignSource:
    @@ -2121,7 +2121,7 @@

    valueSource:
    @@ -2204,7 +2204,7 @@

    widthSource:
    @@ -2287,7 +2287,7 @@

    xSource:
    @@ -2370,7 +2370,7 @@

    ySource:
    @@ -2462,7 +2462,7 @@
    Type:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormPushButton.html b/docs/module-AcroForm-AcroFormPushButton.html index 9cab14838..b948d380a 100644 --- a/docs/module-AcroForm-AcroFormPushButton.html +++ b/docs/module-AcroForm-AcroFormPushButton.html @@ -26,7 +26,7 @@
    @@ -72,7 +72,7 @@

    new
    Source:
    @@ -178,7 +178,7 @@

    appear
    Source:
    @@ -256,7 +256,7 @@

    captionSource:
    @@ -341,7 +341,7 @@

    colorSource:
    @@ -427,7 +427,7 @@

    defaultVa
    Source:
    @@ -510,7 +510,7 @@

    fieldNameSource:
    @@ -593,7 +593,7 @@

    fontNameSource:
    @@ -676,7 +676,7 @@

    fontSizeSource:
    @@ -759,7 +759,7 @@

    fontStyleSource:
    @@ -842,7 +842,7 @@

    (readonly) Source:
    @@ -920,7 +920,7 @@

    (readonly
    Source:
    @@ -998,7 +998,7 @@

    heightSource:
    @@ -1081,7 +1081,7 @@

    maxFontSiz
    Source:
    @@ -1164,7 +1164,7 @@

    noExportSource:
    @@ -1247,7 +1247,7 @@

    noToggle
    Source:
    @@ -1325,7 +1325,7 @@

    pageSource:
    @@ -1403,7 +1403,7 @@

    pushButton<
    Source:
    @@ -1481,7 +1481,7 @@

    radioSource:
    @@ -1559,7 +1559,7 @@

    radioIsU
    Source:
    @@ -1637,7 +1637,7 @@

    readOnlySource:
    @@ -1720,7 +1720,7 @@

    requiredSource:
    @@ -1803,7 +1803,7 @@

    showWh
    Source:
    @@ -1887,7 +1887,7 @@

    textAlignSource:
    @@ -1971,7 +1971,7 @@

    valueSource:
    @@ -2054,7 +2054,7 @@

    widthSource:
    @@ -2137,7 +2137,7 @@

    xSource:
    @@ -2220,7 +2220,7 @@

    ySource:
    @@ -2312,7 +2312,7 @@
    Type:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormRadioButton.html b/docs/module-AcroForm-AcroFormRadioButton.html index 086507d76..69fd7f13a 100644 --- a/docs/module-AcroForm-AcroFormRadioButton.html +++ b/docs/module-AcroForm-AcroFormRadioButton.html @@ -26,7 +26,7 @@
    @@ -72,7 +72,7 @@

    ne
    Source:
    @@ -178,7 +178,7 @@

    appear
    Source:
    @@ -256,7 +256,7 @@

    captionSource:
    @@ -341,7 +341,7 @@

    colorSource:
    @@ -427,7 +427,7 @@

    defaultVa
    Source:
    @@ -510,7 +510,7 @@

    fieldNameSource:
    @@ -593,7 +593,7 @@

    fontNameSource:
    @@ -676,7 +676,7 @@

    fontSizeSource:
    @@ -759,7 +759,7 @@

    fontStyleSource:
    @@ -842,7 +842,7 @@

    (readonly) Source:
    @@ -920,7 +920,7 @@

    (readonly
    Source:
    @@ -998,7 +998,7 @@

    heightSource:
    @@ -1081,7 +1081,7 @@

    maxFontSiz
    Source:
    @@ -1164,7 +1164,7 @@

    noExportSource:
    @@ -1247,7 +1247,7 @@

    noToggle
    Source:
    @@ -1325,7 +1325,7 @@

    pageSource:
    @@ -1403,7 +1403,7 @@

    pushButton<
    Source:
    @@ -1481,7 +1481,7 @@

    radioSource:
    @@ -1559,7 +1559,7 @@

    radioIsU
    Source:
    @@ -1637,7 +1637,7 @@

    readOnlySource:
    @@ -1720,7 +1720,7 @@

    requiredSource:
    @@ -1803,7 +1803,7 @@

    showWh
    Source:
    @@ -1887,7 +1887,7 @@

    textAlignSource:
    @@ -1971,7 +1971,7 @@

    valueSource:
    @@ -2054,7 +2054,7 @@

    widthSource:
    @@ -2137,7 +2137,7 @@

    xSource:
    @@ -2220,7 +2220,7 @@

    ySource:
    @@ -2312,7 +2312,7 @@
    Type:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm-AcroFormTextField.html b/docs/module-AcroForm-AcroFormTextField.html index ddc987a70..074efcd0f 100644 --- a/docs/module-AcroForm-AcroFormTextField.html +++ b/docs/module-AcroForm-AcroFormTextField.html @@ -26,7 +26,7 @@
    @@ -72,7 +72,7 @@

    new
    Source:
    @@ -176,7 +176,7 @@

    colorSource:
    @@ -262,7 +262,7 @@

    defaultVa
    Source:
    @@ -345,7 +345,7 @@

    fieldNameSource:
    @@ -428,7 +428,7 @@

    fontNameSource:
    @@ -511,7 +511,7 @@

    fontSizeSource:
    @@ -594,7 +594,7 @@

    fontStyleSource:
    @@ -677,7 +677,7 @@

    (readonly) Source:
    @@ -755,7 +755,7 @@

    (readonly
    Source:
    @@ -833,7 +833,7 @@

    heightSource:
    @@ -916,7 +916,7 @@

    maxFontSiz
    Source:
    @@ -999,7 +999,7 @@

    noExportSource:
    @@ -1082,7 +1082,7 @@

    pageSource:
    @@ -1160,7 +1160,7 @@

    readOnlySource:
    @@ -1243,7 +1243,7 @@

    requiredSource:
    @@ -1326,7 +1326,7 @@

    showWh
    Source:
    @@ -1410,7 +1410,7 @@

    textAlignSource:
    @@ -1494,7 +1494,7 @@

    valueSource:
    @@ -1577,7 +1577,7 @@

    widthSource:
    @@ -1660,7 +1660,7 @@

    xSource:
    @@ -1743,7 +1743,7 @@

    ySource:
    @@ -1835,7 +1835,7 @@
    Type:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-AcroForm.html b/docs/module-AcroForm.html index 05fd8107e..1d98f3f8e 100644 --- a/docs/module-AcroForm.html +++ b/docs/module-AcroForm.html @@ -26,7 +26,7 @@
    @@ -202,7 +202,7 @@

    (in
    Source:
    @@ -275,7 +275,7 @@

    addButtonSource:
    @@ -424,7 +424,7 @@

    addChoi
    Source:
    @@ -569,7 +569,7 @@

    addFieldSource:
    @@ -720,7 +720,7 @@

    addTextFi
    Source:
    @@ -872,7 +872,7 @@

    Returns:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:33 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-addImage.html b/docs/module-addImage.html index 123c18692..3f9cd6786 100644 --- a/docs/module-addImage.html +++ b/docs/module-addImage.html @@ -26,7 +26,7 @@
    @@ -90,7 +90,7 @@

    (inner) addI
    Source:
    @@ -417,7 +417,7 @@

    (inner)
    Source:
    @@ -570,7 +570,7 @@

    (i
    Source:
    @@ -721,7 +721,7 @@

    (in
    Source:
    @@ -872,7 +872,7 @@

    (in
    Source:
    @@ -1023,7 +1023,7 @@

    (inner) Source:
    @@ -1434,7 +1434,7 @@
    Returns:
    -

    (inner) extractInfoFromBase64DataURI(dataUrl) → {Array}

    +

    (inner) extractImageFromDataUrl(dataUrl) → {Array}

    @@ -1446,7 +1446,7 @@

    Source:
    @@ -1605,7 +1605,7 @@

    Source:
    @@ -1862,7 +1862,7 @@
    Parameters:
    -

    imageData as base64 encoded DataUrl or arraybuffer

    +

    imageData as binary String or arraybuffer

    @@ -1946,7 +1946,7 @@

    (inner) <
    Source:
    @@ -2093,7 +2093,7 @@

    (inner) Source:
    @@ -2244,7 +2244,7 @@

    (inner) Source:
    @@ -2395,7 +2395,7 @@

    (inner) isSt
    Source:
    @@ -2529,181 +2529,6 @@

    Returns:
    - -

    (inner) loadImageFile(path, sync, callback)

    - - - - - - -
    - - -
    Source:
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    path - - -string - - - -
    sync - - -boolean - - - -
    callback - - -function - - - -
    - - - - - - - - - - - - - - - - - - - -

    (inner) sHashCode(str) → {string}

    @@ -2717,7 +2542,7 @@

    (inner) sHa
    Source:
    @@ -2864,7 +2689,7 @@

    (inner)
    Source:
    @@ -2966,7 +2791,7 @@

    (inne
    Source:
    @@ -3120,7 +2945,7 @@
    Returns:

    - Documentation generated by JSDoc 3.5.5 on Sun Nov 11 2018 06:03:34 GMT+0100 (GMT+01:00) using the docdash theme. + Documentation generated by JSDoc 3.5.5 on Tue Dec 25 2018 20:34:21 GMT+0100 (GMT+01:00) using the docdash theme.
    diff --git a/docs/module-annotations.html b/docs/module-annotations.html index 05ac71214..e9eacf89b 100644 --- a/docs/module-annotations.html +++ b/docs/module-annotations.html @@ -26,7 +26,7 @@
    @@ -191,7 +191,7 @@

    (inner) Source:
    @@ -307,108 +307,6 @@
    Parameters:
    - -

    (inner) getLineHeight() → {number}

    - - - - - - -
    - - -
    Source:
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Returns:
    - - -
    -

    lineHeight

    -
    - - - -
    -
    - Type -
    -
    - -number - - -
    -
    - - - - - - - -

    (inner) getTextWidth(text) → {number}

    @@ -422,7 +320,7 @@

    (inner)
    Source:
    @@ -573,7 +471,7 @@

    -

    Sets or returns the style of the end caps for a line

    +

    Y Position of page breaks.

    +
    Type:
    +
      +
    • + +number + + +
    • +
    + @@ -477,7 +970,7 @@
    Properties:
    -

    (inner) lineWidth

    +

    (inner) pageWrapXEnabled :boolean

    @@ -488,7 +981,7 @@

    (inner) lin
    Source:
    @@ -517,7 +1010,7 @@

    (inner) lin
    Default Value:
      -
    • 1
    • +
    • false
    @@ -530,65 +1023,19 @@

    (inner) lin -

    Properties:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    Type:
    +
      +
    • - -
    - - - - -
    NameTypeDescription
    lineWidth - - -number - -

    The current line width, in pixels

    - - - - - - -
    -

    Sets or returns the current line width

    -
    +boolean +

  • + @@ -597,7 +1044,7 @@
    Properties:
    -

    (inner) pageWrapX :number

    +

    (inner) pageWrapYEnabled :boolean

    @@ -608,7 +1055,7 @@

    (inner) pag
    Source:
    @@ -637,7 +1084,7 @@

    (inner) pag
    Default Value:
      -
    • 9999999
    • +
    • true
    @@ -658,7 +1105,7 @@

    Type: