survey-pdf 2.0.0-rc.2 → 2.0.0-rc.4
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/LICENSE +1 -1
- package/fesm/survey.pdf.fonts.js +55 -0
- package/fesm/survey.pdf.fonts.js.map +1 -0
- package/fesm/survey.pdf.js +9943 -0
- package/fesm/survey.pdf.js.map +1 -0
- package/package.json +16 -11
- package/survey.pdf.d.ts +1309 -1309
- package/survey.pdf.fonts.js +92 -78
- package/survey.pdf.fonts.js.map +1 -0
- package/survey.pdf.fonts.min.js +2 -6
- package/survey.pdf.fonts.min.js.LICENSE.txt +5 -0
- package/survey.pdf.js +7698 -7281
- package/survey.pdf.js.map +1 -0
- package/survey.pdf.min.js +2 -26
- package/survey.pdf.min.js.LICENSE.txt +5 -0
- package/typings/doc_controller.d.ts +298 -0
- package/typings/entries/helpers.d.ts +7 -0
- package/typings/entries/pdf.d.ts +51 -0
- package/typings/event_handler/adorners.d.ts +24 -0
- package/typings/event_handler/draw_canvas.d.ts +133 -0
- package/typings/event_handler/event_handler.d.ts +11 -0
- package/typings/flat_layout/flat_boolean.d.ts +22 -0
- package/typings/flat_layout/flat_checkbox.d.ts +19 -0
- package/typings/flat_layout/flat_comment.d.ts +12 -0
- package/typings/flat_layout/flat_custom_model.d.ts +11 -0
- package/typings/flat_layout/flat_default.d.ts +6 -0
- package/typings/flat_layout/flat_dropdown.d.ts +12 -0
- package/typings/flat_layout/flat_expression.d.ts +11 -0
- package/typings/flat_layout/flat_file.d.ts +17 -0
- package/typings/flat_layout/flat_html.d.ts +15 -0
- package/typings/flat_layout/flat_image.d.ts +12 -0
- package/typings/flat_layout/flat_imagepicker.d.ts +14 -0
- package/typings/flat_layout/flat_matrix.d.ts +38 -0
- package/typings/flat_layout/flat_matrixdynamic.d.ts +8 -0
- package/typings/flat_layout/flat_matrixmultiple.d.ts +29 -0
- package/typings/flat_layout/flat_multipletext.d.ts +15 -0
- package/typings/flat_layout/flat_paneldynamic.d.ts +13 -0
- package/typings/flat_layout/flat_question.d.ts +27 -0
- package/typings/flat_layout/flat_radiogroup.d.ts +14 -0
- package/typings/flat_layout/flat_ranking.d.ts +16 -0
- package/typings/flat_layout/flat_rating.d.ts +16 -0
- package/typings/flat_layout/flat_repository.d.ts +16 -0
- package/typings/flat_layout/flat_selectbase.d.ts +18 -0
- package/typings/flat_layout/flat_signaturepad.d.ts +15 -0
- package/typings/flat_layout/flat_survey.d.ts +15 -0
- package/typings/flat_layout/flat_textbox.d.ts +12 -0
- package/typings/fonts.d.ts +4 -0
- package/typings/helper_survey.d.ts +155 -0
- package/typings/helper_test.d.ts +21 -0
- package/typings/jspdf_plugins/acroform.d.ts +1 -0
- package/typings/page_layout/page_packer.d.ts +7 -0
- package/typings/pdf_render/pdf_booleanitem.d.ts +6 -0
- package/typings/pdf_render/pdf_brick.d.ts +86 -0
- package/typings/pdf_render/pdf_checkboxitem.d.ts +6 -0
- package/typings/pdf_render/pdf_checkitem.d.ts +23 -0
- package/typings/pdf_render/pdf_coloredbrick.d.ts +9 -0
- package/typings/pdf_render/pdf_comment.d.ts +8 -0
- package/typings/pdf_render/pdf_composite.d.ts +26 -0
- package/typings/pdf_render/pdf_custom.d.ts +8 -0
- package/typings/pdf_render/pdf_description.d.ts +6 -0
- package/typings/pdf_render/pdf_dropdown.d.ts +11 -0
- package/typings/pdf_render/pdf_empty.d.ts +9 -0
- package/typings/pdf_render/pdf_html.d.ts +9 -0
- package/typings/pdf_render/pdf_image.d.ts +11 -0
- package/typings/pdf_render/pdf_link.d.ts +9 -0
- package/typings/pdf_render/pdf_radioitem.d.ts +34 -0
- package/typings/pdf_render/pdf_rankingitem.d.ts +9 -0
- package/typings/pdf_render/pdf_rowline.d.ts +17 -0
- package/typings/pdf_render/pdf_text.d.ts +11 -0
- package/typings/pdf_render/pdf_textbold.d.ts +7 -0
- package/typings/pdf_render/pdf_textbox.d.ts +8 -0
- package/typings/pdf_render/pdf_textfield.d.ts +28 -0
- package/typings/pdf_render/pdf_titlepanel.d.ts +8 -0
- package/typings/survey.d.ts +152 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IRect, DocController } from '../doc_controller';
|
|
2
|
+
import { PdfBrick } from './pdf_brick';
|
|
3
|
+
export declare class ColoredBrick extends PdfBrick {
|
|
4
|
+
private color;
|
|
5
|
+
private renderWidth?;
|
|
6
|
+
private renderHeight?;
|
|
7
|
+
constructor(controller: DocController, rect: IRect, color: string, renderWidth?: number, renderHeight?: number);
|
|
8
|
+
renderInteractive(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IQuestion } from 'survey-core';
|
|
2
|
+
import { IRect, DocController } from '../doc_controller';
|
|
3
|
+
import { TextBoxBrick } from './pdf_textbox';
|
|
4
|
+
export declare class CommentBrick extends TextBoxBrick {
|
|
5
|
+
protected controller: DocController;
|
|
6
|
+
constructor(question: IQuestion, controller: DocController, rect: IRect, isQuestion: boolean, index?: number);
|
|
7
|
+
protected shouldRenderFlatBorders(): boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IPdfBrick, TranslateXFunction } from './pdf_brick';
|
|
2
|
+
export declare class CompositeBrick implements IPdfBrick {
|
|
3
|
+
private bricks;
|
|
4
|
+
private _xLeft;
|
|
5
|
+
private _xRight;
|
|
6
|
+
private _yTop;
|
|
7
|
+
private _yBot;
|
|
8
|
+
isPageBreak: boolean;
|
|
9
|
+
constructor(...bricks: IPdfBrick[]);
|
|
10
|
+
get xLeft(): number;
|
|
11
|
+
set xLeft(xLeft: number);
|
|
12
|
+
get xRight(): number;
|
|
13
|
+
set xRight(xRight: number);
|
|
14
|
+
get yTop(): number;
|
|
15
|
+
set yTop(yTop: number);
|
|
16
|
+
get yBot(): number;
|
|
17
|
+
set yBot(yBot: number);
|
|
18
|
+
private shift;
|
|
19
|
+
get width(): number;
|
|
20
|
+
get height(): number;
|
|
21
|
+
render(): Promise<void>;
|
|
22
|
+
get isEmpty(): boolean;
|
|
23
|
+
addBrick(...bricks: IPdfBrick[]): void;
|
|
24
|
+
unfold(): IPdfBrick[];
|
|
25
|
+
translateX(func: TranslateXFunction): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PdfBrick } from './pdf_brick';
|
|
2
|
+
import { DocController, IRect } from '../doc_controller';
|
|
3
|
+
import { IQuestion } from 'survey-core';
|
|
4
|
+
export declare class CustomBrick extends PdfBrick {
|
|
5
|
+
private renderFunc;
|
|
6
|
+
constructor(question: IQuestion, controller: DocController, renderFunc: (doc: any, question: any, xLeft: number, yTop: number) => IRect);
|
|
7
|
+
renderInteractive(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IQuestion } from 'survey-core';
|
|
2
|
+
import { IRect, DocController } from '../doc_controller';
|
|
3
|
+
import { TextBrick } from './pdf_text';
|
|
4
|
+
export declare class DescriptionBrick extends TextBrick {
|
|
5
|
+
constructor(question: IQuestion, controller: DocController, rect: IRect, text: string);
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IQuestion, QuestionDropdownModel } from 'survey-core';
|
|
2
|
+
import { IRect, DocController } from '../doc_controller';
|
|
3
|
+
import { PdfBrick } from './pdf_brick';
|
|
4
|
+
export declare class DropdownBrick extends PdfBrick {
|
|
5
|
+
protected controller: DocController;
|
|
6
|
+
protected question: QuestionDropdownModel;
|
|
7
|
+
protected isQuestion: boolean;
|
|
8
|
+
protected isMultiline: boolean;
|
|
9
|
+
constructor(question: IQuestion, controller: DocController, rect: IRect);
|
|
10
|
+
renderInteractive(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PdfBrick } from './pdf_brick';
|
|
2
|
+
import { DocController, IRect } from '../doc_controller';
|
|
3
|
+
export declare class EmptyBrick extends PdfBrick {
|
|
4
|
+
protected controller: DocController;
|
|
5
|
+
private isBorderVisible;
|
|
6
|
+
constructor(rect: IRect, controller?: DocController, isBorderVisible?: boolean);
|
|
7
|
+
private resizeBorder;
|
|
8
|
+
renderInteractive(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IQuestion } from 'survey-core';
|
|
2
|
+
import { PdfBrick } from './pdf_brick';
|
|
3
|
+
import { IRect, DocController } from '../doc_controller';
|
|
4
|
+
export declare class HTMLBrick extends PdfBrick {
|
|
5
|
+
protected html: string;
|
|
6
|
+
private margins;
|
|
7
|
+
constructor(question: IQuestion, controller: DocController, rect: IRect, html: string, isImage?: boolean);
|
|
8
|
+
renderInteractive(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IQuestion } from 'survey-core';
|
|
2
|
+
import { PdfBrick } from './pdf_brick';
|
|
3
|
+
import { DocController } from '../doc_controller';
|
|
4
|
+
import { IPoint } from '../entries/pdf';
|
|
5
|
+
export declare class ImageBrick extends PdfBrick {
|
|
6
|
+
protected image: string;
|
|
7
|
+
protected originalWidth: number;
|
|
8
|
+
protected originalHeight: number;
|
|
9
|
+
constructor(question: IQuestion, controller: DocController, image: string, point: IPoint, originalWidth: number, originalHeight: number);
|
|
10
|
+
renderInteractive(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TextBrick } from './pdf_text';
|
|
2
|
+
export declare class LinkBrick extends TextBrick {
|
|
3
|
+
protected link: string;
|
|
4
|
+
private static readonly SCALE_FACTOR_MAGIC;
|
|
5
|
+
static readonly COLOR: string;
|
|
6
|
+
constructor(textFlat: TextBrick, link: string);
|
|
7
|
+
renderInteractive(): Promise<void>;
|
|
8
|
+
renderReadOnly(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IQuestion, ItemValue } from 'survey-core';
|
|
2
|
+
import { IRect, DocController } from '../doc_controller';
|
|
3
|
+
import { PdfBrick } from './pdf_brick';
|
|
4
|
+
export interface IRadiogroupWrapContext {
|
|
5
|
+
question: IQuestion;
|
|
6
|
+
readOnly: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class RadioGroupWrap {
|
|
9
|
+
name: string;
|
|
10
|
+
private controller;
|
|
11
|
+
private context;
|
|
12
|
+
private _radioGroup;
|
|
13
|
+
constructor(name: string, controller: DocController, context: IRadiogroupWrapContext);
|
|
14
|
+
addToPdf(color: string): void;
|
|
15
|
+
get radioGroup(): any;
|
|
16
|
+
get readOnly(): boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface IRadioGroupItemBrickContext {
|
|
19
|
+
question: IQuestion;
|
|
20
|
+
checked: boolean;
|
|
21
|
+
index: number;
|
|
22
|
+
item: ItemValue;
|
|
23
|
+
}
|
|
24
|
+
export declare class RadioItemBrick extends PdfBrick {
|
|
25
|
+
private context;
|
|
26
|
+
private radioGroupWrap;
|
|
27
|
+
private static readonly RADIOMARKER_READONLY_SYMBOL;
|
|
28
|
+
private static readonly RADIOMARKER_READONLY_FONT;
|
|
29
|
+
static readonly RADIOMARKER_READONLY_FONT_SIZE_SCALE: number;
|
|
30
|
+
constructor(controller: DocController, rect: IRect, context: IRadioGroupItemBrickContext, radioGroupWrap: RadioGroupWrap);
|
|
31
|
+
protected getShouldRenderReadOnly(): boolean;
|
|
32
|
+
renderInteractive(): Promise<void>;
|
|
33
|
+
renderReadOnly(): Promise<void>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IQuestion, QuestionRankingModel } from 'survey-core';
|
|
2
|
+
import { IRect, DocController } from '../doc_controller';
|
|
3
|
+
import { PdfBrick } from './pdf_brick';
|
|
4
|
+
export declare class RankingItemBrick extends PdfBrick {
|
|
5
|
+
protected mark: string;
|
|
6
|
+
protected question: QuestionRankingModel;
|
|
7
|
+
constructor(question: IQuestion, controller: DocController, rect: IRect, mark: string);
|
|
8
|
+
renderInteractive(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IRect, DocController } from '../doc_controller';
|
|
2
|
+
import { IPdfBrick, TranslateXFunction } from './pdf_brick';
|
|
3
|
+
export declare class RowlineBrick implements IPdfBrick {
|
|
4
|
+
protected controller: DocController;
|
|
5
|
+
color: string;
|
|
6
|
+
xLeft: number;
|
|
7
|
+
xRight: number;
|
|
8
|
+
yTop: number;
|
|
9
|
+
yBot: number;
|
|
10
|
+
isPageBreak: boolean;
|
|
11
|
+
constructor(controller: DocController, rect: IRect, color: string);
|
|
12
|
+
get width(): number;
|
|
13
|
+
get height(): number;
|
|
14
|
+
render(): Promise<void>;
|
|
15
|
+
unfold(): IPdfBrick[];
|
|
16
|
+
translateX(_: TranslateXFunction): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IQuestion } from 'survey-core';
|
|
2
|
+
import { IPoint, IRect, DocController } from '../doc_controller';
|
|
3
|
+
import { PdfBrick } from './pdf_brick';
|
|
4
|
+
export declare class TextBrick extends PdfBrick {
|
|
5
|
+
protected text: string;
|
|
6
|
+
protected align: any;
|
|
7
|
+
constructor(question: IQuestion, controller: DocController, rect: IRect, text: string);
|
|
8
|
+
private escapeText;
|
|
9
|
+
renderInteractive(): Promise<void>;
|
|
10
|
+
protected alignPoint(rect: IRect): IPoint;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IQuestion } from 'survey-core';
|
|
2
|
+
import { IRect, DocController } from '../doc_controller';
|
|
3
|
+
import { TextBrick } from './pdf_text';
|
|
4
|
+
export declare class TextBoldBrick extends TextBrick {
|
|
5
|
+
constructor(question: IQuestion, controller: DocController, rect: IRect, text: string);
|
|
6
|
+
renderInteractive(): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IQuestion } from 'survey-core';
|
|
2
|
+
import { IRect, DocController } from '../doc_controller';
|
|
3
|
+
import { TextFieldBrick } from './pdf_textfield';
|
|
4
|
+
export declare class TextBoxBrick extends TextFieldBrick {
|
|
5
|
+
protected isQuestion: boolean;
|
|
6
|
+
protected isMultiline: boolean;
|
|
7
|
+
constructor(question: IQuestion, controller: DocController, rect: IRect, isQuestion?: boolean, isMultiline?: boolean, index?: number);
|
|
8
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IQuestion, QuestionTextModel } from 'survey-core';
|
|
2
|
+
import { IRect, DocController } from '../doc_controller';
|
|
3
|
+
import { IPdfBrick, PdfBrick, TranslateXFunction } from './pdf_brick';
|
|
4
|
+
export declare class TextFieldBrick extends PdfBrick {
|
|
5
|
+
protected isQuestion: boolean;
|
|
6
|
+
protected fieldName: string;
|
|
7
|
+
protected value: string;
|
|
8
|
+
protected placeholder: string;
|
|
9
|
+
isReadOnly: boolean;
|
|
10
|
+
protected isMultiline: boolean;
|
|
11
|
+
protected inputType: string;
|
|
12
|
+
protected question: QuestionTextModel;
|
|
13
|
+
constructor(question: IQuestion, controller: DocController, rect: IRect, isQuestion: boolean, fieldName: string, value: string, placeholder: string, isReadOnly: boolean, isMultiline: boolean, inputType: string);
|
|
14
|
+
private renderColorQuestion;
|
|
15
|
+
renderInteractive(): Promise<void>;
|
|
16
|
+
protected shouldRenderFlatBorders(): boolean;
|
|
17
|
+
protected getShouldRenderReadOnly(): boolean;
|
|
18
|
+
private _textBrick;
|
|
19
|
+
get textBrick(): IPdfBrick;
|
|
20
|
+
set textBrick(val: IPdfBrick);
|
|
21
|
+
renderReadOnly(): Promise<void>;
|
|
22
|
+
unfold(): IPdfBrick[];
|
|
23
|
+
translateX(func: TranslateXFunction): void;
|
|
24
|
+
protected setXLeft(val: number): void;
|
|
25
|
+
protected setXRight(val: number): void;
|
|
26
|
+
protected setYTop(val: number): void;
|
|
27
|
+
protected setYBottom(val: number): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IQuestion, QuestionTextModel } from 'survey-core';
|
|
2
|
+
import { IRect, DocController } from '../doc_controller';
|
|
3
|
+
import { TextBoldBrick } from './pdf_textbold';
|
|
4
|
+
export declare class TitlePanelBrick extends TextBoldBrick {
|
|
5
|
+
protected question: QuestionTextModel;
|
|
6
|
+
constructor(question: IQuestion, controller: DocController, rect: IRect, text: string);
|
|
7
|
+
renderInteractive(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { SurveyModel, EventBase } from 'survey-core';
|
|
2
|
+
import { IDocOptions, DocController } from './doc_controller';
|
|
3
|
+
import { EventAsync } from './event_handler/event_handler';
|
|
4
|
+
import { DrawCanvas } from './event_handler/draw_canvas';
|
|
5
|
+
import { AdornersOptions, AdornersPanelOptions, AdornersPageOptions } from './event_handler/adorners';
|
|
6
|
+
/**
|
|
7
|
+
* The `SurveyPDF` object enables you to export your surveys and forms to PDF documents.
|
|
8
|
+
*
|
|
9
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/ (linkStyle))
|
|
10
|
+
*/
|
|
11
|
+
export declare class SurveyPDF extends SurveyModel {
|
|
12
|
+
private static currentlySaving;
|
|
13
|
+
private static saveQueue;
|
|
14
|
+
options: IDocOptions;
|
|
15
|
+
constructor(jsonObject: any, options?: IDocOptions);
|
|
16
|
+
get haveCommercialLicense(): boolean;
|
|
17
|
+
set haveCommercialLicense(val: boolean);
|
|
18
|
+
/**
|
|
19
|
+
* An event that is raised when SurveyJS PDF Generator renders a page header. Handle this event to customize the header.
|
|
20
|
+
*
|
|
21
|
+
* Parameters:
|
|
22
|
+
*
|
|
23
|
+
* - `sender`: `SurveyPDF`\
|
|
24
|
+
* A SurveyPDF instance that raised the event.
|
|
25
|
+
*
|
|
26
|
+
* - `canvas`: [`DrawCanvas`](https://surveyjs.io/pdf-generator/documentation/api-reference/drawcanvas)\
|
|
27
|
+
* An object that you can use to draw text and images in the page header.
|
|
28
|
+
*
|
|
29
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/customize-header-and-footer-of-pdf-form/ (linkStyle))
|
|
30
|
+
*/
|
|
31
|
+
onRenderHeader: EventAsync<SurveyPDF, DrawCanvas>;
|
|
32
|
+
/**
|
|
33
|
+
* An event that is raised when SurveyJS PDF Generator renders a page footer. Handle this event to customize the footer.
|
|
34
|
+
*
|
|
35
|
+
* Parameters:
|
|
36
|
+
*
|
|
37
|
+
* - `sender`: `SurveyPDF`\
|
|
38
|
+
* A SurveyPDF instance that raised the event.
|
|
39
|
+
*
|
|
40
|
+
* - `canvas`: [`DrawCanvas`](https://surveyjs.io/pdf-generator/documentation/api-reference/drawcanvas)\
|
|
41
|
+
* An object that you can use to draw text and images in the page footer.
|
|
42
|
+
*
|
|
43
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/customize-header-and-footer-of-pdf-form/ (linkStyle))
|
|
44
|
+
*/
|
|
45
|
+
onRenderFooter: EventAsync<SurveyPDF, DrawCanvas>;
|
|
46
|
+
/**
|
|
47
|
+
* An event that is raised when SurveyJS PDF Generator renders a survey question. Handle this event to customize question rendering.
|
|
48
|
+
*
|
|
49
|
+
* Parameters:
|
|
50
|
+
*
|
|
51
|
+
* - `sender`: `SurveyPDF`\
|
|
52
|
+
* A SurveyPDF instance that raised the event.
|
|
53
|
+
*
|
|
54
|
+
* - `options.question`: [`Question`](https://surveyjs.io/form-library/documentation/api-reference/question)\
|
|
55
|
+
* A survey question that is being rendered.
|
|
56
|
+
*
|
|
57
|
+
* - `options.point`: `IPoint`\
|
|
58
|
+
* An object with coordinates of the top-left corner of the element being rendered. This object contains the following properties: `{ xLeft: number, yTop: number }`.
|
|
59
|
+
*
|
|
60
|
+
* - `options.bricks`: [`PdfBrick[]`](https://surveyjs.io/pdf-generator/documentation/api-reference/pdfbrick)\
|
|
61
|
+
* An array of [bricks](https://surveyjs.io/pdf-generator/documentation/customize-survey-question-rendering-in-pdf-form#custom-rendering) used to render the element.
|
|
62
|
+
*
|
|
63
|
+
* - `options.controller`: [`DocController`](https://surveyjs.io/pdf-generator/documentation/api-reference/doccontroller)\
|
|
64
|
+
* An object that provides access to main PDF document properties (font, margins, page width and height) and allows you to modify them.
|
|
65
|
+
*
|
|
66
|
+
* - `options.repository`: `FlatRepository`\
|
|
67
|
+
* A repository with classes that render elements to PDF. Use its `create` method if you need to create a new instance of a rendering class.
|
|
68
|
+
*
|
|
69
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/how-to-use-adorners-in-pdf-forms/ (linkStyle))
|
|
70
|
+
*/
|
|
71
|
+
onRenderQuestion: EventAsync<SurveyPDF, AdornersOptions>;
|
|
72
|
+
/**
|
|
73
|
+
* An event that is raised when SurveyJS PDF Generator renders a panel. Handle this event to customize panel rendering.
|
|
74
|
+
*
|
|
75
|
+
* Parameters:
|
|
76
|
+
*
|
|
77
|
+
* - `sender`: `SurveyPDF`\
|
|
78
|
+
* A SurveyPDF instance that raised the event.
|
|
79
|
+
*
|
|
80
|
+
* - `options.panel`: [`PanelModel`](https://surveyjs.io/form-library/documentation/api-reference/panel-model)\
|
|
81
|
+
* A panel that is being rendered.
|
|
82
|
+
*
|
|
83
|
+
* - `options.point`: `IPoint`\
|
|
84
|
+
* An object with coordinates of the top-left corner of the element being rendered. This object contains the following properties: `{ xLeft: number, yTop: number }`.
|
|
85
|
+
*
|
|
86
|
+
* - `options.bricks`: [`PdfBrick[]`](https://surveyjs.io/pdf-generator/documentation/api-reference/pdfbrick)\
|
|
87
|
+
* An array of [bricks](https://surveyjs.io/pdf-generator/documentation/customize-survey-question-rendering-in-pdf-form#custom-rendering) used to render the element.
|
|
88
|
+
*
|
|
89
|
+
* - `options.controller`: [`DocController`](https://surveyjs.io/pdf-generator/documentation/api-reference/doccontroller)\
|
|
90
|
+
* An object that provides access to main PDF document properties (font, margins, page width and height) and allows you to modify them.
|
|
91
|
+
*
|
|
92
|
+
* - `options.repository`: `FlatRepository`\
|
|
93
|
+
* A repository with classes that render elements to PDF. Use its `create` method if you need to create a new instance of a rendering class.
|
|
94
|
+
*
|
|
95
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/how-to-use-adorners-in-pdf-forms/ (linkStyle))
|
|
96
|
+
*/
|
|
97
|
+
onRenderPanel: EventAsync<SurveyPDF, AdornersPanelOptions>;
|
|
98
|
+
/**
|
|
99
|
+
* An event that is raised when SurveyJS PDF Generator renders a page. Handle this event to customize page rendering.
|
|
100
|
+
*
|
|
101
|
+
* Parameters:
|
|
102
|
+
*
|
|
103
|
+
* - `sender`: `SurveyPDF`\
|
|
104
|
+
* A SurveyPDF instance that raised the event.
|
|
105
|
+
*
|
|
106
|
+
* - `options.page`: [`PageModel`](https://surveyjs.io/form-library/documentation/api-reference/page-model)\
|
|
107
|
+
* A page that is being rendered.
|
|
108
|
+
*
|
|
109
|
+
* - `options.point`: `IPoint`\
|
|
110
|
+
* An object with coordinates of the top-left corner of the element being rendered. This object contains the following properties: `{ xLeft: number, yTop: number }`.
|
|
111
|
+
*
|
|
112
|
+
* - `options.bricks`: [`PdfBrick[]`](https://surveyjs.io/pdf-generator/documentation/api-reference/pdfbrick)\
|
|
113
|
+
* An array of [bricks](https://surveyjs.io/pdf-generator/documentation/customize-survey-question-rendering-in-pdf-form#custom-rendering) used to render the element.
|
|
114
|
+
*
|
|
115
|
+
* - `options.controller`: [`DocController`](https://surveyjs.io/pdf-generator/documentation/api-reference/doccontroller)\
|
|
116
|
+
* An object that provides access to main PDF document properties (font, margins, page width and height) and allows you to modify them.
|
|
117
|
+
*
|
|
118
|
+
* - `options.repository`: `FlatRepository`\
|
|
119
|
+
* A repository with classes that render elements to PDF. Use its `create` method if you need to create a new instance of a rendering class.
|
|
120
|
+
*
|
|
121
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/how-to-use-adorners-in-pdf-forms/ (linkStyle))
|
|
122
|
+
*/
|
|
123
|
+
onRenderPage: EventAsync<SurveyPDF, AdornersPageOptions>;
|
|
124
|
+
onDocControllerCreated: EventBase<SurveyPDF, {
|
|
125
|
+
controller: DocController;
|
|
126
|
+
}>;
|
|
127
|
+
onRenderCheckItemAcroform: EventAsync<SurveyPDF, any>;
|
|
128
|
+
onRenderRadioGroupWrapAcroform: EventAsync<SurveyPDF, any>;
|
|
129
|
+
onRenderRadioItemAcroform: EventAsync<SurveyPDF, any>;
|
|
130
|
+
private waitForQuestionIsReady;
|
|
131
|
+
private waitForCoreIsReady;
|
|
132
|
+
getUpdatedCheckItemAcroformOptions(options: any): void;
|
|
133
|
+
getUpdatedRadioGroupWrapOptions(options: any): void;
|
|
134
|
+
getUpdatedRadioItemAcroformOptions(options: any): void;
|
|
135
|
+
private correctBricksPosition;
|
|
136
|
+
protected renderSurvey(controller: DocController): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* An asynchronous method that starts download of the generated PDF file in the web browser.
|
|
139
|
+
*
|
|
140
|
+
* @param fileName *(Optional)* A file name with the ".pdf" extension. Default value: `"survey_result.pdf"`.
|
|
141
|
+
*/
|
|
142
|
+
save(fileName?: string): Promise<any>;
|
|
143
|
+
/**
|
|
144
|
+
* An asynchronous method that allows you to get PDF content in different formats.
|
|
145
|
+
*
|
|
146
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/convert-pdf-form-blob-base64-raw-pdf-javascript/ (linkStyle))
|
|
147
|
+
*
|
|
148
|
+
* @param type *(Optional)* One of `"blob"`, `"bloburl"`, `"dataurlstring"`. Do not specify this parameter if you want to get raw PDF content as a string value.
|
|
149
|
+
*
|
|
150
|
+
*/
|
|
151
|
+
raw(type?: string): Promise<string>;
|
|
152
|
+
}
|