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.
@@ -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
  */
@@ -8747,9 +8747,23 @@ class FlatSignaturePad extends FlatQuestion {
8747
8747
  this.survey = survey;
8748
8748
  this.question = question;
8749
8749
  }
8750
+ get signatureSize() {
8751
+ if (!this._signatureSize) {
8752
+ let width = SurveyHelper.pxToPt(this.question.signatureWidth);
8753
+ let height = SurveyHelper.pxToPt(this.question.signatureHeight);
8754
+ const availableWidth = SurveyHelper.getPageAvailableWidth(this.controller);
8755
+ if (width > availableWidth) {
8756
+ const newWidth = availableWidth;
8757
+ height *= newWidth / width;
8758
+ width = newWidth;
8759
+ }
8760
+ this._signatureSize = { width, height };
8761
+ }
8762
+ return this._signatureSize;
8763
+ }
8750
8764
  generateBackgroundImage(point) {
8751
8765
  return __awaiter(this, void 0, void 0, function* () {
8752
- return yield SurveyHelper.createImageFlat(point, this.question, this.controller, { link: this.question.backgroundImage, width: SurveyHelper.pxToPt(this.question.signatureWidth), height: SurveyHelper.pxToPt(this.question.signatureHeight), objectFit: 'cover' }, true);
8766
+ return yield SurveyHelper.createImageFlat(point, this.question, this.controller, Object.assign(Object.assign({ link: this.question.backgroundImage }, this.signatureSize), { objectFit: 'cover' }), true);
8753
8767
  });
8754
8768
  }
8755
8769
  getSignImageUrl() {
@@ -8757,16 +8771,12 @@ class FlatSignaturePad extends FlatQuestion {
8757
8771
  }
8758
8772
  generateSign(point) {
8759
8773
  return __awaiter(this, void 0, void 0, function* () {
8760
- const width = SurveyHelper.pxToPt(this.question.signatureWidth);
8761
- const height = SurveyHelper.pxToPt(this.question.signatureHeight);
8762
8774
  let brick;
8763
8775
  if (this.question.value) {
8764
- brick = (yield SurveyHelper.createImageFlat(point, this.question, this.controller, { link: this.getSignImageUrl(),
8765
- width: width,
8766
- height: height }, false));
8776
+ brick = (yield SurveyHelper.createImageFlat(point, this.question, this.controller, Object.assign({ link: this.getSignImageUrl() }, this.signatureSize), false));
8767
8777
  }
8768
8778
  else {
8769
- brick = new EmptyBrick(SurveyHelper.createRect(point, width, height));
8779
+ brick = new EmptyBrick(SurveyHelper.createRect(point, this.signatureSize.width, this.signatureSize.height));
8770
8780
  }
8771
8781
  if (FlatSignaturePad.BORDER_STYLE !== 'none') {
8772
8782
  brick.afterRenderCallback = () => {
@@ -9375,7 +9385,7 @@ class CustomBrick extends PdfBrick {
9375
9385
  }
9376
9386
  }
9377
9387
 
9378
- checkLibraryVersion(`${"2.3.5"}`, 'survey-pdf');
9388
+ checkLibraryVersion(`${"2.3.7"}`, 'survey-pdf');
9379
9389
 
9380
9390
  export { BooleanItemBrick, CheckItemBrick, CheckboxItemBrick, CompositeBrick, CustomBrick, DocController, DocOptions, DrawCanvas, DropdownBrick, EmptyBrick, EventHandler, FlatBooleanCheckbox as FlatBoolean, FlatCheckbox, FlatComment, FlatCustomModel, FlatDropdown, FlatExpression, FlatFile, FlatHTML, FlatImage, FlatImagePicker, FlatMatrix, FlatMatrixDynamic, FlatMatrixMultiple, FlatMultipleText, FlatPanelDynamic, FlatQuestion, FlatQuestionDefault, FlatRadiogroup, FlatRanking, FlatRating, FlatRepository, FlatSelectBase, FlatSignaturePad, FlatSlider, FlatSurvey, FlatTextbox, HTMLBrick, HorizontalAlign, ImageBrick, LinkBrick, PagePacker, PdfBrick, RadioItemBrick, RankingItemBrick, RowlineBrick, SurveyHelper, SurveyPDF, TextBoldBrick, TextBrick, TextFieldBrick, TitlePanelBrick, VerticalAlign };
9381
9391
  //# sourceMappingURL=survey.pdf.mjs.map