survey-pdf 2.3.5 → 2.3.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-pdf",
3
- "version": "2.3.5",
3
+ "version": "2.3.7",
4
4
  "description": "survey.pdf.js is a SurveyJS PDF Library. It is a easy way to export SurveyJS surveys to PDF. It uses JSON for survey metadata.",
5
5
  "keywords": [
6
6
  "Survey",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "typings": "./typings/entries/pdf.d.ts",
21
21
  "peerDependencies": {
22
- "survey-core": "2.3.5"
22
+ "survey-core": "2.3.7"
23
23
  },
24
24
  "dependencies": {
25
25
  "jspdf": "^2.3.0 || ^3"
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.3.5
2
+ * surveyjs - SurveyJS PDF library v2.3.7
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.3.5
2
+ * surveyjs - SurveyJS PDF library v2.3.7
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.3.5
2
+ * surveyjs - SurveyJS PDF library v2.3.7
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.3.5
2
+ * surveyjs - SurveyJS PDF library v2.3.7
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.3.5
2
+ * surveyjs - SurveyJS PDF library v2.3.7
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.3.5
2
+ * surveyjs - SurveyJS PDF library v2.3.7
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
package/survey.pdf.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.3.5
2
+ * surveyjs - SurveyJS PDF library v2.3.7
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1558,7 +1558,7 @@ __webpack_require__.r(__webpack_exports__);
1558
1558
 
1559
1559
 
1560
1560
 
1561
- (0,survey_core__WEBPACK_IMPORTED_MODULE_50__.checkLibraryVersion)("".concat("2.3.5"), 'survey-pdf');
1561
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_50__.checkLibraryVersion)("".concat("2.3.7"), 'survey-pdf');
1562
1562
 
1563
1563
 
1564
1564
  /***/ }),
@@ -4896,11 +4896,29 @@ var FlatSignaturePad = /** @class */ (function (_super) {
4896
4896
  _this.question = question;
4897
4897
  return _this;
4898
4898
  }
4899
+ Object.defineProperty(FlatSignaturePad.prototype, "signatureSize", {
4900
+ get: function () {
4901
+ if (!this._signatureSize) {
4902
+ var width = _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.pxToPt(this.question.signatureWidth);
4903
+ var height = _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.pxToPt(this.question.signatureHeight);
4904
+ var availableWidth = _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.getPageAvailableWidth(this.controller);
4905
+ if (width > availableWidth) {
4906
+ var newWidth = availableWidth;
4907
+ height *= newWidth / width;
4908
+ width = newWidth;
4909
+ }
4910
+ this._signatureSize = { width: width, height: height };
4911
+ }
4912
+ return this._signatureSize;
4913
+ },
4914
+ enumerable: false,
4915
+ configurable: true
4916
+ });
4899
4917
  FlatSignaturePad.prototype.generateBackgroundImage = function (point) {
4900
4918
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
4901
4919
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
4902
4920
  switch (_a.label) {
4903
- case 0: return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.createImageFlat(point, this.question, this.controller, { link: this.question.backgroundImage, width: _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.pxToPt(this.question.signatureWidth), height: _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.pxToPt(this.question.signatureHeight), objectFit: 'cover' }, true)];
4921
+ case 0: return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.createImageFlat(point, this.question, this.controller, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({ link: this.question.backgroundImage }, this.signatureSize), { objectFit: 'cover' }), true)];
4904
4922
  case 1: return [2 /*return*/, _a.sent()];
4905
4923
  }
4906
4924
  });
@@ -4911,22 +4929,18 @@ var FlatSignaturePad = /** @class */ (function (_super) {
4911
4929
  };
4912
4930
  FlatSignaturePad.prototype.generateSign = function (point) {
4913
4931
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function () {
4914
- var width, height, brick;
4932
+ var brick;
4915
4933
  var _this = this;
4916
4934
  return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__generator)(this, function (_a) {
4917
4935
  switch (_a.label) {
4918
4936
  case 0:
4919
- width = _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.pxToPt(this.question.signatureWidth);
4920
- height = _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.pxToPt(this.question.signatureHeight);
4921
4937
  if (!this.question.value) return [3 /*break*/, 2];
4922
- return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.createImageFlat(point, this.question, this.controller, { link: this.getSignImageUrl(),
4923
- width: width,
4924
- height: height }, false)];
4938
+ return [4 /*yield*/, _helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.createImageFlat(point, this.question, this.controller, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({ link: this.getSignImageUrl() }, this.signatureSize), false)];
4925
4939
  case 1:
4926
4940
  brick = (_a.sent());
4927
4941
  return [3 /*break*/, 3];
4928
4942
  case 2:
4929
- brick = new _pdf_render_pdf_empty__WEBPACK_IMPORTED_MODULE_4__.EmptyBrick(_helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.createRect(point, width, height));
4943
+ brick = new _pdf_render_pdf_empty__WEBPACK_IMPORTED_MODULE_4__.EmptyBrick(_helper_survey__WEBPACK_IMPORTED_MODULE_3__.SurveyHelper.createRect(point, this.signatureSize.width, this.signatureSize.height));
4930
4944
  _a.label = 3;
4931
4945
  case 3:
4932
4946
  if (FlatSignaturePad.BORDER_STYLE !== 'none') {