survey-pdf 2.4.0 → 2.5.0

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.
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * surveyjs - SurveyJS PDF library v2.5.0
3
+ * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
+ * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
+ */
6
+
7
+ import { B as BaseImageUtils, _ as __awaiter, r as registerImageUtils } from './pdf-shared.mjs';
8
+ export { J as BooleanItemBrick, L as CheckItemBrick, K as CheckboxItemBrick, M as CompositeBrick, N as CustomBrick, b as DocController, D as DocOptions, G as DrawCanvas, O as DropdownBrick, Q as EmptyBrick, E as EventHandler, e as FlatBoolean, f as FlatCheckbox, h as FlatComment, g as FlatCustomModel, i as FlatDropdown, j as FlatExpression, k as FlatFile, l as FlatHTML, m as FlatImage, n as FlatImagePicker, y as FlatMatrix, A as FlatMatrixDynamic, z as FlatMatrixMultiple, C as FlatMultipleText, o as FlatPanelDynamic, c as FlatQuestion, d as FlatQuestionDefault, p as FlatRadiogroup, q as FlatRanking, s as FlatRating, F as FlatRepository, u as FlatSelectBase, v as FlatSignaturePad, t as FlatSlider, x as FlatSurvey, w as FlatTextbox, R as HTMLBrick, H as HorizontalAlign, T as ImageBrick, U as LinkBrick, P as PagePacker, I as PdfBrick, W as RadioItemBrick, X as RankingItemBrick, Y as RowlineBrick, a as SurveyHelper, S as SurveyPDF, $ as TextBoldBrick, a0 as TextBrick, Z as TextFieldBrick, a1 as TitlePanelBrick, V as VerticalAlign } from './pdf-shared.mjs';
9
+ import fetch from 'node-fetch';
10
+ import { imageSize } from 'image-size';
11
+ import 'survey-core';
12
+ import 'jspdf';
13
+
14
+ class ImageUtils extends BaseImageUtils {
15
+ _getImageInfo(url) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ const res = yield fetch(url);
18
+ const pxToPt = 72.0 / 96.0;
19
+ const imageData = new Uint8Array(yield res.arrayBuffer());
20
+ const size = imageSize(imageData);
21
+ return { imageData, width: size.width * pxToPt, height: size.height * pxToPt, imageId: this.getImageId() };
22
+ });
23
+ }
24
+ }
25
+
26
+ registerImageUtils(new ImageUtils());
27
+ //# sourceMappingURL=survey.pdf.node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"survey.pdf.node.mjs","sources":["../../src/utils/image/node.ts","../../src/entries/pdf-node.ts"],"sourcesContent":["import { IImageInfo, IImageUtils, BaseImageUtils } from '.';\nimport fetch from 'node-fetch';\nimport { imageSize } from 'image-size';\nexport class ImageUtils extends BaseImageUtils implements IImageUtils {\n protected async _getImageInfo(url: string): Promise<IImageInfo> {\n const res = await fetch(url);\n const pxToPt: number = 72.0 / 96.0;\n const imageData = new Uint8Array(await res.arrayBuffer());\n const size = imageSize(imageData);\n return { imageData, width: size.width * pxToPt, height: size.height * pxToPt, imageId: this.getImageId() };\n }\n}","export * from './pdf-base';\nimport { registerImageUtils } from '../utils/image';\nimport { ImageUtils } from '../utils/image/node';\nregisterImageUtils(new ImageUtils());"],"names":[],"mappings":";;;;;;;;;;;;;AAGM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA;AAC1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAC,CAAA,CAAA,CAAW,CAAA,CAAA;;AACrC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAM,CAAA,CAAA,CAAG,CAAA,CAAA,CAAG,MAAM,CAAA,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G,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAE,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAAE,CAAA,CAAE;QAC9G,CAAC,CAAA;AAAA,CAAA,CAAA,CAAA,CAAA;AACJ;;ACRD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,CAAC,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-pdf",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "homepage": "https://surveyjs.io/",
5
5
  "author": "DevSoft Baltic OÜ <info@devsoftbaltic.com>",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -36,14 +36,21 @@
36
36
  },
37
37
  "typings": "./typings/entries/pdf.d.ts",
38
38
  "peerDependencies": {
39
- "survey-core": "2.4.0"
39
+ "survey-core": "2.5.0"
40
40
  },
41
41
  "dependencies": {
42
- "jspdf": "^2.3.0 || ^3"
42
+ "@types/node-fetch": "^2",
43
+ "jspdf": "^2.3.0 || ^3",
44
+ "image-size": "^2",
45
+ "node-fetch": "^2"
43
46
  },
44
47
  "exports": {
45
48
  ".": {
46
49
  "types": "./typings/entries/pdf.d.ts",
50
+ "node": {
51
+ "import": "./fesm/survey.pdf.node.mjs",
52
+ "require": "./survey.pdf.node.js"
53
+ },
47
54
  "import": "./fesm/survey.pdf.mjs",
48
55
  "require": "./survey.pdf.js"
49
56
  },
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.4.0
2
+ * surveyjs - SurveyJS PDF library v2.5.0
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.4.0
2
+ * surveyjs - SurveyJS PDF library v2.5.0
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.4.0
2
+ * surveyjs - SurveyJS PDF library v2.5.0
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.4.0
2
+ * surveyjs - SurveyJS PDF library v2.5.0
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.4.0
2
+ * surveyjs - SurveyJS PDF library v2.5.0
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.4.0
2
+ * surveyjs - SurveyJS PDF library v2.5.0
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */