hoeditor-web 3.1.78 → 3.1.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/hoeditor.css +1 -17962
- package/lib/hoeditor.umd.js +109 -94
- package/lib/hoeditor.umd.min.js +7 -7
- package/package.json +1 -1
package/lib/hoeditor.umd.js
CHANGED
|
@@ -203888,8 +203888,8 @@ var es_string_match = __webpack_require__(4723);
|
|
|
203888
203888
|
var es_number_constructor = __webpack_require__(9653);
|
|
203889
203889
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.json.stringify.js
|
|
203890
203890
|
var es_json_stringify = __webpack_require__(38862);
|
|
203891
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=template&id=
|
|
203892
|
-
var
|
|
203891
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=template&id=3e304215&
|
|
203892
|
+
var HoDocvue_type_template_id_3e304215_render = function render() {
|
|
203893
203893
|
var _vm = this,
|
|
203894
203894
|
_c = _vm._self._c;
|
|
203895
203895
|
return _c('div', {
|
|
@@ -204090,7 +204090,7 @@ var HoDocvue_type_template_id_c9703c12_render = function render() {
|
|
|
204090
204090
|
}
|
|
204091
204091
|
}, [_vm._v("v " + _vm._s(_vm.version))])])])], 1);
|
|
204092
204092
|
};
|
|
204093
|
-
var
|
|
204093
|
+
var HoDocvue_type_template_id_3e304215_staticRenderFns = [];
|
|
204094
204094
|
|
|
204095
204095
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
|
|
204096
204096
|
var es_array_filter = __webpack_require__(57327);
|
|
@@ -207081,7 +207081,7 @@ var TextNode = __webpack_require__(27198);
|
|
|
207081
207081
|
// EXTERNAL MODULE: ./src/editor/dom/treeNode/ParagraphNode.ts
|
|
207082
207082
|
var ParagraphNode = __webpack_require__(67945);
|
|
207083
207083
|
;// CONCATENATED MODULE: ./src/components/version.ts
|
|
207084
|
-
/* harmony default export */ var version = ('3.1.
|
|
207084
|
+
/* harmony default export */ var version = ('3.1.79');
|
|
207085
207085
|
// EXTERNAL MODULE: ./src/components/controls/poperTipText/PoperTipText.vue + 5 modules
|
|
207086
207086
|
var PoperTipText = __webpack_require__(50987);
|
|
207087
207087
|
;// CONCATENATED MODULE: ./src/components/controls/poperTipText/index.ts
|
|
@@ -207529,7 +207529,10 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
|
|
|
207529
207529
|
if (type !== 'dblclick') return false;
|
|
207530
207530
|
var hoEditorFactory = HOEditorFactorys/* HOEditorFactorys */.b.instance().getFactory(this.hoEditorProvider.activeDocId);
|
|
207531
207531
|
var paintStatus = hoEditorFactory.drawTree.paintStatus;
|
|
207532
|
-
if (paintStatus
|
|
207532
|
+
if (paintStatus == DrawTree/* PaintState */.Dh.psPreview) {
|
|
207533
|
+
return false;
|
|
207534
|
+
}
|
|
207535
|
+
if (paintStatus === DrawTree/* PaintState */.Dh.psReadOnly) {
|
|
207533
207536
|
return false;
|
|
207534
207537
|
}
|
|
207535
207538
|
this.domRange = {
|
|
@@ -207540,12 +207543,12 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
|
|
|
207540
207543
|
_hoEditorFactory$vueC3 = (0,esm_slicedToArray/* default */.Z)(_hoEditorFactory$vueC2, 2),
|
|
207541
207544
|
isInTable = _hoEditorFactory$vueC3[0],
|
|
207542
207545
|
tableNode = _hoEditorFactory$vueC3[1];
|
|
207543
|
-
if (paintStatus ==
|
|
207546
|
+
if (paintStatus == DrawTree/* PaintState */.Dh.psEdit && isInTable) {
|
|
207544
207547
|
var result = hoEditorFactory.editController.canIsEdit(hoEditorFactory);
|
|
207545
207548
|
if (!result) return;
|
|
207546
207549
|
}
|
|
207547
207550
|
if (node instanceof SignNode/* SignNode */.N) {
|
|
207548
|
-
if (paintStatus ===
|
|
207551
|
+
if (paintStatus === DrawTree/* PaintState */.Dh.psDesign && !node.imgSrc && !node.fingerPrintSrc) {
|
|
207549
207552
|
this.hoEditorProvider.setControlProperty('sign', 'update', '');
|
|
207550
207553
|
return;
|
|
207551
207554
|
}
|
|
@@ -207560,7 +207563,7 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
|
|
|
207560
207563
|
this.poperType = '';
|
|
207561
207564
|
return;
|
|
207562
207565
|
} else {
|
|
207563
|
-
if (paintStatus ===
|
|
207566
|
+
if (paintStatus === DrawTree/* PaintState */.Dh.psReview) {
|
|
207564
207567
|
if ((node instanceof TextNode/* TextNode */.R || node instanceof MarkNode/* MarkNode */.j) && node.parentNode instanceof TextInputFieldNode/* TextInputFieldNode */.re) {
|
|
207565
207568
|
var parentNode = node.parentNode;
|
|
207566
207569
|
if (Number(parentNode.inputFieldType) === 0) {
|
|
@@ -207578,7 +207581,7 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
|
|
|
207578
207581
|
return false;
|
|
207579
207582
|
}
|
|
207580
207583
|
if (node instanceof DateTimeNode/* DateTimeNode */.Z) {
|
|
207581
|
-
if (paintStatus ===
|
|
207584
|
+
if (paintStatus === DrawTree/* PaintState */.Dh.psDesign) {
|
|
207582
207585
|
this.hoEditorProvider.setControlProperty('date', 'update', '');
|
|
207583
207586
|
this.hoEditorProvider.setUpdateNodeValue(node);
|
|
207584
207587
|
return;
|
|
@@ -207616,7 +207619,7 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
|
|
|
207616
207619
|
return false;
|
|
207617
207620
|
}
|
|
207618
207621
|
if (Number(_parentNode.inputFieldType) === 2) {
|
|
207619
|
-
if (paintStatus ===
|
|
207622
|
+
if (paintStatus === DrawTree/* PaintState */.Dh.psDesign) {
|
|
207620
207623
|
this.hoEditorProvider.setControlProperty('date', 'update', '');
|
|
207621
207624
|
return;
|
|
207622
207625
|
}
|
|
@@ -208022,10 +208025,10 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
|
|
|
208022
208025
|
});
|
|
208023
208026
|
;// CONCATENATED MODULE: ./src/components/HoDoc.vue?vue&type=script&lang=js&
|
|
208024
208027
|
/* harmony default export */ var components_HoDocvue_type_script_lang_js_ = (HoDocvue_type_script_lang_js_);
|
|
208025
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=style&index=0&id=
|
|
208028
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/HoDoc.vue?vue&type=style&index=0&id=3e304215&prod&lang=less&
|
|
208026
208029
|
// extracted by mini-css-extract-plugin
|
|
208027
208030
|
|
|
208028
|
-
;// CONCATENATED MODULE: ./src/components/HoDoc.vue?vue&type=style&index=0&id=
|
|
208031
|
+
;// CONCATENATED MODULE: ./src/components/HoDoc.vue?vue&type=style&index=0&id=3e304215&prod&lang=less&
|
|
208029
208032
|
|
|
208030
208033
|
;// CONCATENATED MODULE: ./src/components/HoDoc.vue
|
|
208031
208034
|
|
|
@@ -208038,8 +208041,8 @@ var defaultHeight = Math.floor(1122 * scaleXY) % 2 === 1 ? Math.floor(1122 * sca
|
|
|
208038
208041
|
|
|
208039
208042
|
var HoDoc_component = (0,componentNormalizer/* default */.Z)(
|
|
208040
208043
|
components_HoDocvue_type_script_lang_js_,
|
|
208041
|
-
|
|
208042
|
-
|
|
208044
|
+
HoDocvue_type_template_id_3e304215_render,
|
|
208045
|
+
HoDocvue_type_template_id_3e304215_staticRenderFns,
|
|
208043
208046
|
false,
|
|
208044
208047
|
null,
|
|
208045
208048
|
null,
|
|
@@ -212481,15 +212484,31 @@ var StructureConvert = /*#__PURE__*/function () {
|
|
|
212481
212484
|
if (pageSettings) {
|
|
212482
212485
|
// const pageProperty = new PageProperty(this._hoEditorFactory);
|
|
212483
212486
|
var pageProperty = hoEditorFactory.pageProperty;
|
|
212484
|
-
pageProperty.printDirection = Number(pageSettings.printDirection);
|
|
212485
212487
|
pageProperty.borderColor = pageSettings.borderColor;
|
|
212486
212488
|
pageProperty.isPaintBorder = pageSettings.isPaintBorder == 'true' ? true : false;
|
|
212487
212489
|
pageProperty.paintRowLine = Number(pageSettings.paintRowLine);
|
|
212488
|
-
pageProperty.pageSize = pageSettings.pageSize;
|
|
212489
212490
|
// pageProperty.commentWidthMm = Number(pageSettings.commentWidthMm);
|
|
212490
212491
|
// pageProperty.commentWidthMm = pageProperty.commentWidthMm;
|
|
212491
|
-
|
|
212492
|
-
|
|
212492
|
+
var widthMm = Number(pageSettings.widthMm);
|
|
212493
|
+
var heightMm = Number(pageSettings.heightMm);
|
|
212494
|
+
var isA5 = hoEditorFactory.vueController.isA5(widthMm, heightMm);
|
|
212495
|
+
if (isA5) {
|
|
212496
|
+
pageProperty.pageSize = 'A5';
|
|
212497
|
+
if (widthMm > heightMm) {
|
|
212498
|
+
pageProperty.widthMm = 210;
|
|
212499
|
+
pageProperty.heightMm = 148;
|
|
212500
|
+
pageProperty.printDirection = 1;
|
|
212501
|
+
} else {
|
|
212502
|
+
pageProperty.widthMm = 148;
|
|
212503
|
+
pageProperty.heightMm = 210;
|
|
212504
|
+
pageProperty.printDirection = 0;
|
|
212505
|
+
}
|
|
212506
|
+
} else {
|
|
212507
|
+
pageProperty.widthMm = widthMm;
|
|
212508
|
+
pageProperty.heightMm = heightMm;
|
|
212509
|
+
pageProperty.printDirection = Number(pageSettings.printDirection);
|
|
212510
|
+
pageProperty.pageSize = pageSettings.pageSize;
|
|
212511
|
+
}
|
|
212493
212512
|
pageProperty.source = pageSettings.source;
|
|
212494
212513
|
pageProperty.topMarginMm = Number(pageSettings.topMarginMm);
|
|
212495
212514
|
pageProperty.bottomMarginMm = Number(pageSettings.bottomMarginMm);
|
|
@@ -220904,7 +220923,11 @@ var VueController = /*#__PURE__*/function () {
|
|
|
220904
220923
|
node = node.previousLeaf();
|
|
220905
220924
|
}
|
|
220906
220925
|
whileText = this.getCaretPreviousNode(node);
|
|
220907
|
-
|
|
220926
|
+
if (whileText) {
|
|
220927
|
+
text = whileText + text;
|
|
220928
|
+
} else {
|
|
220929
|
+
text = "";
|
|
220930
|
+
}
|
|
220908
220931
|
}
|
|
220909
220932
|
if (text.length < 3) {
|
|
220910
220933
|
console.error("\u7B7E\u540D\u5143\u7D20\u524D\u6587\u672C\u5173\u952E\u5B57\u3010".concat(text, "\u3011,\u67E5\u8BE2\u8282\u70B9\u6B21\u6570\u3010").concat(count, "\u3011"));
|
|
@@ -223059,6 +223082,17 @@ var VueController = /*#__PURE__*/function () {
|
|
|
223059
223082
|
}
|
|
223060
223083
|
return "\n <html>\n <head>\n <style>\n html, body {\n padding: 0;\n margin: 0;\n background: #f2f4f7;\n }\n #hoEmrContent {\n margin: 20px auto;\n background: #fff;\n box-shadow: 0px 2px 12px 0px #c7cacf;\n }\n </style>\n </head>\n <body>\n <div id=\"hoEmrContent\" style='width: ".concat(hoEditorFactory.pageProperty.widthPixes, "px; padding: ").concat(padding, ";'>\n ").concat(content, "\n </div>\n </body>\n </html>");
|
|
223061
223084
|
}
|
|
223085
|
+
}, {
|
|
223086
|
+
key: "isA5",
|
|
223087
|
+
value: function isA5(widthMm, heightMm) {
|
|
223088
|
+
var A5_WIDTH = 210;
|
|
223089
|
+
var A5_HEIGHT = 148;
|
|
223090
|
+
var TOLERANCE = 5; // 误差值
|
|
223091
|
+
// 检查宽度和高度是否在允许的误差范围内
|
|
223092
|
+
var isWidthValid = Math.abs(widthMm - A5_WIDTH) <= TOLERANCE || Math.abs(widthMm - A5_HEIGHT) <= TOLERANCE;
|
|
223093
|
+
var isHeightValid = Math.abs(heightMm - A5_HEIGHT) <= TOLERANCE || Math.abs(heightMm - A5_WIDTH) <= TOLERANCE;
|
|
223094
|
+
return isWidthValid && isHeightValid;
|
|
223095
|
+
}
|
|
223062
223096
|
}]);
|
|
223063
223097
|
return VueController;
|
|
223064
223098
|
}();
|
|
@@ -228601,7 +228635,7 @@ function unzipSync(data) {
|
|
|
228601
228635
|
/** @license
|
|
228602
228636
|
*
|
|
228603
228637
|
* jsPDF - PDF Document creation from JavaScript
|
|
228604
|
-
* Version 2.
|
|
228638
|
+
* Version 2.5.1 Built on 2021-09-14T10:30:30.230Z
|
|
228605
228639
|
* CommitID 00000000
|
|
228606
228640
|
*
|
|
228607
228641
|
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
|
|
@@ -228990,7 +229024,7 @@ objectNumber=0;contentLength=0;content=[];offsets=[];additionalObjects=[];rootDi
|
|
|
228990
229024
|
* @memberof jsPDF#
|
|
228991
229025
|
* @name getR2L
|
|
228992
229026
|
*/API.__private__.getR2L=API.getR2L=function(){return R2L;};var zoomMode;// default: 1;
|
|
228993
|
-
var setZoomMode=API.__private__.setZoomMode=function(zoom){var validZoomModes=[undefined,null,"fullwidth","fullheight","fullpage","original"];if(
|
|
229027
|
+
var setZoomMode=API.__private__.setZoomMode=function(zoom){var validZoomModes=[undefined,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(zoom)){zoomMode=zoom;}else if(!isNaN(zoom)){zoomMode=parseInt(zoom,10);}else if(validZoomModes.indexOf(zoom)!==-1){zoomMode=zoom;}else{throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+zoom+'" is not recognized.');}};API.__private__.getZoomMode=function(){return zoomMode;};var pageMode;// default: 'UseOutlines';
|
|
228994
229028
|
var setPageMode=API.__private__.setPageMode=function(pmode){var validPageModes=[undefined,null,"UseNone","UseOutlines","UseThumbs","FullScreen"];if(validPageModes.indexOf(pmode)==-1){throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+pmode+'" is not recognized.');}pageMode=pmode;};API.__private__.getPageMode=function(){return pageMode;};var layoutMode;// default: 'continuous';
|
|
228995
229029
|
var setLayoutMode=API.__private__.setLayoutMode=function(layout){var validLayoutModes=[undefined,null,"continuous","single","twoleft","tworight","two"];if(validLayoutModes.indexOf(layout)==-1){throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+layout+'" is not recognized.');}layoutMode=layout;};API.__private__.getLayoutMode=function(){return layoutMode;};/**
|
|
228996
229030
|
* Set the display mode options of the page like zoom and layout.
|
|
@@ -229324,7 +229358,7 @@ if(bch>>8){/* something left after dividing by 256 second time */throw new Error
|
|
|
229324
229358
|
*/return to8bitStream(text,flags).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)");};var beginPage=API.__private__.beginPage=function(format){pages[++page]=[];pagesContext[page]={objId:0,contentsObjId:0,userUnit:Number(userUnit),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(format[0]),topRightY:Number(format[1])}};_setPage(page);setOutputDestination(pages[currentPage]);};var _addPage=function _addPage(parmFormat,parmOrientation){var dimensions,width,height;orientation=parmOrientation||orientation;if(typeof parmFormat==="string"){dimensions=getPageFormat(parmFormat.toLowerCase());if(Array.isArray(dimensions)){width=dimensions[0];height=dimensions[1];}}if(Array.isArray(parmFormat)){width=parmFormat[0]*scaleFactor;height=parmFormat[1]*scaleFactor;}if(isNaN(width)){width=format[0];height=format[1];}if(width>14400||height>14400){jspdf_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];switch(orientation.substr(0,1)){case"l":if(height>width){format=[height,width];}break;case"p":if(width>height){format=[height,width];}break;}beginPage(format);// Set line width
|
|
229325
229359
|
setLineWidth(lineWidth);// Set draw color
|
|
229326
229360
|
out(strokeColor);// resurrecting non-default line caps, joins
|
|
229327
|
-
if(lineCapID!==0){out(lineCapID+" J");}if(lineJoinID!==0){out(lineJoinID+" j");}events.publish("addPage",{pageNumber:page});};var _deletePage=function _deletePage(n){if(n>0&&n<=page){pages.splice(n,1);pagesContext.splice(n,1);page--;if(currentPage>page){currentPage=page;}
|
|
229361
|
+
if(lineCapID!==0){out(lineCapID+" J");}if(lineJoinID!==0){out(lineJoinID+" j");}events.publish("addPage",{pageNumber:page});};var _deletePage=function _deletePage(n){if(n>0&&n<=page){pages.splice(n,1);pagesContext.splice(n,1);page--;if(currentPage>page){currentPage=page;}this.setPage(currentPage);}};var _setPage=function _setPage(n){if(n>0&&n<=page){currentPage=n;}};var getNumberOfPages=API.__private__.getNumberOfPages=API.getNumberOfPages=function(){return pages.length-1;};/**
|
|
229328
229362
|
* Returns a document-specific font key - a label assigned to a
|
|
229329
229363
|
* font name + font type combination at the time the font was added
|
|
229330
229364
|
* to the font inventory.
|
|
@@ -229345,7 +229379,10 @@ if(!zoomMode)zoomMode="fullwidth";switch(zoomMode){case"fullwidth":out("/OpenAct
|
|
|
229345
229379
|
* UseThumbs : Thumbnail images visible
|
|
229346
229380
|
* FullScreen : Full-screen mode, with no menu bar, window controls, or any other window visible
|
|
229347
229381
|
*/out("/PageMode /"+pageMode);}events.publish("putCatalog");out(">>");out("endobj");};var putTrailer=API.__private__.putTrailer=function(){out("trailer");out("<<");out("/Size "+(objectNumber+1));// Root and Info must be the last and second last objects written respectively
|
|
229348
|
-
out("/Root "+objectNumber+" 0 R");out("/Info "+(objectNumber-1)+" 0 R");if(encryptionOptions!==null){out("/Encrypt "+encryption.oid+" 0 R");}out("/ID [ <"+fileId+"> <"+fileId+"> ]");out(">>");};var putHeader=API.__private__.putHeader=function(){out("%PDF-"+pdfVersion);out("%\xBA\xDF\xAC\xE0");};var putXRef=API.__private__.putXRef=function(){var p="0000000000";out("xref");out("0 "+(objectNumber+1));out("0000000000 65535 f ");for(var i=1;i<=objectNumber;i++){var offset=offsets[i];if(typeof offset==="function"){out((p+offsets[i]()).slice(-10)+" 00000 n ");}else{if(typeof offsets[i]!=="undefined"){out((p+offsets[i]).slice(-10)+" 00000 n ");}else{out("0000000000 00000 n ");}}}};var buildDocument=API.__private__.buildDocument=function(){resetDocument();setOutputDestination(content);events.publish("buildDocument");putHeader();putPages();putAdditionalObjects();putResources();if(encryptionOptions!==null)putEncryptionDict();putInfo();putCatalog();var offsetOfXRef=contentLength;putXRef();putTrailer();out("startxref");out(""+offsetOfXRef);out("%%EOF");setOutputDestination(pages[currentPage])
|
|
229382
|
+
out("/Root "+objectNumber+" 0 R");out("/Info "+(objectNumber-1)+" 0 R");if(encryptionOptions!==null){out("/Encrypt "+encryption.oid+" 0 R");}out("/ID [ <"+fileId+"> <"+fileId+"> ]");out(">>");};var putHeader=API.__private__.putHeader=function(){out("%PDF-"+pdfVersion);out("%\xBA\xDF\xAC\xE0");};var putXRef=API.__private__.putXRef=function(){var p="0000000000";out("xref");out("0 "+(objectNumber+1));out("0000000000 65535 f ");for(var i=1;i<=objectNumber;i++){var offset=offsets[i];if(typeof offset==="function"){out((p+offsets[i]()).slice(-10)+" 00000 n ");}else{if(typeof offsets[i]!=="undefined"){out((p+offsets[i]).slice(-10)+" 00000 n ");}else{out("0000000000 00000 n ");}}}};var buildDocument=API.__private__.buildDocument=function(){resetDocument();setOutputDestination(content);events.publish("buildDocument");putHeader();putPages();putAdditionalObjects();putResources();if(encryptionOptions!==null)putEncryptionDict();putInfo();putCatalog();var offsetOfXRef=contentLength;putXRef();putTrailer();out("startxref");out(""+offsetOfXRef);out("%%EOF");setOutputDestination(pages[currentPage]);// var contentString = content.join("\n");
|
|
229383
|
+
// content = 0;
|
|
229384
|
+
// return contentString;
|
|
229385
|
+
return content.join("\n");};var getBlob=API.__private__.getBlob=function(data){return new Blob([getArrayBuffer(data)],{type:"application/pdf"});};/**
|
|
229349
229386
|
* Generates the PDF document.
|
|
229350
229387
|
*
|
|
229351
229388
|
* If `type` argument is undefined, output is raw body of resulting PDF returned as a string.
|
|
@@ -229373,7 +229410,7 @@ if(typeof globalObject.URL!=="undefined"&&typeof globalObject.URL.createObjectUR
|
|
|
229373
229410
|
* Used to see if a supplied hotfix was requested when the pdf instance was created.
|
|
229374
229411
|
* @param {string} hotfixName - The name of the hotfix to check.
|
|
229375
229412
|
* @returns {boolean}
|
|
229376
|
-
*/var hasHotfix=function hasHotfix(hotfixName){return Array.isArray(hotfixes)===true&&hotfixes.indexOf(hotfixName)>-1;};switch(unit){case"pt":scaleFactor=1;break;case"mm":scaleFactor=72/25.4;break;case"cm":scaleFactor=72/2.54;break;case"in":scaleFactor=72;break;case"px":if(hasHotfix("px_scaling")==true){scaleFactor=72/96;}else{scaleFactor=96/72;}break;case"pc":scaleFactor=12;break;case"em":scaleFactor=12;break;case"ex":scaleFactor=6;break;default:throw new Error("Invalid unit: "+unit);}var encryption=null;setCreationDate();setFileId();var getEncryptor=function getEncryptor(objectId){if(encryptionOptions!==null){return encryption.encryptor(objectId,0);}return function(data){return data;};};//---------------------------------------
|
|
229413
|
+
*/var hasHotfix=function hasHotfix(hotfixName){return Array.isArray(hotfixes)===true&&hotfixes.indexOf(hotfixName)>-1;};switch(unit){case"pt":scaleFactor=1;break;case"mm":scaleFactor=72/25.4;break;case"cm":scaleFactor=72/2.54;break;case"in":scaleFactor=72;break;case"px":if(hasHotfix("px_scaling")==true){scaleFactor=72/96;}else{scaleFactor=96/72;}break;case"pc":scaleFactor=12;break;case"em":scaleFactor=12;break;case"ex":scaleFactor=6;break;default:if(typeof unit==="number"){scaleFactor=unit;}else{throw new Error("Invalid unit: "+unit);}}var encryption=null;setCreationDate();setFileId();var getEncryptor=function getEncryptor(objectId){if(encryptionOptions!==null){return encryption.encryptor(objectId,0);}return function(data){return data;};};//---------------------------------------
|
|
229377
229414
|
// Public API
|
|
229378
229415
|
var getPageInfo=API.__private__.getPageInfo=API.getPageInfo=function(pageNumberOneBased){if(isNaN(pageNumberOneBased)||pageNumberOneBased%1!==0){throw new Error("Invalid argument passed to jsPDF.getPageInfo");}var objId=pagesContext[pageNumberOneBased].objId;return{objId:objId,pageNumber:pageNumberOneBased,pageContext:pagesContext[pageNumberOneBased]};};var getPageInfoByObjId=API.__private__.getPageInfoByObjId=function(objId){if(isNaN(objId)||objId%1!==0){throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");}for(var pageNumber in pagesContext){if(pagesContext[pageNumber].objId===objId){break;}}return getPageInfo(pageNumber);};var getCurrentPageInfo=API.__private__.getCurrentPageInfo=API.getCurrentPageInfo=function(){return{objId:pagesContext[currentPage].objId,pageNumber:currentPage,pageContext:pagesContext[currentPage]};};/**
|
|
229379
229416
|
* Adds (and transfers the focus to) new page to the PDF document.
|
|
@@ -229440,6 +229477,7 @@ var getPageInfo=API.__private__.getPageInfo=API.getPageInfo=function(pageNumberO
|
|
|
229440
229477
|
* @param {number|Matrix} [options.angle=0] - Rotate the text clockwise or counterclockwise. Expects the angle in degree.
|
|
229441
229478
|
* @param {number} [options.rotationDirection=1] - Direction of the rotation. 0 = clockwise, 1 = counterclockwise.
|
|
229442
229479
|
* @param {number} [options.charSpace=0] - The space between each letter.
|
|
229480
|
+
* @param {number} [options.horizontalScale=1] - Horizontal scale of the text as a factor of the regular size.
|
|
229443
229481
|
* @param {number} [options.lineHeightFactor=1.15] - The lineheight of each line.
|
|
229444
229482
|
* @param {Object} [options.flags] - Flags for to8bitStream.
|
|
229445
229483
|
* @param {boolean} [options.flags.noBOM=true] - Don't add BOM to Unicode-text.
|
|
@@ -229471,7 +229509,7 @@ var getPageInfo=API.__private__.getPageInfo=API.getPageInfo=function(pageNumberO
|
|
|
229471
229509
|
* T* (line two) Tj
|
|
229472
229510
|
* T* (line three) Tj
|
|
229473
229511
|
* ET
|
|
229474
|
-
*/options=options||{};var scope=options.scope||this;var payload,da,angle,align,charSpace,maxWidth,flags;// Pre-August-2012 the order of arguments was function(x, y, text, flags)
|
|
229512
|
+
*/options=options||{};var scope=options.scope||this;var payload,da,angle,align,charSpace,maxWidth,flags,horizontalScale;// Pre-August-2012 the order of arguments was function(x, y, text, flags)
|
|
229475
229513
|
// in effort to make all calls have similar signature like
|
|
229476
229514
|
// function(data, coordinates... , miscellaneous)
|
|
229477
229515
|
// this method had its args flipped.
|
|
@@ -229494,11 +229532,12 @@ while(len--){curDa=sa.shift();if(typeof curDa!=="string"||Array.isArray(curDa)&&
|
|
|
229494
229532
|
//later code.
|
|
229495
229533
|
if(typeof text==="string"){if(text.match(/[\r?\n]/)){text=[text.replace(/\r\n|\r|\n/g,'')];// 自定义修改 处理打印回车的问题
|
|
229496
229534
|
}else{text=[text];}}//baseline
|
|
229497
|
-
var height=activeFontSize/scope.internal.scaleFactor
|
|
229535
|
+
var height=activeFontSize/scope.internal.scaleFactor;// var descent = height * (lineHeightFactor - 1);
|
|
229536
|
+
var descent=height*(lineHeight-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;}//multiline
|
|
229498
229537
|
maxWidth=options.maxWidth||0;if(maxWidth>0){if(typeof text==="string"){text=scope.splitTextToSize(text,maxWidth);}else if(Object.prototype.toString.call(text)==="[object Array]"){text=text.reduce(function(acc,textLine){return acc.concat(scope.splitTextToSize(textLine,maxWidth));},[]);}}//creating Payload-Object to make text byRef
|
|
229499
229538
|
payload={text:text,x:x,y:y,options:options,mutex:{pdfEscape:pdfEscape,activeFontKey:activeFontKey,fonts:fonts,activeFontSize:activeFontSize}};events.publish("preProcessText",payload);text=payload.text;options=payload.options;//angle
|
|
229500
229539
|
angle=options.angle;if(transformationMatrix instanceof Matrix===false&&angle&&typeof angle==="number"){angle*=Math.PI/180;if(options.rotationDirection===0){angle=-angle;}if(apiMode===ApiMode.ADVANCED){angle=-angle;}var c=Math.cos(angle);var s=Math.sin(angle);transformationMatrix=new Matrix(c,s,-s,c,0,0);}else if(angle&&angle instanceof Matrix){transformationMatrix=angle;}if(apiMode===ApiMode.ADVANCED&&!transformationMatrix){transformationMatrix=identityMatrix;}//charSpace
|
|
229501
|
-
charSpace=options.charSpace||activeCharSpace;if(typeof charSpace!=="undefined"){xtra+=hpf(scale(charSpace))+" Tc\n";this.setCharSpace(this.getCharSpace()||0);}//lang
|
|
229540
|
+
charSpace=options.charSpace||activeCharSpace;if(typeof charSpace!=="undefined"){xtra+=hpf(scale(charSpace))+" Tc\n";this.setCharSpace(this.getCharSpace()||0);}horizontalScale=options.horizontalScale;if(typeof horizontalScale!=="undefined"){xtra+=hpf(horizontalScale*100)+" Tz\n";}//lang
|
|
229502
229541
|
var lang=options.lang;var renderingMode=-1;var parmRenderingMode=typeof options.renderingMode!=="undefined"?options.renderingMode:options.stroke;var pageContext=scope.internal.getCurrentPageInfo().pageContext;switch(parmRenderingMode){case 0:case false:case"fill":renderingMode=0;break;case 1:case true:case"stroke":renderingMode=1;break;case 2:case"fillThenStroke":renderingMode=2;break;case 3:case"invisible":renderingMode=3;break;case 4:case"fillAndAddForClipping":renderingMode=4;break;case 5:case"strokeAndAddPathForClipping":renderingMode=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":renderingMode=6;break;case 7:case"addToPathForClipping":renderingMode=7;break;}var usedRenderingMode=typeof pageContext.usedRenderingMode!=="undefined"?pageContext.usedRenderingMode:-1;//if the coder wrote it explicitly to use a specific
|
|
229503
229542
|
//renderingMode, then use it
|
|
229504
229543
|
if(renderingMode!==-1){xtra+=renderingMode+" Tr\n";//otherwise check if we used the rendering Mode already
|
|
@@ -229894,6 +229933,14 @@ curveTo(x2,y2,x3,y3,x4,y4);}}if(closed){close();}putStyle(style);return this;};/
|
|
|
229894
229933
|
*/API.addFont=function(postScriptName,fontName,fontStyle,fontWeight,encoding){var encodingOptions=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];if(arguments[3]&&encodingOptions.indexOf(arguments[3])!==-1){//IE 11 fix
|
|
229895
229934
|
encoding=arguments[3];}else if(arguments[3]&&encodingOptions.indexOf(arguments[3])==-1){fontStyle=combineFontStyleAndFontWeight(fontStyle,fontWeight);}encoding=encoding||"Identity-H";return addFont.call(this,postScriptName,fontName,fontStyle,encoding);};var lineWidth=options.lineWidth||0.200025;// 2mm
|
|
229896
229935
|
/**
|
|
229936
|
+
* Gets the line width, default: 0.200025.
|
|
229937
|
+
*
|
|
229938
|
+
* @function
|
|
229939
|
+
* @instance
|
|
229940
|
+
* @returns {number} lineWidth
|
|
229941
|
+
* @memberof jsPDF#
|
|
229942
|
+
* @name getLineWidth
|
|
229943
|
+
*/var getLineWidth=API.__private__.getLineWidth=API.getLineWidth=function(){return lineWidth;};/**
|
|
229897
229944
|
* Sets line width for upcoming lines.
|
|
229898
229945
|
*
|
|
229899
229946
|
* @param {number} width Line width (in units declared at inception of PDF document).
|
|
@@ -229902,7 +229949,7 @@ encoding=arguments[3];}else if(arguments[3]&&encodingOptions.indexOf(arguments[3
|
|
|
229902
229949
|
* @returns {jsPDF}
|
|
229903
229950
|
* @memberof jsPDF#
|
|
229904
229951
|
* @name setLineWidth
|
|
229905
|
-
*/var setLineWidth=API.__private__.setLineWidth=API.setLineWidth=function(width){out(hpf(scale(width))+" w");return this;};/**
|
|
229952
|
+
*/var setLineWidth=API.__private__.setLineWidth=API.setLineWidth=function(width){lineWidth=width;out(hpf(scale(width))+" w");return this;};/**
|
|
229906
229953
|
* Sets the dash pattern for upcoming lines.
|
|
229907
229954
|
*
|
|
229908
229955
|
* To reset the settings simply call the method without any parameters.
|
|
@@ -230273,7 +230320,7 @@ eventname=newEvents[i][0];handler_and_args=newEvents[i][1];events.subscribe.appl
|
|
|
230273
230320
|
* Object exposing internal API to plugins
|
|
230274
230321
|
* @public
|
|
230275
230322
|
* @ignore
|
|
230276
|
-
*/API.internal={pdfEscape:pdfEscape,getStyle:getStyle,getFont:getFontEntry,getFontSize:getFontSize,getCharSpace:getCharSpace,getTextColor:getTextColor,getLineHeight:getLineHeight,getLineHeightFactor:getLineHeightFactor,write:write,getHorizontalCoordinate:getHorizontalCoordinate,getVerticalCoordinate:getVerticalCoordinate,getCoordinateString:getHorizontalCoordinateString,getVerticalCoordinateString:getVerticalCoordinateString,collections:{},newObject:newObject,newAdditionalObject:newAdditionalObject,newObjectDeferred:newObjectDeferred,newObjectDeferredBegin:newObjectDeferredBegin,getFilters:getFilters,putStream:putStream,events:events,scaleFactor:scaleFactor,pageSize:{getWidth:function getWidth(){return getPageWidth(currentPage);},setWidth:function setWidth(value){setPageWidth(currentPage,value);},getHeight:function getHeight(){return getPageHeight(currentPage);},setHeight:function setHeight(value){setPageHeight(currentPage,value);}},encryptionOptions:encryptionOptions,encryption:encryption,getEncryptor:getEncryptor,output:output,getNumberOfPages:getNumberOfPages,pages:pages,out:out,f2:f2,f3:f3,getPageInfo:getPageInfo,getPageInfoByObjId:getPageInfoByObjId,getCurrentPageInfo:getCurrentPageInfo,getPDFVersion:getPdfVersion,Point:Point,Rectangle:Rectangle,Matrix:Matrix,hasHotfix:hasHotfix//Expose the hasHotfix check so plugins can also check them.
|
|
230323
|
+
*/API.internal={pdfEscape:pdfEscape,getStyle:getStyle,getFont:getFontEntry,getFontSize:getFontSize,getCharSpace:getCharSpace,getTextColor:getTextColor,getLineHeight:getLineHeight,getLineHeightFactor:getLineHeightFactor,getLineWidth:getLineWidth,write:write,getHorizontalCoordinate:getHorizontalCoordinate,getVerticalCoordinate:getVerticalCoordinate,getCoordinateString:getHorizontalCoordinateString,getVerticalCoordinateString:getVerticalCoordinateString,collections:{},newObject:newObject,newAdditionalObject:newAdditionalObject,newObjectDeferred:newObjectDeferred,newObjectDeferredBegin:newObjectDeferredBegin,getFilters:getFilters,putStream:putStream,events:events,scaleFactor:scaleFactor,pageSize:{getWidth:function getWidth(){return getPageWidth(currentPage);},setWidth:function setWidth(value){setPageWidth(currentPage,value);},getHeight:function getHeight(){return getPageHeight(currentPage);},setHeight:function setHeight(value){setPageHeight(currentPage,value);}},encryptionOptions:encryptionOptions,encryption:encryption,getEncryptor:getEncryptor,output:output,getNumberOfPages:getNumberOfPages,pages:pages,out:out,f2:f2,f3:f3,getPageInfo:getPageInfo,getPageInfoByObjId:getPageInfoByObjId,getCurrentPageInfo:getCurrentPageInfo,getPDFVersion:getPdfVersion,Point:Point,Rectangle:Rectangle,Matrix:Matrix,hasHotfix:hasHotfix//Expose the hasHotfix check so plugins can also check them.
|
|
230277
230324
|
};Object.defineProperty(API.internal.pageSize,"width",{get:function get(){return getPageWidth(currentPage);},set:function set(value){setPageWidth(currentPage,value);},enumerable:true,configurable:true});Object.defineProperty(API.internal.pageSize,"height",{get:function get(){return getPageHeight(currentPage);},set:function set(value){setPageHeight(currentPage,value);},enumerable:true,configurable:true});//////////////////////////////////////////////////////
|
|
230278
230325
|
// continuing initialization of jsPDF Document object
|
|
230279
230326
|
//////////////////////////////////////////////////////
|
|
@@ -230305,7 +230352,7 @@ addFonts.call(API,standardFonts);activeFontKey="F1";_addPage(format,orientation)
|
|
|
230305
230352
|
* @name version
|
|
230306
230353
|
* @type {string}
|
|
230307
230354
|
* @memberof jsPDF#
|
|
230308
|
-
*/jsPDF.version="2.
|
|
230355
|
+
*/jsPDF.version="2.5.1";var jsPDFAPI=jsPDF.API;var scaleFactor=1;var pdfEscape=function pdfEscape(value){return value.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)");};var pdfUnescape=function pdfUnescape(value){return value.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")");};var f2=function f2(number){return number.toFixed(2);// Ie, %.2f
|
|
230309
230356
|
};var f5=function f5(number){return number.toFixed(5);// Ie, %.2f
|
|
230310
230357
|
};jsPDFAPI.__acroform__={};var inherit=function inherit(child,parent){child.prototype=Object.create(parent.prototype);child.prototype.constructor=child;};var scale=function scale(x){return x*scaleFactor;};var createFormXObject=function createFormXObject(formObject){var xobj=new AcroFormXObject();var height=AcroFormAppearance.internal.getHeight(formObject)||0;var width=AcroFormAppearance.internal.getWidth(formObject)||0;xobj.BBox=[0,0,Number(f2(width)),Number(f2(height))];return xobj;};/**
|
|
230311
230358
|
* Bit-Operations
|
|
@@ -230962,7 +231009,8 @@ var imageData,format,x,y,w,h,alias,compression,rotation,posX,posY;imageData=argu
|
|
|
230962
231009
|
var filter=this.internal.getFilters();if(compression===undefined&&filter.indexOf("FlateEncode")!==-1){compression="SLOW";}// 自定义修改 调整 addImage 方法的 compression值压缩图片
|
|
230963
231010
|
compression='SLOW';if(isNaN(x)||isNaN(y)){throw new Error("Invalid coordinates passed to jsPDF.addImage");}// if(posX) x += posX;
|
|
230964
231011
|
// if(posY) y += posY;
|
|
230965
|
-
initialize.call(this);var image=processImageData.call(this,imageData,format,alias,compression);writeImageToPDF.call(this,x,y,w,h,image,rotation);return this;};var processImageData=function processImageData(imageData,format,alias,compression){var result,dataAsBinaryString
|
|
231012
|
+
initialize.call(this);var image=processImageData.call(this,imageData,format,alias,compression);writeImageToPDF.call(this,x,y,w,h,image,rotation);return this;};var processImageData=function processImageData(imageData,format,alias,compression){var result,dataAsBinaryString;// 自定义修改 处理图片自带的exif信息(旋转角度)
|
|
231013
|
+
var exifdata=imageData.exifdata;if(typeof imageData==="string"&&getImageFileTypeByImageData(imageData)===UNKNOWN){imageData=unescape(imageData);var tmpImageData=convertBase64ToBinaryString(imageData,false);if(tmpImageData!==""){imageData=tmpImageData;}else{tmpImageData=jsPDFAPI.loadFile(imageData,true);if(tmpImageData!==undefined){imageData=tmpImageData;}}}if(isDOMElement(imageData)){imageData=getImageDataFromElement(imageData,format);}format=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.");}// now do the heavy lifting
|
|
230966
231014
|
if(notDefined(alias)){alias=generateAliasFromImageData(imageData);}result=checkImagesForAlias.call(this,alias);if(!result){if(supportsArrayBuffer()){// no need to convert if imageData is already uint8array
|
|
230967
231015
|
if(!(imageData instanceof Uint8Array)&&format!=="RGBA"){dataAsBinaryString=imageData;imageData=binaryStringToUint8Array(imageData);}}result=this["process"+format.toUpperCase()](imageData,getImageIndex.call(this),alias,checkCompressValue(compression),dataAsBinaryString);}if(!result){throw new Error("An unknown error occurred whilst processing the image.");}result.exifdata=exifdata;return result;};/**
|
|
230968
231016
|
* @name convertBase64ToBinaryString
|
|
@@ -231575,7 +231623,9 @@ Context2D.prototype.arcTo=function(x1,y1,x2,y2,radius){throw new Error("arcTo no
|
|
|
231575
231623
|
* @param w {Number} The width of the rectangle, in pixels
|
|
231576
231624
|
* @param h {Number} The height of the rectangle, in pixels
|
|
231577
231625
|
* @description The rect() method creates a rectangle.
|
|
231578
|
-
*/Context2D.prototype.rect=function(x,y,w,h){if(isNaN(x)||isNaN(y)||isNaN(w)||isNaN(h)){jspdf_console.error("jsPDF.context2d.rect: Invalid arguments",arguments);throw new Error("Invalid arguments passed to jsPDF.context2d.rect");}this.moveTo(x,y);this.lineTo(x+w,y);this.lineTo(x+w,y+h);this.lineTo(x,y+h);this.lineTo(x,y)
|
|
231626
|
+
*/Context2D.prototype.rect=function(x,y,w,h){if(isNaN(x)||isNaN(y)||isNaN(w)||isNaN(h)){jspdf_console.error("jsPDF.context2d.rect: Invalid arguments",arguments);throw new Error("Invalid arguments passed to jsPDF.context2d.rect");}this.moveTo(x,y);this.lineTo(x+w,y);this.lineTo(x+w,y+h);this.lineTo(x,y+h);this.lineTo(x,y);// this.lineTo(x + w, y);
|
|
231627
|
+
// this.lineTo(x, y);
|
|
231628
|
+
};/**
|
|
231579
231629
|
* Draws a "filled" rectangle
|
|
231580
231630
|
*
|
|
231581
231631
|
* @name fillRect
|
|
@@ -231713,26 +231763,7 @@ putText.call(this,{text:text,x:x,y:y,scale:scale,renderingMode:"stroke",angle:de
|
|
|
231713
231763
|
* @param e {Number} Horizontal moving
|
|
231714
231764
|
* @param f {Number} Vertical moving
|
|
231715
231765
|
* @description Each object on the canvas has a current transformation matrix.<br /><br />The transform() method replaces the current transformation matrix. It multiplies the current transformation matrix with the matrix described by:<br /><br /><br /><br />a c e<br /><br />b d f<br /><br />0 0 1<br /><br />In other words, the transform() method lets you scale, rotate, move, and skew the current context.
|
|
231716
|
-
*/Context2D.prototype.transform=function(a,b,c,d,e,f){if(isNaN(a)||isNaN(b)||isNaN(c)||isNaN(d)||isNaN(e)||isNaN(f)){jspdf_console.error("jsPDF.context2d.transform: Invalid arguments",arguments);throw new Error("Invalid arguments passed to jsPDF.context2d.transform");}//
|
|
231717
|
-
// if (isNaN(a)){
|
|
231718
|
-
// a=0;
|
|
231719
|
-
// }
|
|
231720
|
-
// if (isNaN(b)){
|
|
231721
|
-
// b=0;
|
|
231722
|
-
// }
|
|
231723
|
-
// if (isNaN(c)){
|
|
231724
|
-
// d=0;
|
|
231725
|
-
// }
|
|
231726
|
-
// if (isNaN(d)){
|
|
231727
|
-
// d=0;
|
|
231728
|
-
// }
|
|
231729
|
-
// if (isNaN(e)){
|
|
231730
|
-
// e=0;
|
|
231731
|
-
// }
|
|
231732
|
-
// if (isNaN(f)){
|
|
231733
|
-
// f=0;
|
|
231734
|
-
// }
|
|
231735
|
-
// 自定义修改 处理打印图片报错
|
|
231766
|
+
*/Context2D.prototype.transform=function(a,b,c,d,e,f){if(isNaN(a)||isNaN(b)||isNaN(c)||isNaN(d)||isNaN(e)||isNaN(f)){jspdf_console.error("jsPDF.context2d.transform: Invalid arguments",arguments);throw new Error("Invalid arguments passed to jsPDF.context2d.transform");}// 自定义修改 处理打印图片报错
|
|
231736
231767
|
a=isNaN(a)?1:a;b=isNaN(b)?0:b;c=isNaN(c)?0:c;d=isNaN(d)?1:d;e=isNaN(e)?0:e;f=isNaN(f)?0:f;var matrix=new Matrix(a,b,c,d,e,f);this.ctx.transform=this.ctx.transform.multiply(matrix);// console.log("this.transform值",this.ctx.transform);
|
|
231737
231768
|
};/**
|
|
231738
231769
|
* Resets the current transform to the identity matrix. Then runs transform()
|
|
@@ -231759,7 +231790,8 @@ a=isNaN(a)?1:a;b=isNaN(b)?0:b;c=isNaN(c)?0:c;d=isNaN(d)?1:d;e=isNaN(e)?0:e;f=isN
|
|
|
231759
231790
|
* @param y {Number} The y coordinate where to place the image on the canvas
|
|
231760
231791
|
* @param width {Number} Optional. The width of the image to use (stretch or reduce the image)
|
|
231761
231792
|
* @param height {Number} Optional. The height of the image to use (stretch or reduce the image)
|
|
231762
|
-
*/Context2D.prototype.drawImage=function(img,sx,sy,swidth,sheight,x,y,width,height){var imageProperties=this.pdf.getImageProperties(img)
|
|
231793
|
+
*/Context2D.prototype.drawImage=function(img,sx,sy,swidth,sheight,x,y,width,height){var imageProperties=this.pdf.getImageProperties(img);// 自定义修改 设置exif信息
|
|
231794
|
+
if(img.exifdata){imageProperties.exifdata=img.exifdata;}var factorX=1;var factorY=1;var clipFactorX=1;var clipFactorY=1;if(typeof swidth!=="undefined"&&typeof width!=="undefined"){clipFactorX=width/swidth;clipFactorY=height/sheight;factorX=imageProperties.width/swidth*width/swidth;factorY=imageProperties.height/sheight*height/sheight;}//is sx and sy are set and x and y not, set x and y with values of sx and sy
|
|
231763
231795
|
if(typeof x==="undefined"){x=sx;y=sy;sx=0;sy=0;}if(typeof swidth!=="undefined"&&typeof width==="undefined"){width=swidth;height=sheight;}if(typeof swidth==="undefined"&&typeof width==="undefined"){width=imageProperties.width;height=imageProperties.height;}var decomposedTransformationMatrix=this.ctx.transform.decompose();// console.log("transform.decompose",decomposedTransformationMatrix.scale);
|
|
231764
231796
|
// 自定义修改 修复图片旋转角度错误问题
|
|
231765
231797
|
var angle=rad2deg(decomposedTransformationMatrix.rotate.rotation);var matrix=new Matrix();matrix=matrix.multiply(decomposedTransformationMatrix.translate);matrix=matrix.multiply(decomposedTransformationMatrix.skew);matrix=matrix.multiply(decomposedTransformationMatrix.scale);if(!swidth){swidth=width;}if(!sheight){sheight=height;}var xRect;// 自定义修改 处理签名图片打印和普通图片打印
|
|
@@ -231774,7 +231806,15 @@ this.pdf.addImage(img,"JPEG",xRect.x+this.posX,xRect.y+this.posY,xRect.w,xRect.h
|
|
|
231774
231806
|
* @private
|
|
231775
231807
|
* @ignore
|
|
231776
231808
|
*/var drawPaths=function drawPaths(rule,isClip){if(rule==="stroke"&&!isClip&&isStrokeTransparent.call(this)){return;}if(rule!=="stroke"&&!isClip&&isFillTransparent.call(this)){return;}var moves=[];//var alpha = (this.ctx.fillOpacity < 1) ? this.ctx.fillOpacity : this.ctx.globalAlpha;
|
|
231777
|
-
var delta;var xPath=this.path;for(var i=0;i<xPath.length;i++){var pt=xPath[i];switch(pt.type){case"begin":moves.push({begin:true});break;case"close":moves.push({close:true});break;case"mt":moves.push({start:pt,deltas:[],abs:[]});break;case"lt":var iii=moves.length;if(
|
|
231809
|
+
var delta;var xPath=this.path;for(var i=0;i<xPath.length;i++){var pt=xPath[i];switch(pt.type){case"begin":moves.push({begin:true});break;case"close":moves.push({close:true});break;case"mt":moves.push({start:pt,deltas:[],abs:[]});break;case"lt":var iii=moves.length;if(xPath[i-1]&&!isNaN(xPath[i-1].x)){delta=[pt.x-xPath[i-1].x,pt.y-xPath[i-1].y];if(iii>0){for(iii;iii>=0;iii--){if(moves[iii-1].close!==true&&moves[iii-1].begin!==true){moves[iii-1].deltas.push(delta);moves[iii-1].abs.push(pt);break;}}}}break;case"bct":delta=[pt.x1-xPath[i-1].x,pt.y1-xPath[i-1].y,pt.x2-xPath[i-1].x,pt.y2-xPath[i-1].y,pt.x-xPath[i-1].x,pt.y-xPath[i-1].y];moves[moves.length-1].deltas.push(delta);break;case"qct":var x1=xPath[i-1].x+2.0/3.0*(pt.x1-xPath[i-1].x);var y1=xPath[i-1].y+2.0/3.0*(pt.y1-xPath[i-1].y);var x2=pt.x+2.0/3.0*(pt.x1-pt.x);var y2=pt.y+2.0/3.0*(pt.y1-pt.y);var x3=pt.x;var y3=pt.y;delta=[x1-xPath[i-1].x,y1-xPath[i-1].y,x2-xPath[i-1].x,y2-xPath[i-1].y,x3-xPath[i-1].x,y3-xPath[i-1].y];moves[moves.length-1].deltas.push(delta);break;case"arc":moves.push({deltas:[],abs:[],arc:true});if(Array.isArray(moves[moves.length-1].abs)){moves[moves.length-1].abs.push(pt);}break;}}var style;if(!isClip){if(rule==="stroke"){style="stroke";}else{style="fill";}}else{style=null;}var began=false;for(var k=0;k<moves.length;k++){if(moves[k].arc){var arcs=moves[k].abs;for(var ii=0;ii<arcs.length;ii++){var arc=arcs[ii];if(arc.type==="arc"){drawArc.call(this,arc.x,arc.y,arc.radius,arc.startAngle,arc.endAngle,arc.counterclockwise,undefined,isClip,!began);}else{drawLine.call(this,arc.x,arc.y);}}// putStyle.call(this, style);
|
|
231810
|
+
began=true;}else if(moves[k].close===true){this.pdf.internal.out("h");began=false;}else if(moves[k].begin!==true){var x=moves[k].start.x;var y=moves[k].start.y;drawLines.call(this,moves[k].deltas,x,y);began=true;}// if (!moves[k].arc) {
|
|
231811
|
+
// if (moves[k].close !== true && moves[k].begin !== true) {
|
|
231812
|
+
// var x = moves[k].start.x;
|
|
231813
|
+
// var y = moves[k].start.y;
|
|
231814
|
+
// drawLines.call(this, moves[k].deltas, x, y);
|
|
231815
|
+
// }
|
|
231816
|
+
// }
|
|
231817
|
+
}if(style){putStyle.call(this,style);}if(isClip){doClip.call(this);}};var getBaseline=function getBaseline(y){var height=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor;var descent=height*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return y-descent;case"top":return y+height-descent;case"hanging":return y+height-2*descent;case"middle":return y+height/2-descent;case"ideographic":// TODO not implemented
|
|
231778
231818
|
return y;case"alphabetic":default:return y;}};var getTextBottom=function getTextBottom(yBaseLine){var height=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor;var descent=height*(this.pdf.internal.getLineHeightFactor()-1);return yBaseLine+descent;};Context2D.prototype.createLinearGradient=function createLinearGradient(){var canvasGradient=function canvasGradient(){};canvasGradient.colorStops=[];canvasGradient.addColorStop=function(offset,color){this.colorStops.push([offset,color]);};canvasGradient.getColor=function(){if(this.colorStops.length===0){return"#000000";}return this.colorStops[0][1];};canvasGradient.isCanvasGradient=true;return canvasGradient;};Context2D.prototype.createPattern=function createPattern(){return this.createLinearGradient();};Context2D.prototype.createRadialGradient=function createRadialGradient(){return this.createLinearGradient();};/**
|
|
231779
231819
|
*
|
|
231780
231820
|
* @param x Edge point X
|
|
@@ -231785,7 +231825,9 @@ return y;case"alphabetic":default:return y;}};var getTextBottom=function getText
|
|
|
231785
231825
|
* @param counterclockwise
|
|
231786
231826
|
* @param style
|
|
231787
231827
|
* @param isClip
|
|
231788
|
-
*/var drawArc=function drawArc(x,y,r,a1,a2,counterclockwise,style,isClip
|
|
231828
|
+
*/var drawArc=function drawArc(x,y,r,a1,a2,counterclockwise,style,isClip,includeMove){// http://hansmuller-flex.blogspot.com/2011/10/more-about-approximating-circular-arcs.html
|
|
231829
|
+
var curves=createArc.call(this,r,a1,a2,counterclockwise);for(var i=0;i<curves.length;i++){var curve=curves[i];if(i===0){// doMove.call(this, curve.x1 + x, curve.y1 + y);
|
|
231830
|
+
if(includeMove){doMove.call(this,curve.x1+x,curve.y1+y);}else{drawLine.call(this,curve.x1+x,curve.y1+y);}}drawCurve.call(this,x,y,curve.x2,curve.y2,curve.x3,curve.y3,curve.x4,curve.y4);}if(!isClip){putStyle.call(this,style);}else{doClip.call(this);}};var putStyle=function putStyle(style){switch(style){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f");break;}};var doClip=function doClip(){this.pdf.clip();this.pdf.discardPath();};var doMove=function doMove(x,y){this.pdf.internal.out(getHorizontalCoordinateString(x)+" "+getVerticalCoordinateString(y)+" m");};var putText=function putText(options){var textAlign;switch(options.align){case"right":case"end":textAlign="right";break;case"center":textAlign="center";break;case"left":case"start":default:textAlign="left";break;}var textDimensions=this.pdf.getTextDimensions(options.text);var yBaseLine=getBaseline.call(this,options.y);var yBottom=getTextBottom.call(this,yBaseLine);var yTop=yBottom-textDimensions.h;var pt=this.ctx.transform.applyToPoint(new Point(options.x,yBaseLine));var decomposedTransformationMatrix=this.ctx.transform.decompose();var matrix=new Matrix();matrix=matrix.multiply(decomposedTransformationMatrix.translate);matrix=matrix.multiply(decomposedTransformationMatrix.skew);matrix=matrix.multiply(decomposedTransformationMatrix.scale);var baselineRect=this.ctx.transform.applyToRectangle(new Rectangle(options.x,yBaseLine,textDimensions.w,textDimensions.h));var textBounds=matrix.applyToRectangle(new Rectangle(options.x,yTop,textDimensions.w,textDimensions.h));var pageArray=getPagesByPath.call(this,textBounds);var pages=[];for(var ii=0;ii<pageArray.length;ii+=1){if(pages.indexOf(pageArray[ii])===-1){pages.push(pageArray[ii]);}}sortPages(pages);var clipPath,oldSize,oldLineWidth;options.text=options.text.replace(/[\t]/g,' ');// 自定义修改 修复打印不了tab键的问题
|
|
231789
231831
|
if(this.autoPaging){var min=pages[0];var max=pages[pages.length-1];for(var i=min;i<max+1;i++){this.pdf.setPage(i);var topMargin=i===1?this.posY+this.margin[0]:this.margin[0];var firstPageHeight=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2];var pageHeightMinusBottomMargin=this.pdf.internal.pageSize.height-this.margin[2];var pageHeightMinusMargins=pageHeightMinusBottomMargin-this.margin[0];var pageWidthMinusRightMargin=this.pdf.internal.pageSize.width-this.margin[1];var pageWidthMinusMargins=pageWidthMinusRightMargin-this.margin[3];var previousPageHeightSum=i===1?0:firstPageHeight+(i-2)*pageHeightMinusMargins;var acharSpace=options.charSpace?parseFloat(options.charSpace):0.0;//自定义修改
|
|
231790
231832
|
if(this.ctx.clip_path.length!==0){var tmpPaths=this.path;clipPath=JSON.parse(JSON.stringify(this.ctx.clip_path));this.path=pathPositionRedo(clipPath,this.posX+this.margin[3],-1*previousPageHeightSum+topMargin);drawPaths.call(this,"fill",true);this.path=tmpPaths;}var textBoundsOnPage=pathPositionRedo([JSON.parse(JSON.stringify(textBounds))],this.posX+this.margin[3],-previousPageHeightSum+topMargin+this.ctx.prevPageLastElemOffset)[0];if(options.scale>=0.01){oldSize=this.pdf.internal.getFontSize();this.pdf.setFontSize(oldSize*options.scale);oldLineWidth=this.lineWidth;this.lineWidth=oldLineWidth*options.scale;}var doSlice=this.autoPaging!=="text";if(doSlice||textBoundsOnPage.y+textBoundsOnPage.h<=pageHeightMinusBottomMargin){if(doSlice||textBoundsOnPage.y>=topMargin&&textBoundsOnPage.x<=pageWidthMinusRightMargin){var croppedText=doSlice?options.text:this.pdf.splitTextToSize(options.text,options.maxWidth||pageWidthMinusRightMargin-textBoundsOnPage.x)[0];var baseLineRectOnPage=pathPositionRedo([JSON.parse(JSON.stringify(baselineRect))],this.posX+this.margin[3],-previousPageHeightSum+topMargin+this.ctx.prevPageLastElemOffset)[0];var needsClipping=doSlice&&(i>min||i<max)&&hasMargins.call(this);if(needsClipping){this.pdf.saveGraphicsState();this.pdf.rect(this.margin[3],this.margin[0],pageWidthMinusMargins,pageHeightMinusMargins,null).clip().discardPath();}this.pdf.text(croppedText,baseLineRectOnPage.x,baseLineRectOnPage.y,{angle:options.angle,align:textAlign,renderingMode:options.renderingMode,charSpace:acharSpace// 自定义修改
|
|
231791
231833
|
});if(needsClipping){this.pdf.restoreGraphicsState();}}}else{// This text is the last element of the page, but it got cut off due to the margin
|
|
@@ -231958,7 +232000,7 @@ var options=Object.assign({},this.opt.html2canvas);delete options.onrendered;ret
|
|
|
231958
232000
|
var onRendered=this.opt.html2canvas.onrendered||function(){};onRendered(canvas);this.prop.canvas=canvas;document.body.removeChild(this.prop.overlay);});};Worker.prototype.toContext2d=function toContext2d(){// Set up function prerequisites.
|
|
231959
232001
|
var prereqs=[function checkContainer(){return document.body.contains(this.prop.container)||this.toContainer();}];// Fulfill prereqs then create the canvas.
|
|
231960
232002
|
return this.thenList(prereqs).then(loadHtml2Canvas).then(function toContext2d_main(html2canvas){// Handle old-fashioned 'onrendered' argument.
|
|
231961
|
-
var pdf=this.opt.jsPDF;var fontFaces=this.opt.fontFaces;var scale=typeof this.opt.width==="number"&&!isNaN(this.opt.width)&&typeof this.opt.windowWidth==="number"&&!isNaN(this.opt.windowWidth)?this.opt.width/this.opt.windowWidth:1;var options=Object.assign({async:true,allowTaint:true,scale:scale,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15000,logging:true,proxy:null,removeContainer:true,foreignObjectRendering:false,useCORS:false},this.opt.html2canvas);delete options.onrendered;pdf.context2d.autoPaging=typeof this.opt.autoPaging==="undefined"?true:this.opt.autoPaging;pdf.context2d.posX=this.opt.x;pdf.context2d.posY=this.opt.y;pdf.context2d.margin=this.opt.margin;pdf.context2d.fontFaces=fontFaces;if(fontFaces){for(var i=0;i<fontFaces.length;++i){var font=fontFaces[i];var src=font.src.find(function(src){return src.format==="truetype";});if(src){pdf.addFont(src.url,font.ref.name,font.ref.style);}}}options.windowHeight=options.windowHeight||0;options.windowHeight=options.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):options.windowHeight;return html2canvas(this.prop.container,options);}).then(function toContext2d_post(canvas){
|
|
232003
|
+
var pdf=this.opt.jsPDF;var fontFaces=this.opt.fontFaces;var scale=typeof this.opt.width==="number"&&!isNaN(this.opt.width)&&typeof this.opt.windowWidth==="number"&&!isNaN(this.opt.windowWidth)?this.opt.width/this.opt.windowWidth:1;var options=Object.assign({async:true,allowTaint:true,scale:scale,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15000,logging:true,proxy:null,removeContainer:true,foreignObjectRendering:false,useCORS:false},this.opt.html2canvas);delete options.onrendered;pdf.context2d.autoPaging=typeof this.opt.autoPaging==="undefined"?true:this.opt.autoPaging;pdf.context2d.posX=this.opt.x;pdf.context2d.posY=this.opt.y;pdf.context2d.margin=this.opt.margin;pdf.context2d.fontFaces=fontFaces;if(fontFaces){for(var i=0;i<fontFaces.length;++i){var font=fontFaces[i];var src=font.src.find(function(src){return src.format==="truetype";});if(src){pdf.addFont(src.url,font.ref.name,font.ref.style);}}}options.windowHeight=options.windowHeight||0;options.windowHeight=options.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):options.windowHeight;return html2canvas(this.prop.container,options);}).then(function toContext2d_post(canvas){this.opt.jsPDF.context2d.restore(true);// Handle old-fashioned 'onrendered' argument.
|
|
231962
232004
|
var onRendered=this.opt.html2canvas.onrendered||function(){};onRendered(canvas);this.prop.canvas=canvas;document.body.removeChild(this.prop.overlay);});};Worker.prototype.toImg=function toImg(){// Set up function prerequisites.
|
|
231963
232005
|
var prereqs=[function checkCanvas(){return this.prop.canvas||this.toCanvas();}];// Fulfill prereqs then create the image.
|
|
231964
232006
|
return this.thenList(prereqs).then(function toImg_main(){var imgData=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img");this.prop.img.src=imgData;});};Worker.prototype.toPdf=function toPdf(){// Set up function prerequisites.
|
|
@@ -232701,7 +232743,8 @@ var rgbOut=new Uint8Array(length/4*3);var alphaOut=new Uint8Array(length/4);var
|
|
|
232701
232743
|
* @param {Object} options
|
|
232702
232744
|
* @returns {Array}
|
|
232703
232745
|
*/var getCharWidthsArray=API.getCharWidthsArray=function(text,options){options=options||{};var activeFont=options.font||this.internal.getFont();var fontSize=options.fontSize||this.internal.getFontSize();var charSpace=options.charSpace||this.internal.getCharSpace();var widths=options.widths?options.widths:activeFont.metadata.Unicode.widths;var widthsFractionOf=widths.fof?widths.fof:1;var kerning=options.kerning?options.kerning:activeFont.metadata.Unicode.kerning;var kerningFractionOf=kerning.fof?kerning.fof:1;var doKerning=options.doKerning===false?false:true;var kerningValue=0;var i;var length=text.length;var char_code;var prior_char_code=0;//for kerning
|
|
232704
|
-
var default_char_width=widths[0]||widthsFractionOf;var output=[];for(i=0;i<length;i++){char_code=text.charCodeAt(i);if(typeof activeFont.metadata.widthOfString==="function"){output.push((activeFont.metadata.widthOfGlyph(activeFont.metadata.characterToGlyph(char_code))+charSpace*(1000/fontSize)||0)/1000);}else{if(doKerning&&(0,esm_typeof/* default */.Z)(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);
|
|
232746
|
+
var default_char_width=widths[0]||widthsFractionOf;var output=[];for(i=0;i<length;i++){char_code=text.charCodeAt(i);if(typeof activeFont.metadata.widthOfString==="function"){output.push((activeFont.metadata.widthOfGlyph(activeFont.metadata.characterToGlyph(char_code))+charSpace*(1000/fontSize)||0)/1000);}else{if(doKerning&&(0,esm_typeof/* default */.Z)(kerning[char_code])==="object"&&!isNaN(parseInt(kerning[char_code][prior_char_code],10))){kerningValue=kerning[char_code][prior_char_code]/kerningFractionOf;}else{kerningValue=0;}var charSpacewidth=(charSpace*(1000/fontSize)||0)/1000*this.internal.scaleFactor;var currentCharWidth=(widths[char_code]||default_char_width)/widthsFractionOf+kerningValue;output.push(currentCharWidth+charSpacewidth);// output.push((widths[char_code] || default_char_width) / widthsFractionOf + kerningValue);
|
|
232747
|
+
}prior_char_code=char_code;}return output;};/**
|
|
232705
232748
|
* Returns a widths of string in a given font, if the font size is set as 1 point.
|
|
232706
232749
|
*
|
|
232707
232750
|
* In other words, this is "proportional" value. For 1 unit of font size, the length
|
|
@@ -233053,7 +233096,8 @@ ctx.fillRect(0,0,canvas.width,canvas.height);var options={ignoreMouse:true,ignor
|
|
|
233053
233096
|
return ar.join("");}else{t=t.toString(16);ar.push(padz[4-t.length],t);}}return ar.join("");};var toUnicodeCmap=function toUnicodeCmap(map){var code,codes,range,unicode,unicodeMap,_i,_len;unicodeMap="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange";codes=Object.keys(map).sort(function(a,b){return a-b;});range=[];for(_i=0,_len=codes.length;_i<_len;_i++){code=codes[_i];if(range.length>=100){unicodeMap+="\n"+range.length+" beginbfchar\n"+range.join("\n")+"\nendbfchar";range=[];}if(map[code]!==undefined&&map[code]!==null&&typeof map[code].toString==="function"){unicode=("0000"+map[code].toString(16)).slice(-4);code=("0000"+(+code).toString(16)).slice(-4);range.push("<"+code+"><"+unicode+">");}}if(range.length){unicodeMap+="\n"+range.length+" beginbfchar\n"+range.join("\n")+"\nendbfchar\n";}unicodeMap+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend";return unicodeMap;};var identityHFunction=function identityHFunction(options){var font=options.font;var out=options.out;var newObject=options.newObject;var putStream=options.putStream;if(font.metadata instanceof jsPDF.API.TTFFont&&font.encoding==="Identity-H"){//Tag with Identity-H
|
|
233054
233097
|
var widths=font.metadata.Unicode.widths;var data=font.metadata.subset.encode(font.metadata.glyIdsUsed,1);var pdfOutput=data;var pdfOutput2="";for(var i=0;i<pdfOutput.length;i++){pdfOutput2+=String.fromCharCode(pdfOutput[i]);}var fontTable=newObject();putStream({data:pdfOutput2,addLength1:true,objectId:fontTable});out("endobj");var cmap=newObject();var cmapData=toUnicodeCmap(font.metadata.toUnicode);putStream({data:cmapData,addLength1:true,objectId:cmap});out("endobj");var fontDescriptor=newObject();out("<<");out("/Type /FontDescriptor");out("/FontName /"+toPDFName(font.fontName));out("/FontFile2 "+fontTable+" 0 R");out("/FontBBox "+jsPDF.API.PDFObject.convert(font.metadata.bbox));out("/Flags "+font.metadata.flags);out("/StemV "+font.metadata.stemV);out("/ItalicAngle "+font.metadata.italicAngle);out("/Ascent "+font.metadata.ascender);out("/Descent "+font.metadata.decender);out("/CapHeight "+font.metadata.capHeight);out(">>");out("endobj");var DescendantFont=newObject();out("<<");out("/Type /Font");out("/BaseFont /"+toPDFName(font.fontName));out("/FontDescriptor "+fontDescriptor+" 0 R");out("/W "+jsPDF.API.PDFObject.convert(widths));out("/CIDToGIDMap /Identity");out("/DW 1000");out("/Subtype /CIDFontType2");out("/CIDSystemInfo");out("<<");out("/Supplement 0");out("/Registry (Adobe)");out("/Ordering ("+font.encoding+")");out(">>");out(">>");out("endobj");font.objectNumber=newObject();out("<<");out("/Type /Font");out("/Subtype /Type0");out("/ToUnicode "+cmap+" 0 R");out("/BaseFont /"+toPDFName(font.fontName));out("/Encoding /"+font.encoding);out("/DescendantFonts ["+DescendantFont+" 0 R]");out(">>");out("endobj");font.isAlreadyPutted=true;}};jsPDFAPI.events.push(["putFont",function(args){identityHFunction(args);}]);var winAnsiEncodingFunction=function winAnsiEncodingFunction(options){var font=options.font;var out=options.out;var newObject=options.newObject;var putStream=options.putStream;if(font.metadata instanceof jsPDF.API.TTFFont&&font.encoding==="WinAnsiEncoding"){//Tag with WinAnsi encoding
|
|
233055
233098
|
var data=font.metadata.rawData;var pdfOutput=data;var pdfOutput2="";for(var i=0;i<pdfOutput.length;i++){pdfOutput2+=String.fromCharCode(pdfOutput[i]);}var fontTable=newObject();putStream({data:pdfOutput2,addLength1:true,objectId:fontTable});out("endobj");var cmap=newObject();var cmapData=toUnicodeCmap(font.metadata.toUnicode);putStream({data:cmapData,addLength1:true,objectId:cmap});out("endobj");var fontDescriptor=newObject();out("<<");out("/Descent "+font.metadata.decender);out("/CapHeight "+font.metadata.capHeight);out("/StemV "+font.metadata.stemV);out("/Type /FontDescriptor");out("/FontFile2 "+fontTable+" 0 R");out("/Flags 96");out("/FontBBox "+jsPDF.API.PDFObject.convert(font.metadata.bbox));out("/FontName /"+toPDFName(font.fontName));out("/ItalicAngle "+font.metadata.italicAngle);out("/Ascent "+font.metadata.ascender);out(">>");out("endobj");font.objectNumber=newObject();for(var j=0;j<font.metadata.hmtx.widths.length;j++){font.metadata.hmtx.widths[j]=parseInt(font.metadata.hmtx.widths[j]*(1000/font.metadata.head.unitsPerEm));//Change the width of Em units to Point units.
|
|
233056
|
-
}out("<</Subtype/TrueType/Type/Font/ToUnicode "+cmap+" 0 R/BaseFont/"+toPDFName(font.fontName)+"/FontDescriptor "+fontDescriptor+" 0 R"+"/Encoding/"+font.encoding+" /FirstChar 29 /LastChar 255 /Widths "+jsPDF.API.PDFObject.convert(font.metadata.hmtx.widths)+">>");out("endobj");font.isAlreadyPutted=true;}};jsPDFAPI.events.push(["putFont",function(args){winAnsiEncodingFunction(args);}]);var utf8TextFunction=function utf8TextFunction(args){var text=args.text||"";var x=args.x;var y=args.y;var options=args.options||{};var mutex=args.mutex||{};var pdfEscape=mutex.pdfEscape;var activeFontKey=mutex.activeFontKey;var fonts=mutex.fonts;var key=activeFontKey;var str="",s=0,cmapConfirm;var strText="";var encoding=fonts[key].encoding;if(fonts[key].encoding!=="Identity-H"){return{text:text,x:x,y:y,options:options,mutex:mutex};}strText=text;key=activeFontKey;if(Array.isArray(text)){strText=text[0];}
|
|
233099
|
+
}out("<</Subtype/TrueType/Type/Font/ToUnicode "+cmap+" 0 R/BaseFont/"+toPDFName(font.fontName)+"/FontDescriptor "+fontDescriptor+" 0 R"+"/Encoding/"+font.encoding+" /FirstChar 29 /LastChar 255 /Widths "+jsPDF.API.PDFObject.convert(font.metadata.hmtx.widths)+">>");out("endobj");font.isAlreadyPutted=true;}};jsPDFAPI.events.push(["putFont",function(args){winAnsiEncodingFunction(args);}]);var utf8TextFunction=function utf8TextFunction(args){var text=args.text||"";var x=args.x;var y=args.y;var options=args.options||{};var mutex=args.mutex||{};var pdfEscape=mutex.pdfEscape;var activeFontKey=mutex.activeFontKey;var fonts=mutex.fonts;var key=activeFontKey;var str="",s=0,cmapConfirm;var strText="";var encoding=fonts[key].encoding;if(fonts[key].encoding!=="Identity-H"){return{text:text,x:x,y:y,options:options,mutex:mutex};}strText=text;key=activeFontKey;if(Array.isArray(text)){strText=text[0];}// 自定义修改 处理带生僻字的字符串解构
|
|
233100
|
+
var textArr=(0,esm_toConsumableArray/* default */.Z)(strText);for(s=0;s<textArr.length;s+=1){if(fonts[key].metadata.hasOwnProperty("cmap")){cmapConfirm=fonts[key].metadata.cmap.unicode.codeMap[textArr[s].codePointAt()];/*
|
|
233057
233101
|
if (Object.prototype.toString.call(text) === '[object Array]') {
|
|
233058
233102
|
var i = 0;
|
|
233059
233103
|
// for (i = 0; i < text.length; i += 1) {
|
|
@@ -239569,8 +239613,8 @@ var UpdateDocument_component = (0,componentNormalizer/* default */.Z)(
|
|
|
239569
239613
|
)
|
|
239570
239614
|
|
|
239571
239615
|
/* harmony default export */ var UpdateDocument = (UpdateDocument_component.exports);
|
|
239572
|
-
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/toolbar/PageSetting.vue?vue&type=template&id=
|
|
239573
|
-
var
|
|
239616
|
+
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[0]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/toolbar/PageSetting.vue?vue&type=template&id=43e8d8c6&
|
|
239617
|
+
var PageSettingvue_type_template_id_43e8d8c6_render = function render() {
|
|
239574
239618
|
var _vm = this,
|
|
239575
239619
|
_c = _vm._self._c;
|
|
239576
239620
|
return _c('div', {
|
|
@@ -239812,35 +239856,6 @@ var PageSettingvue_type_template_id_a218f044_render = function render() {
|
|
|
239812
239856
|
}
|
|
239813
239857
|
}, [_vm._v(_vm._s(style[0]))]);
|
|
239814
239858
|
}), 1)], 1), _c('li', {
|
|
239815
|
-
staticClass: "control-item"
|
|
239816
|
-
}, [_c('span', {
|
|
239817
|
-
staticClass: "label",
|
|
239818
|
-
staticStyle: {
|
|
239819
|
-
"width": "64px"
|
|
239820
|
-
}
|
|
239821
|
-
}, [_vm._v("来源(S)")]), _c('a-select', {
|
|
239822
|
-
staticStyle: {
|
|
239823
|
-
"width": "100%"
|
|
239824
|
-
},
|
|
239825
|
-
attrs: {
|
|
239826
|
-
"getPopupContainer": function getPopupContainer(triggerNode) {
|
|
239827
|
-
return triggerNode.parentNode;
|
|
239828
|
-
},
|
|
239829
|
-
"size": "small",
|
|
239830
|
-
"placeholder": "请选择来源"
|
|
239831
|
-
},
|
|
239832
|
-
model: {
|
|
239833
|
-
value: _vm.property.source,
|
|
239834
|
-
callback: function callback($$v) {
|
|
239835
|
-
_vm.$set(_vm.property, "source", $$v);
|
|
239836
|
-
},
|
|
239837
|
-
expression: "property.source"
|
|
239838
|
-
}
|
|
239839
|
-
}, [_c('a-select-option', {
|
|
239840
|
-
attrs: {
|
|
239841
|
-
"value": "0"
|
|
239842
|
-
}
|
|
239843
|
-
}, [_vm._v("自动选择")])], 1)], 1), _c('li', {
|
|
239844
239859
|
staticClass: "control-item paper-item"
|
|
239845
239860
|
}, [_c('span', {
|
|
239846
239861
|
staticClass: "label",
|
|
@@ -240075,7 +240090,7 @@ var PageSettingvue_type_template_id_a218f044_render = function render() {
|
|
|
240075
240090
|
}
|
|
240076
240091
|
}, [_vm._v("取消")])], 1)])]);
|
|
240077
240092
|
};
|
|
240078
|
-
var
|
|
240093
|
+
var PageSettingvue_type_template_id_43e8d8c6_staticRenderFns = [];
|
|
240079
240094
|
|
|
240080
240095
|
// EXTERNAL MODULE: ./src/components/mixins/appendToBody.ts
|
|
240081
240096
|
var appendToBody = __webpack_require__(95677);
|
|
@@ -240223,10 +240238,10 @@ var HoColorPicker = __webpack_require__(10306);
|
|
|
240223
240238
|
});
|
|
240224
240239
|
;// CONCATENATED MODULE: ./src/components/toolbar/PageSetting.vue?vue&type=script&lang=js&
|
|
240225
240240
|
/* harmony default export */ var toolbar_PageSettingvue_type_script_lang_js_ = (PageSettingvue_type_script_lang_js_);
|
|
240226
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/toolbar/PageSetting.vue?vue&type=style&index=0&id=
|
|
240241
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/toolbar/PageSetting.vue?vue&type=style&index=0&id=43e8d8c6&prod&lang=less&
|
|
240227
240242
|
// extracted by mini-css-extract-plugin
|
|
240228
240243
|
|
|
240229
|
-
;// CONCATENATED MODULE: ./src/components/toolbar/PageSetting.vue?vue&type=style&index=0&id=
|
|
240244
|
+
;// CONCATENATED MODULE: ./src/components/toolbar/PageSetting.vue?vue&type=style&index=0&id=43e8d8c6&prod&lang=less&
|
|
240230
240245
|
|
|
240231
240246
|
;// CONCATENATED MODULE: ./src/components/toolbar/PageSetting.vue
|
|
240232
240247
|
|
|
@@ -240239,8 +240254,8 @@ var HoColorPicker = __webpack_require__(10306);
|
|
|
240239
240254
|
|
|
240240
240255
|
var PageSetting_component = (0,componentNormalizer/* default */.Z)(
|
|
240241
240256
|
toolbar_PageSettingvue_type_script_lang_js_,
|
|
240242
|
-
|
|
240243
|
-
|
|
240257
|
+
PageSettingvue_type_template_id_43e8d8c6_render,
|
|
240258
|
+
PageSettingvue_type_template_id_43e8d8c6_staticRenderFns,
|
|
240244
240259
|
false,
|
|
240245
240260
|
null,
|
|
240246
240261
|
null,
|