From f3b98633b7a0fc7caf274644b5100cf7866f735d Mon Sep 17 00:00:00 2001 From: Eduardo Pinho Date: Fri, 19 Jun 2020 11:10:46 +0100 Subject: [PATCH] Update fromHTML for Unicode text support - unquote computed CSS property values for a proper font family detection - Use pdfEscape16 for rendering Identity-H text, turning plain strings into hexadecimal glyph codes - remove extra left marging indentation which was conflicting with some html layouts --- dist/jspdf.debug.js | 105 +- dist/jspdf.min.js | 20 +- dist/jspdf.node.debug.js | 76 +- dist/jspdf.node.min.js | 14 +- package-lock.json | 2683 ++++++++++++++++++++++++++--------- src/deprecated/from_html.js | 29 +- 6 files changed, 2174 insertions(+), 753 deletions(-) diff --git a/dist/jspdf.debug.js b/dist/jspdf.debug.js index 2a0469727..42d14d77d 100644 --- a/dist/jspdf.debug.js +++ b/dist/jspdf.debug.js @@ -6,8 +6,8 @@ /** @license * * jsPDF - PDF Document creation from JavaScript - * Version 2.1.1 Built on 2019-10-11T08:56:17.234Z - * CommitID 0dd01f177e + * Version 1.5.3 Built on 2020-06-19T10:01:49.186Z + * CommitID 2c5e6c7cb0 * * Copyright (c) 2010-2018 James Hall , https://github.com/MrRio/jsPDF * 2015-2018 yWorks GmbH, http://www.yworks.com @@ -37,6 +37,8 @@ */ function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; @@ -1420,6 +1422,10 @@ */ var Matrix = function Matrix(sx, shy, shx, sy, tx, ty) { + if (!(this instanceof Matrix)) { + return new Matrix(sx, shy, shx, sy, tx, ty); + } + var _matrix = []; /** * @name sx @@ -1827,8 +1833,13 @@ */ - API.ShadingPattern = function (type, coords, colors, gState, matrix) { - advancedApiModeTrap("ShadingPattern"); // see putPattern() for information how they are realized + API.ShadingPattern = function ShadingPattern(type, coords, colors, gState, matrix) { + advancedApiModeTrap("ShadingPattern"); + + if (!(this instanceof ShadingPattern)) { + return new ShadingPattern(type, coords, colors, gState, matrix); + } // see putPattern() for information how they are realized + this.type = type === "axial" ? 2 : 3; this.coords = coords; @@ -1851,8 +1862,13 @@ */ - API.TilingPattern = function (boundingBox, xStep, yStep, gState, matrix) { + API.TilingPattern = function TilingPattern(boundingBox, xStep, yStep, gState, matrix) { advancedApiModeTrap("TilingPattern"); + + if (!(this instanceof TilingPattern)) { + return new TilingPattern(boundingBox, xStep, yStep, gState, matrix); + } + this.boundingBox = boundingBox; this.xStep = xStep; this.yStep = yStep; @@ -3480,7 +3496,7 @@ * * @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 (indexed starting at 1). * @example * doc = jsPDF() * doc.addPage() @@ -5500,7 +5516,10 @@ */ - API.GState = function (parameters) { + API.GState = function GState(parameters) { + if (!(this instanceof GState)) { + return new GState(parameters); + } /** * @name GState#opacity * @type {any} @@ -5510,6 +5529,8 @@ * @name GState#stroke-opacity * @type {any} */ + + var supported = "opacity,stroke-opacity".split(","); for (var p in parameters) { @@ -5935,8 +5956,7 @@ * @instance * @param {string} filename The filename including extension. * @param {Object} options An Object with additional options, possible options: 'returnPromise'. - * @returns {jsPDF} jsPDF-instance - */ + * @returns {jsPDF} jsPDF-instance */ API.save = function (filename, options) { @@ -6146,7 +6166,7 @@ * @memberof jsPDF# */ - jsPDF.version = '2.1.1'; + jsPDF.version = '1.5.3'; if (typeof define === "function" && define.amd) { define(function () { @@ -8994,9 +9014,6 @@ globalObj["AcroForm"] = { Appearance: AcroFormAppearance }; - } else { - // eslint-disable-next-line no-console - console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already. This avoids conflicts with the already used framework."); } jsPDFAPI.AcroFormChoiceField = AcroFormChoiceField; @@ -11125,7 +11142,7 @@ * @param {Integer} [y] top-position for top-left corner of table * @param {Object[]} [data] An 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.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) @@ -11289,10 +11306,16 @@ var padding = this.internal.__cell__.padding; var fontSize = this.internal.__cell__.table_font_size; var scaleFactor = this.internal.scaleFactor; - return Object.keys(model).map(function (value) { - return _typeof(value) === "object" ? value.text : value; - }).map(function (value) { - return this.splitTextToSize(value, columnWidths[value] - padding - padding); + return Object.keys(model).map(function (key) { + return [key, model[key]]; + }).map(function (item) { + var key = item[0]; + var value = item[1]; + return _typeof(value) === "object" ? [key, value.text] : [key, value]; + }).map(function (item) { + var key = item[0]; + var value = item[1]; + return this.splitTextToSize(value, columnWidths[key] - padding - padding); }, this).map(function (value) { return this.getLineHeightFactor() * value.length * fontSize / scaleFactor + padding + padding; }, this).reduce(function (pv, cv) { @@ -13828,7 +13851,8 @@ x: 0, y: 0, html2canvas: {}, - jsPDF: {} + jsPDF: {}, + backgroundColor: "transparent" } }; /* ----- FROM / TO ----- */ @@ -13925,7 +13949,7 @@ right: 0, top: 0, margin: "auto", - backgroundColor: "white" + backgroundColor: this.opt.backgroundColor }; // Set the overlay to hidden (could be changed in the future to provide a print preview). var source = cloneNode(this.prop.src, this.opt.html2canvas.javascriptEnabled); @@ -14972,13 +14996,13 @@ * Color Allowed Interpretation Type Bit Depths - 0 1,2,4,8,16 Each pixel is a grayscale sample. - 2 8,16 Each pixel is an R,G,B triple. - 3 1,2,4,8 Each pixel is a palette index; + 0 1,2,4,8,16 Each pixel is a grayscale sample. + 2 8,16 Each pixel is an R,G,B triple. + 3 1,2,4,8 Each pixel is a palette index; a PLTE chunk must appear. - 4 8,16 Each pixel is a grayscale sample, + 4 8,16 Each pixel is a grayscale sample, followed by an alpha sample. - 6 8,16 Each pixel is an R,G,B triple, + 6 8,16 Each pixel is an R,G,B triple, followed by an alpha sample. */ @@ -15823,6 +15847,8 @@ } else { if (doKerning && _typeof(kerning[char_code]) === "object" && !isNaN(parseInt(kerning[char_code][prior_char_code], 10))) { kerningValue = kerning[char_code][prior_char_code] / kerningFractionOf; + } else { + kerningValue = 0; } output.push((widths[char_code] || default_char_width) / widthsFractionOf + kerningValue); @@ -17747,6 +17773,8 @@ * 2014 Wolfgang Gassler, https://github.com/woolfg * 2014 Steven Spungin, https://github.com/flamenco * + * Copyright (c) 2020 BMD Software, https://github.com/BMDSoftware + * * @license * * ==================================================================== @@ -17913,7 +17941,13 @@ prop = prop.replace(/-\D/g, function (match) { return match.charAt(1).toUpperCase(); }); - return compCSS[prop]; + var val = compCSS[prop]; + + if (val.startsWith('"') && val.endsWith('"')) { + val = val.slice(1, val.length - 1); + } + + return val; }; }(element); @@ -18578,9 +18612,21 @@ if (style["word-spacing"] !== undefined && style["word-spacing"] > 0) { this.pdf.internal.write(style["word-spacing"].toFixed(2), "Tw"); + } // pdfEscape is enough for text document properties, + // but not for Unicode text that we want to render. + // So if the font is Identity-H, we use `pdfEscape16` to convert the text + // to hexadecimal glyph codes. + + + var pdfStream; + + if (font.encoding === 'Identity-H') { + pdfStream = "<" + this.pdf.pdfEscape16(text, font) + "> Tj"; + } else { + pdfStream = "(" + this.pdf.internal.pdfEscape(text) + ") Tj"; } - this.pdf.internal.write("/" + font.id, (defaultFontSize * style["font-size"]).toFixed(2), "Tf", "(" + this.pdf.internal.pdfEscape(text) + ") Tj"); //set the word spacing back to neutral => 0 + this.pdf.internal.write("/" + font.id, (defaultFontSize * style["font-size"]).toFixed(2), "Tf", pdfStream); //set the word spacing back to neutral => 0 if (style["word-spacing"] !== undefined) { this.pdf.internal.write(0, "Tw"); @@ -18700,11 +18746,10 @@ wantedIndent = this.pdf.internal.getCoordinateString(line[0][1]["margin-left"]); indentMove = wantedIndent - currentIndent; currentIndent = wantedIndent; - } + } //move the cursor - var indentMore = Math.max(blockstyle["margin-left"] || 0, 0) * fontToUnitRatio; //move the cursor - out(indentMove + indentMore, (-1 * defaultFontSize * maxLineHeight).toFixed(2), "Td"); + out(indentMove, (-1 * defaultFontSize * maxLineHeight).toFixed(2), "Td"); i = 0; l = line.length; diff --git a/dist/jspdf.min.js b/dist/jspdf.min.js index 0f53a8fb3..2539992cb 100644 --- a/dist/jspdf.min.js +++ b/dist/jspdf.min.js @@ -2,8 +2,8 @@ /** @license * * jsPDF - PDF Document creation from JavaScript - * Version 2.1.1 Built on 2019-10-11T08:56:17.234Z - * CommitID 0dd01f177e + * Version 1.5.3 Built on 2020-06-19T10:01:49.186Z + * CommitID 2c5e6c7cb0 * * Copyright (c) 2010-2018 James Hall , https://github.com/MrRio/jsPDF * 2015-2018 yWorks GmbH, http://www.yworks.com @@ -30,14 +30,14 @@ * Contributor(s): * siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango, * kim3er, mfo, alnorth, Flamenco - */function on(t){return(on="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"!==on(t.console)){t.console={};for(var e,n,r=t.console,i=function(){},a=["memory"],o="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=a.pop();)r[e]||(r[e]={});for(;n=o.pop();)r[n]||(r[n]=i)}var s,u,l,c,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function f(){}void 0===t.btoa&&(t.btoa=function(t){var e,n,r,i,a,o=0,s=0,u="",l=[];if(!t)return t;for(;e=(a=t.charCodeAt(o++)<<16|t.charCodeAt(o++)<<8|t.charCodeAt(o++))>>18&63,n=a>>12&63,r=a>>6&63,i=63&a,l[s++]=h.charAt(e)+h.charAt(n)+h.charAt(r)+h.charAt(i),o>16&255,n=o>>8&255,r=255&o,l[u++]=64==i?String.fromCharCode(e):64==a?String.fromCharCode(e,n):String.fromCharCode(e,n,r),s>>0,r=new Array(n),i=1>>0,i=0;if(2<=arguments.length)e=arguments[1];else{for(;i>>0,i=0;if(2<=arguments.length)e=arguments[1];else{for(;i>>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>18&63,n=a>>12&63,r=a>>6&63,i=63&a,l[s++]=h.charAt(e)+h.charAt(n)+h.charAt(r)+h.charAt(i),o>16&255,n=o>>8&255,r=255&o,l[u++]=64==i?String.fromCharCode(e):64==a?String.fromCharCode(e,n):String.fromCharCode(e,n,r),s>>0,r=new Array(n),i=1>>0,i=0;if(2<=arguments.length)e=arguments[1];else{for(;i>>0,i=0;if(2<=arguments.length)e=arguments[1];else{for(;i>>0,i=0;i>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;it[u+1].offset;)u++;var c=t[u].offset,h=(n-c)/(t[u+1].offset-c),f=t[u].color,d=t[u+1].color;s+=B(Math.round((1-h)*f[0]+h*d[0]).toString(16))+B(Math.round((1-h)*f[1]+h*d[1]).toString(16))+B(Math.round((1-h)*f[2]+h*d[2]).toString(16))}return s.trim()}(t.colors,e),i=[];i.push({key:"FunctionType",value:"0"}),i.push({key:"Domain",value:"[0.0 1.0]"}),i.push({key:"Size",value:"["+e+"]"}),i.push({key:"BitsPerSample",value:"8"}),i.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),i.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ee({data:r,additionalKeyValues:i,alreadyAppliedFilters:["/ASCIIHexDecode"]}),st("endobj"),t.objectNumber=Gt(),st("<< /ShadingType "+t.type),st("/ColorSpace /DeviceRGB");var a="/Coords ["+at(parseFloat(t.coords[0]))+" "+at(parseFloat(t.coords[1]))+" ";2===t.type?a+=at(parseFloat(t.coords[2]))+" "+at(parseFloat(t.coords[3])):a+=at(parseFloat(t.coords[2]))+" "+at(parseFloat(t.coords[3]))+" "+at(parseFloat(t.coords[4]))+" "+at(parseFloat(t.coords[5])),st(a+="]"),t.matrix&&st("/Matrix ["+t.matrix.toString()+"]"),st("/Function "+n+" 0 R"),st("/Extend [true true]"),st(">>"),st("endobj")}function Mt(t,e){var n=Yt(),r=Gt();e.push({resourcesOid:n,objectOid:r}),t.objectNumber=r;var i=[];i.push({key:"Type",value:"/Pattern"}),i.push({key:"PatternType",value:"1"}),i.push({key:"PaintType",value:"1"}),i.push({key:"TilingType",value:"1"}),i.push({key:"BBox",value:"["+t.boundingBox.map(at).join(" ")+"]"}),i.push({key:"XStep",value:at(t.xStep)}),i.push({key:"YStep",value:at(t.yStep)}),i.push({key:"Resources",value:n+" 0 R"}),t.matrix&&i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),ee({data:t.stream,additionalKeyValues:i}),st("endobj")}function Tt(t){for(var e in t.objectNumber=Gt(),st("<<"),t)switch(e){case"opacity":st("/ca "+x(t[e]));break;case"stroke-opacity":st("/CA "+x(t[e]))}st(">>"),st("endobj")}function qt(t){Jt(t.resourcesOid,!0),st("<<"),st("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var t in st("/Font <<"),pt)!pt.hasOwnProperty(t)||(!1===c||!0===c&&et.hasOwnProperty(t))&&st("/"+t+" "+pt[t].objectNumber+" 0 R");st(">>")}(),function(){if(0>")}}(),function(t){if(0>")}}(t.objectOid),function(){if(0>")}}(),function(){for(var t in st("/XObject <<"),St)St.hasOwnProperty(t)&&0<=St[t].objectNumber&&st("/"+t+" "+St[t].objectNumber+" 0 R");At.publish("putXobjectDict"),st(">>")}(),st(">>"),st("endobj")}function Rt(){var t=[];!function(){for(var t in pt)!pt.hasOwnProperty(t)||(!1===c||!0===c&&et.hasOwnProperty(t))&&(n=pt[t],At.publish("putFont",{font:n,out:st,newObject:Gt,putStream:ee,pdfEscapeWithNeededParanthesis:e}),!0!==n.isAlreadyPutted&&(n.objectNumber=Gt(),st("<<"),st("/Type /Font"),st("/BaseFont /"+e(n.postScriptName)),st("/Subtype /Type1"),"string"==typeof n.encoding&&st("/Encoding /"+n.encoding),st("/FirstChar 32"),st("/LastChar 255"),st(">>"),st("endobj")));function e(t,e){return-1!==t.indexOf(" ")?"("+ie(t,e)+")":ie(t,e)}var n}(),function(){var t;for(t in yt)yt.hasOwnProperty(t)&&Tt(yt[t])}(),function(){for(var t in St)St.hasOwnProperty(t)&&Ot(St[t])}(),function(t){var e;for(e in bt)bt.hasOwnProperty(e)&&(bt[e]instanceof h.ShadingPattern?Et(bt[e]):bt[e]instanceof h.TilingPattern&&Mt(bt[e],t))}(t),At.publish("putResources"),t.forEach(qt),qt({resourcesOid:Zt,objectOid:Number.MAX_SAFE_INTEGER}),At.publish("postPutResources")}function Dt(t){gt[t.fontName]=gt[t.fontName]||{},gt[t.fontName][t.fontStyle]=t.id}function Ut(t,e,n,r,i){var a={id:"F"+(Object.keys(pt).length+1).toString(10),postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return At.publish("addFont",{font:a,instance:this}),pt[a.id]=a,Dt(a),a.id}function zt(t,e){var n,r,i;switch(a=e||a,"string"==typeof t&&(n=g(t.toLowerCase()),Array.isArray(n)&&(r=n[0],i=n[1])),Array.isArray(t)&&(r=t[0]*tt,i=t[1]*tt),isNaN(r)&&(r=o[0],i=o[1]),(14400>16&255,r=u>>8&255,i=255&u}if(void 0===r||void 0===a&&n===r&&r===i)if("string"==typeof n)e=n+" "+o[0];else switch(t.precision){case 2:e=x(n/255)+" "+o[0];break;case 3:default:e=N(n/255)+" "+o[0]}else if(void 0===a||"object"===on(a)){if(a&&!isNaN(a.a)&&0===a.a)return e=["1.","1.","1.",o[1]].join(" ");if("string"==typeof n)e=[n,r,i,o[1]].join(" ");else switch(t.precision){case 2:e=[x(n/255),x(r/255),x(i/255),o[1]].join(" ");break;default:case 3:e=[N(n/255),N(r/255),N(i/255),o[1]].join(" ")}}else if("string"==typeof n)e=[n,r,i,a,o[2]].join(" ");else switch(t.precision){case 2:e=[x(n),x(r),x(i),x(a),o[2]].join(" ");break;case 3:default:e=[N(n),N(r),N(i),N(a),o[2]].join(" ")}return e},te=h.__private__.getFilters=function(){return i},ee=h.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||te(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,a=e.length,o={};!0===n&&(n=["FlateEncode"]);var s=t.additionalKeyValues||[],u=(o=void 0!==ln.API.processDataByFilters?ln.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==o.data.length&&(s.push({key:"Length",value:o.data.length}),!0===i&&s.push({key:"Length1",value:a})),0!=u.length)if(u.split("/").length-1==1)s.push({key:"Filter",value:u});else{s.push({key:"Filter",value:"["+u+"]"});for(var l=0;l>"),0!==o.data.length&&(st("stream"),st(o.data),st("endstream"))},ne=h.__private__.putPage=function(t){var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;Jt(r,!0),st("<>"),st("endobj");var a=n.join("\n");return rt===nt&&(a+="\nQ"),Jt(i,!0),ee({data:a,filters:te()}),st("endobj"),r},re=h.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=Nt;t++)Lt[t].objId=Yt(),Lt[t].contentsObjId=Yt();for(t=1;t<=Nt;t++)n.push(ne({number:t,data:R[t],objId:Lt[t].objId,contentsObjId:Lt[t].contentsObjId,mediaBox:Lt[t].mediaBox,cropBox:Lt[t].cropBox,bleedBox:Lt[t].bleedBox,trimBox:Lt[t].trimBox,artBox:Lt[t].artBox,userUnit:Lt[t].userUnit,rootDictionaryObjId:Kt,resourceDictionaryObjId:Zt}));Jt(Kt,!0),st("<>"),st("endobj"),At.publish("postPutPages")},ie=h.__private__.pdfEscape=h.pdfEscape=function(t,e){return function(t,e){var n,r,i,a,o,s,u,l,c;if(i=(e=e||{}).sourceEncoding||"Unicode",o=e.outputEncoding,(e.autoencode||o)&&pt[ct].metadata&&pt[ct].metadata[i]&&pt[ct].metadata[i].encoding&&(a=pt[ct].metadata[i].encoding,!o&&pt[ct].encoding&&(o=pt[ct].encoding),!o&&a.codePages&&(o=a.codePages[0]),"string"==typeof o&&(o=a[o]),o)){for(u=!1,s=[],n=0,r=t.length;n>8&&(u=!0);t=s.join("")}for(n=t.length;void 0===u&&0!==n;)t.charCodeAt(n-1)>>8&&(u=!0),n--;if(!u)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(l-(c<<8))}return String.fromCharCode.apply(void 0,s)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ae=h.__private__.beginPage=function(t){R[++Nt]=[],Lt[Nt]={objId:0,contentsObjId:0,userUnit:Number(s),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},oe(Nt),z(R[I])},oe=function(t){0>"),st("endobj")},le=h.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||Kt;switch(Gt(),st("<<"),st("/Type /Catalog"),st("/Pages "+e+" 0 R"),G||(G="fullwidth"),G){case"fullwidth":st("/OpenAction [3 0 R /FitH null]");break;case"fullheight":st("/OpenAction [3 0 R /FitV null]");break;case"fullpage":st("/OpenAction [3 0 R /Fit]");break;case"original":st("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+G;"%"===n.substr(n.length-1)&&(G=parseInt(G)/100),"number"==typeof G&&st("/OpenAction [3 0 R /XYZ null null "+x(G)+"]")}switch(K||(K="continuous"),K){case"continuous":st("/PageLayout /OneColumn");break;case"single":st("/PageLayout /SinglePage");break;case"two":case"twoleft":st("/PageLayout /TwoColumnLeft");break;case"tworight":st("/PageLayout /TwoColumnRight")}J&&st("/PageMode /"+J),At.publish("putCatalog"),st(">>"),st("endobj")},ce=h.__private__.putTrailer=function(){st("trailer"),st("<<"),st("/Size "+(O+1)),st("/Root "+O+" 0 R"),st("/Info "+(O-1)+" 0 R"),st("/ID [ <"+A+"> <"+A+"> ]"),st(">>")},he=h.__private__.putHeader=function(){st("%PDF-"+f),st("%ºß¬à")},fe=h.__private__.putXRef=function(){var t="0000000000";st("xref"),st("0 "+(O+1)),st("0000000000 65535 f");for(var e=1;e<=O;e++){"function"==typeof E[e]?st((t+E[e]()).slice(-10)+" 00000 n"):void 0!==E[e]?st((t+E[e]).slice(-10)+" 00000 n"):st("0000000000 00000 n")}},de=h.__private__.buildDocument=function(){T=O=0,M=[],E=[],q=[],Kt=Yt(),Zt=Yt(),z(M),At.publish("buildDocument"),he(),re(),function(){At.publish("putAdditionalObjects");for(var t=0;t<\/script>