survey-pdf 2.4.1 → 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 +9391 -0
- package/fesm/pdf-shared.mjs.map +1 -0
- package/fesm/survey.pdf.fonts.mjs +1 -1
- package/fesm/survey.pdf.mjs +56 -9359
- package/fesm/survey.pdf.mjs.map +1 -1
- package/fesm/survey.pdf.node.mjs +33 -0
- package/fesm/survey.pdf.node.mjs.map +1 -0
- package/package.json +10 -3
- 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 +335 -130
- 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 +12963 -0
- package/survey.pdf.node.js.map +1 -0
- package/survey.pdf.node.min.js +2 -0
- package/survey.pdf.node.min.js.LICENSE.txt +27 -0
- package/typings/entries/pdf-base.d.ts +50 -0
- package/typings/entries/pdf-node.d.ts +1 -0
- package/typings/entries/pdf.d.ts +1 -50
- package/typings/helper_survey.d.ts +3 -12
- package/typings/pdf_render/pdf_image.d.ts +8 -6
- package/typings/utils/image/browser.d.ts +6 -0
- package/typings/utils/image/index.d.ts +23 -0
- package/typings/utils/image/node.d.ts +4 -0
|
@@ -90,28 +90,18 @@ export declare class SurveyHelper {
|
|
|
90
90
|
static createCommentFlat(point: IPoint, question: Question, controller: DocController, options: {
|
|
91
91
|
rows?: number;
|
|
92
92
|
} & ITextFieldBrickOptions): Promise<IPdfBrick>;
|
|
93
|
-
static inBrowser: boolean;
|
|
94
93
|
static get hasDocument(): boolean;
|
|
95
|
-
static
|
|
96
|
-
static shouldConvertImageToPng: boolean;
|
|
97
|
-
static getImageLink(controller: DocController, imageOptions: {
|
|
94
|
+
static createImageFlat(point: IPoint, question: any, controller: DocController, options: {
|
|
98
95
|
link: string;
|
|
99
96
|
width: number;
|
|
100
97
|
height: number;
|
|
101
|
-
objectFit?:
|
|
102
|
-
}, applyImageFit: boolean): Promise<string>;
|
|
103
|
-
static createImageFlat(point: IPoint, question: any, controller: DocController, imageOptions: {
|
|
104
|
-
link: string;
|
|
105
|
-
width: number;
|
|
106
|
-
height: number;
|
|
107
|
-
objectFit?: string;
|
|
98
|
+
objectFit?: 'cover' | 'contain' | 'fill';
|
|
108
99
|
}, applyImageFit?: boolean): Promise<IPdfBrick>;
|
|
109
100
|
static canPreviewImage(question: QuestionFileModel, item: {
|
|
110
101
|
name: string;
|
|
111
102
|
type: string;
|
|
112
103
|
content: string;
|
|
113
104
|
}, url: string): boolean;
|
|
114
|
-
static getImageSize(url: string): Promise<ISize>;
|
|
115
105
|
static createRowlineFlat(point: IPoint, controller: DocController, width?: number, color?: string): IPdfBrick;
|
|
116
106
|
static createLinkFlat(point: IPoint, question: Question, controller: DocController, text: string, link: string): Promise<IPdfBrick>;
|
|
117
107
|
static createAcroformRect(rect: IRect): number[];
|
|
@@ -147,4 +137,5 @@ export declare class SurveyHelper {
|
|
|
147
137
|
defaultImageWidth?: any;
|
|
148
138
|
defaultImageHeight?: any;
|
|
149
139
|
}): Promise<ISize>;
|
|
140
|
+
static clear(): void;
|
|
150
141
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { IQuestion } from 'survey-core';
|
|
2
2
|
import { PdfBrick } from './pdf_brick';
|
|
3
|
-
import { DocController } from '../doc_controller';
|
|
4
|
-
import { IPoint } from '../entries/pdf';
|
|
3
|
+
import { DocController, IPoint } from '../doc_controller';
|
|
5
4
|
export declare class ImageBrick extends PdfBrick {
|
|
6
|
-
protected image: string;
|
|
7
|
-
protected
|
|
8
|
-
protected
|
|
9
|
-
|
|
5
|
+
protected image: string | Uint8Array;
|
|
6
|
+
protected targetWidth: number;
|
|
7
|
+
protected targetHeight: number;
|
|
8
|
+
protected imageWidth?: number;
|
|
9
|
+
protected imageHeight?: number;
|
|
10
|
+
protected imageId?: string;
|
|
11
|
+
constructor(question: IQuestion, controller: DocController, image: string | Uint8Array, point: IPoint, targetWidth: number, targetHeight: number, imageWidth?: number, imageHeight?: number, imageId?: string);
|
|
10
12
|
renderInteractive(): Promise<void>;
|
|
11
13
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseImageUtils, IImageInfo, IImageUtils } from '.';
|
|
2
|
+
export declare class ImageUtils extends BaseImageUtils implements IImageUtils {
|
|
3
|
+
protected _getImageInfo(url: string): Promise<IImageInfo>;
|
|
4
|
+
private getCoverCanvasOptions;
|
|
5
|
+
applyImageFit(imageInfo: IImageInfo, imageFit: 'cover' | 'fill' | 'contain', targetWidth: number, targetHeight: number): Promise<IImageInfo>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface IImageInfo {
|
|
2
|
+
data: string | Uint8Array<ArrayBuffer>;
|
|
3
|
+
width: number;
|
|
4
|
+
id?: string;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
export interface IImageUtils {
|
|
8
|
+
getImageInfo(url: string): Promise<IImageInfo>;
|
|
9
|
+
applyImageFit(imageInfo: IImageInfo, imageFit: 'cover' | 'fill' | 'contain', targetWidth: number, targetHeight: number): Promise<IImageInfo>;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class BaseImageUtils implements IImageUtils {
|
|
13
|
+
private hash;
|
|
14
|
+
private imageId;
|
|
15
|
+
protected getImageId(): string;
|
|
16
|
+
protected _getImageInfo(url: string): Promise<IImageInfo>;
|
|
17
|
+
getImageInfo(url: string): Promise<IImageInfo>;
|
|
18
|
+
applyImageFit(imageInfo: IImageInfo, imageFit: 'cover' | 'fill' | 'contain', targetWidth: number, targetHeight: number): Promise<IImageInfo>;
|
|
19
|
+
protected get emptyImage(): IImageInfo;
|
|
20
|
+
clear(): void;
|
|
21
|
+
}
|
|
22
|
+
export declare function getImageUtils(): IImageUtils;
|
|
23
|
+
export declare function registerImageUtils(val: IImageUtils): void;
|