survey-pdf 1.11.14 → 1.12.2
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 +2 -2
- package/survey.pdf.d.ts +25 -5
- package/survey.pdf.fonts.js +2 -2
- package/survey.pdf.fonts.min.js +1 -1
- package/survey.pdf.js +76 -9
- package/survey.pdf.min.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "survey-pdf",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.2",
|
|
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",
|
|
@@ -28,6 +28,6 @@
|
|
|
28
28
|
"jspdf": "^2.3.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"survey-core": "1.
|
|
31
|
+
"survey-core": "1.12.2"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/survey.pdf.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*Type definitions for SurveyJS PDF library v1.
|
|
1
|
+
/*Type definitions for SurveyJS PDF library v1.12.2
|
|
2
2
|
Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
3
3
|
Definitions by: Devsoft Baltic OÜ <https://github.com/surveyjs/>
|
|
4
4
|
*/
|
|
@@ -275,7 +275,7 @@ export declare class SurveyHelper {
|
|
|
275
275
|
static createAcroformRect(rect: IRect): number[];
|
|
276
276
|
static createTextFieldRect(point: IPoint, controller: DocController, lines?: number): IRect;
|
|
277
277
|
static createReadOnlyTextFieldTextFlat(point: IPoint, controller: DocController, question: Question, value: string): Promise<IPdfBrick>;
|
|
278
|
-
static renderFlatBorders(controller: DocController, flat: PdfBrick): void;
|
|
278
|
+
static renderFlatBorders(controller: DocController, flat: IRect & ISize & Pick<PdfBrick, 'formBorderColor'>): void;
|
|
279
279
|
static getLocString(text: LocalizableString): string;
|
|
280
280
|
static getDropdownQuestionValue(question: Question): string;
|
|
281
281
|
static getContentQuestion(question: Question): Question;
|
|
@@ -289,7 +289,7 @@ export declare class SurveyHelper {
|
|
|
289
289
|
static setColumnMargins(controller: DocController, colCount: number, column: number): void;
|
|
290
290
|
static moveRect(rect: IRect, left?: number, top?: number): IRect;
|
|
291
291
|
static scaleRect(rect: IRect, scale: number): IRect;
|
|
292
|
-
static formScale(controller: DocController, flat:
|
|
292
|
+
static formScale(controller: DocController, flat: ISize): number;
|
|
293
293
|
static generateQuestionFlats(survey: SurveyPDF, controller: DocController, question: Question, point: IPoint): Promise<IPdfBrick[]>;
|
|
294
294
|
static isFontExist(controller: DocController, fontName: string): boolean;
|
|
295
295
|
static isCustomFont(controller: DocController, fontName: string): boolean;
|
|
@@ -485,7 +485,15 @@ export interface IDocOptions {
|
|
|
485
485
|
*/
|
|
486
486
|
compress?: boolean;
|
|
487
487
|
/**
|
|
488
|
-
* Specifies whether to apply
|
|
488
|
+
* Specifies whether to apply `imageFit` settings specified in the survey JSON schema to exported images.
|
|
489
|
+
*
|
|
490
|
+
* Default value: `false`
|
|
491
|
+
*
|
|
492
|
+
* This property applies the following settings:
|
|
493
|
+
*
|
|
494
|
+
* - [`imageFit`](https://surveyjs.io/form-library/documentation/api-reference/add-image-to-survey#imageFit) to exported [Image](https://surveyjs.io/form-library/documentation/api-reference/add-image-to-survey) questions
|
|
495
|
+
* - [`imageFit`](https://surveyjs.io/form-library/documentation/api-reference/image-picker-question-model#imageFit) to exported [Image Picker](https://surveyjs.io/form-library/documentation/api-reference/image-picker-question-model) questions
|
|
496
|
+
* - [`logoFit`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logoFit) to an exported logo in the survey header
|
|
489
497
|
*
|
|
490
498
|
* If you enable the `applyImageFit` property, the quality of images may be lower because they pass through several conversions. If `applyImageFit` is disabled, exported images fill the entire container and do not preserve their aspect ratio, but their quality remains the same because they are exported as is.
|
|
491
499
|
*/
|
|
@@ -588,6 +596,7 @@ export declare class DocController extends DocOptions {
|
|
|
588
596
|
get paperHeight(): number;
|
|
589
597
|
getNumberOfPages(): number;
|
|
590
598
|
addPage(): void;
|
|
599
|
+
getCurrentPageIndex(): number;
|
|
591
600
|
setPage(index: number): void;
|
|
592
601
|
}
|
|
593
602
|
|
|
@@ -944,6 +953,14 @@ export interface IDrawImageOptions extends IDrawRectOptions {
|
|
|
944
953
|
* A string value with a base64-encoded image to be drawn.
|
|
945
954
|
*/
|
|
946
955
|
base64: string;
|
|
956
|
+
/**
|
|
957
|
+
* Specifies how to resize the image to fit it into its container.
|
|
958
|
+
*
|
|
959
|
+
* Default value: `"contain"` if [`applyImageFit`](https://surveyjs.io/pdf-generator/documentation/api-reference/idocoptions#applyImageFit) is enabled or `undefined` if not.
|
|
960
|
+
*
|
|
961
|
+
* Refer to the [`object-fit`](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) CSS property description for information on accepted values.
|
|
962
|
+
*/
|
|
963
|
+
imageFit?: string;
|
|
947
964
|
}
|
|
948
965
|
/**
|
|
949
966
|
* An object that describes a drawing area and enables you to draw an image or a piece of text within the area. You can access this object within functions that handle `SurveyPDF`'s [`onRenderHeader`](https://surveyjs.io/pdf-generator/documentation/api-reference/surveypdf#onRenderHeader) and [`onRenderFooter`](https://surveyjs.io/pdf-generator/documentation/api-reference/surveypdf#onRenderFooter) events.
|
|
@@ -1051,6 +1068,7 @@ export declare class PdfBrick implements IPdfBrick {
|
|
|
1051
1068
|
*/
|
|
1052
1069
|
get height(): number;
|
|
1053
1070
|
protected getShouldRenderReadOnly(): boolean;
|
|
1071
|
+
afterRenderCallback: () => void;
|
|
1054
1072
|
render(): Promise<void>;
|
|
1055
1073
|
renderInteractive(): Promise<void>;
|
|
1056
1074
|
renderReadOnly(): Promise<void>;
|
|
@@ -1220,8 +1238,10 @@ export declare class TextFieldBrick extends PdfBrick {
|
|
|
1220
1238
|
renderInteractive(): Promise<void>;
|
|
1221
1239
|
protected shouldRenderFlatBorders(): boolean;
|
|
1222
1240
|
protected getShouldRenderReadOnly(): boolean;
|
|
1223
|
-
textBrick: IPdfBrick;
|
|
1241
|
+
get textBrick(): IPdfBrick;
|
|
1242
|
+
set textBrick(val: IPdfBrick);
|
|
1224
1243
|
renderReadOnly(): Promise<void>;
|
|
1244
|
+
unfold(): IPdfBrick[];
|
|
1225
1245
|
translateX(func: TranslateXFunction): void;
|
|
1226
1246
|
protected setXLeft(val: number): void;
|
|
1227
1247
|
protected setXRight(val: number): void;
|