survey-pdf 2.5.0 → 2.5.1
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/fesm/pdf-form-filler-shared.mjs +1 -1
- package/fesm/pdf-form-filler.mjs +1 -1
- package/fesm/pdf-form-filler.node.mjs +1 -1
- package/fesm/pdf-shared.mjs +9 -10
- package/fesm/pdf-shared.mjs.map +1 -1
- package/fesm/survey.pdf.fonts.mjs +1 -1
- package/fesm/survey.pdf.mjs +5 -5
- package/fesm/survey.pdf.mjs.map +1 -1
- package/fesm/survey.pdf.node.mjs +11 -5
- package/fesm/survey.pdf.node.mjs.map +1 -1
- package/package.json +2 -2
- package/pdf-form-filler.js +1 -1
- package/pdf-form-filler.min.js.LICENSE.txt +1 -1
- package/pdf-form-filler.node.js +1 -1
- package/pdf-form-filler.node.min.js.LICENSE.txt +1 -1
- package/survey.pdf.fonts.js +1 -1
- package/survey.pdf.fonts.min.js.LICENSE.txt +1 -1
- package/survey.pdf.js +13 -14
- package/survey.pdf.js.map +1 -1
- package/survey.pdf.min.js +1 -1
- package/survey.pdf.min.js.LICENSE.txt +1 -1
- package/survey.pdf.node.js +23 -18
- package/survey.pdf.node.js.map +1 -1
- package/survey.pdf.node.min.js +1 -1
- package/survey.pdf.node.min.js.LICENSE.txt +1 -1
- package/typings/helper_survey.d.ts +0 -1
- package/typings/utils/image/index.d.ts +2 -2
package/fesm/pdf-form-filler.mjs
CHANGED
package/fesm/pdf-shared.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS PDF library v2.5.
|
|
2
|
+
* surveyjs - SurveyJS PDF library v2.5.1
|
|
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
|
*/
|
|
@@ -1177,7 +1177,7 @@ class BaseImageUtils {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
_getImageInfo(url) {
|
|
1179
1179
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1180
|
-
return {
|
|
1180
|
+
return { data: url, width: 0, height: 0, id: this.getImageId() };
|
|
1181
1181
|
});
|
|
1182
1182
|
}
|
|
1183
1183
|
getImageInfo(url) {
|
|
@@ -1196,11 +1196,11 @@ class BaseImageUtils {
|
|
|
1196
1196
|
applyImageFit(imageInfo, imageFit, targetWidth, targetHeight) {
|
|
1197
1197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1198
1198
|
if (imageFit == 'fill') {
|
|
1199
|
-
return {
|
|
1199
|
+
return { data: imageInfo.data, id: imageInfo.id, width: targetWidth, height: targetHeight };
|
|
1200
1200
|
}
|
|
1201
1201
|
if ((imageFit == 'contain' || imageFit == 'cover') && !!imageInfo.width && !!imageInfo.height && !!targetWidth && !!targetWidth) {
|
|
1202
1202
|
const scale = Math.min(targetWidth / imageInfo.width, targetHeight / imageInfo.height);
|
|
1203
|
-
return {
|
|
1203
|
+
return { data: imageInfo.data, id: imageInfo.id, width: imageInfo.width * scale, height: imageInfo.height * scale };
|
|
1204
1204
|
}
|
|
1205
1205
|
else {
|
|
1206
1206
|
return imageInfo;
|
|
@@ -1208,7 +1208,7 @@ class BaseImageUtils {
|
|
|
1208
1208
|
});
|
|
1209
1209
|
}
|
|
1210
1210
|
get emptyImage() {
|
|
1211
|
-
return {
|
|
1211
|
+
return { data: '', width: 0, height: 0, id: 'image_0' };
|
|
1212
1212
|
}
|
|
1213
1213
|
clear() {
|
|
1214
1214
|
this.hash = {};
|
|
@@ -1620,7 +1620,7 @@ class SurveyHelper {
|
|
|
1620
1620
|
if (applyImageFit !== null && applyImageFit !== void 0 ? applyImageFit : controller.applyImageFit) {
|
|
1621
1621
|
imageInfo = yield imageUtils.applyImageFit(imageInfo, options.objectFit || 'fill', options.width, options.height);
|
|
1622
1622
|
}
|
|
1623
|
-
return new ImageBrick(question, controller, imageInfo.
|
|
1623
|
+
return new ImageBrick(question, controller, imageInfo.data, point, options.width, options.height, imageInfo.width, imageInfo.height, imageInfo.id);
|
|
1624
1624
|
});
|
|
1625
1625
|
}
|
|
1626
1626
|
static canPreviewImage(question, item, url) {
|
|
@@ -1863,8 +1863,8 @@ class SurveyHelper {
|
|
|
1863
1863
|
}
|
|
1864
1864
|
}
|
|
1865
1865
|
else if (imageSize && imageSize.height && imageSize.width) {
|
|
1866
|
-
heightPt =
|
|
1867
|
-
widthPt =
|
|
1866
|
+
heightPt = Math.min(imageSize.height, SurveyHelper.getPageAvailableWidth(controller));
|
|
1867
|
+
widthPt = Math.min(imageSize.width, SurveyHelper.getPageAvailableWidth(controller));
|
|
1868
1868
|
}
|
|
1869
1869
|
}
|
|
1870
1870
|
return { width: widthPt || defaultWidthPt || 0, height: heightPt || defaultHeightPt || 0 };
|
|
@@ -1906,7 +1906,6 @@ SurveyHelper.BACKGROUND_COLOR = '#FFFFFF';
|
|
|
1906
1906
|
SurveyHelper.TITLE_LOCATION_MATRIX = 'matrix';
|
|
1907
1907
|
SurveyHelper.STANDARD_FONT = 'helvetica';
|
|
1908
1908
|
SurveyHelper.CUSTOM_FONT_ENCODING = 'Identity-H';
|
|
1909
|
-
SurveyHelper.inBrowser = typeof Image === 'function';
|
|
1910
1909
|
|
|
1911
1910
|
function setRadioAppearance(doc) {
|
|
1912
1911
|
const oldAppearanceFuncition = doc.AcroFormAppearance.RadioButton.Circle.YesNormal;
|
|
@@ -9386,7 +9385,7 @@ class CustomBrick extends PdfBrick {
|
|
|
9386
9385
|
}
|
|
9387
9386
|
}
|
|
9388
9387
|
|
|
9389
|
-
checkLibraryVersion(`${"2.5.
|
|
9388
|
+
checkLibraryVersion(`${"2.5.1"}`, 'survey-pdf');
|
|
9390
9389
|
|
|
9391
9390
|
export { TextBoldBrick as $, FlatMatrixDynamic as A, BaseImageUtils as B, FlatMultipleText as C, DocOptions as D, EventHandler as E, FlatRepository as F, DrawCanvas as G, HorizontalAlign as H, PdfBrick as I, BooleanItemBrick as J, CheckboxItemBrick as K, CheckItemBrick as L, CompositeBrick as M, CustomBrick as N, DropdownBrick as O, PagePacker as P, EmptyBrick as Q, HTMLBrick as R, SurveyPDF as S, ImageBrick as T, LinkBrick as U, VerticalAlign as V, RadioItemBrick as W, RankingItemBrick as X, RowlineBrick as Y, TextFieldBrick as Z, __awaiter as _, SurveyHelper as a, TextBrick as a0, TitlePanelBrick as a1, DocController as b, FlatQuestion as c, FlatQuestionDefault as d, FlatBooleanCheckbox as e, FlatCheckbox as f, FlatCustomModel as g, FlatComment as h, FlatDropdown as i, FlatExpression as j, FlatFile as k, FlatHTML as l, FlatImage as m, FlatImagePicker as n, FlatPanelDynamic as o, FlatRadiogroup as p, FlatRanking as q, registerImageUtils as r, FlatRating as s, FlatSlider as t, FlatSelectBase as u, FlatSignaturePad as v, FlatTextbox as w, FlatSurvey as x, FlatMatrix as y, FlatMatrixMultiple as z };
|
|
9392
9391
|
//# sourceMappingURL=pdf-shared.mjs.map
|