survey-pdf 2.0.6 → 2.0.8

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v2.0.6
2
+ * surveyjs - SurveyJS PDF library v2.0.8
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
  */
@@ -91,8 +91,9 @@ export interface IDocOptions {
91
91
  * - `"ledger"`
92
92
  * - `"tabloid"`
93
93
  * - `"credit-card"`
94
- * - Array<number> - custom page size in millimeters, for example, `[210, 297]`.
94
+ * - `[width, height]` - Custom page size in millimeters, for example, `[210, 297]`.
95
95
  *
96
+ * [View Demo](https://surveyjs.io/pdf-generator/examples/save-completed-forms-as-pdf-files/ (linkStyle))
96
97
  * @see orientation
97
98
  */
98
99
  format?: string | number[];
@@ -114,7 +115,7 @@ export interface IDocOptions {
114
115
  * - `"Times"`
115
116
  * - `"Symbol"`
116
117
  * - `"ZapfDingbats"`
117
- * - [Custom font name](https://surveyjs.io/Documentation/Pdf-Export?id=Customization-ChangeFonts#use-custom-font)
118
+ * - [Custom font name](https://surveyjs.io/pdf-generator/documentation/customize-pdf-form-settings#custom-fonts)
118
119
  *
119
120
  * [View Demo](https://surveyjs.io/pdf-generator/examples/change-font-in-pdf-form/ (linkStyle))
120
121
  * @see fontSize
@@ -132,7 +133,11 @@ export interface IDocOptions {
132
133
  */
133
134
  useCustomFontInHtml?: boolean;
134
135
  /**
135
- * Page margins. Set this property to an object with the following fields: `top`, `bot`, `left`, `right`.
136
+ * Page margins.
137
+ *
138
+ * Set this property to an object with the following fields: `top`, `bot`, `left`, `right`.
139
+ *
140
+ * [View Demo](https://surveyjs.io/pdf-generator/examples/save-completed-forms-as-pdf-files/ (linkStyle))
136
141
  */
137
142
  margins?: IMargin;
138
143
  /**
@@ -144,6 +149,8 @@ export interface IDocOptions {
144
149
  * - `"image"` - Render HTML questions as images.
145
150
  * - `"auto"` (default) - Select between the `"standard"` and `"image"` modes automatically based on the HTML content.
146
151
  *
152
+ * [View Demo](https://surveyjs.io/pdf-generator/examples/split-html-image-across-pages/ (linkStyle))
153
+ *
147
154
  * You can override this property for an individual HTML question. Set the question's `renderAs` property to `"standard"` or `"image"` in the survey JSON schema.
148
155
  * @see useCustomFontInHtml
149
156
  */
@@ -245,9 +252,9 @@ export declare class DocOptions implements IDocOptions {
245
252
  get tagboxSelectedChoicesOnly(): boolean;
246
253
  }
247
254
  /**
248
- * The `DocController` object includes an API that allows you to configure the resulting PDF document. You can access this object within functions that handle the `SurveyPDF`'s [`onRender...`](https://surveyjs.io/pdf-generator/documentation/api-reference/surveypdf#onRenderFooter) events.
255
+ * The `DocController` object includes an API that allows you to configure main PDF document properties (font, margins, page width and height).
249
256
  *
250
- * [View Demo](https://surveyjs.io/pdf-generator/examples/how-to-use-adorners-in-pdf-forms/ (linkStyle))
257
+ * [View Demo](https://surveyjs.io/pdf-generator/examples/change-font-in-pdf-form/ (linkStyle))
251
258
  */
252
259
  export declare class DocController extends DocOptions {
253
260
  private _doc;
@@ -263,6 +270,14 @@ export declare class DocController extends DocOptions {
263
270
  bolditalic: string;
264
271
  };
265
272
  };
273
+ /**
274
+ * Adds a custom font to the PDF Generator.
275
+ *
276
+ * [View Demo](https://surveyjs.io/pdf-generator/examples/change-font-in-pdf-form/ (linkStyle))
277
+ * @param fontName A custom name that you will use to apply the custom font.
278
+ * @param base64 The custom font as a Base64-encoded string. To encode your font to Base64, obtain it as a TTF file and use any TTF-to-Base64 online converter.
279
+ * @param fontStyle The style of the custom font: `"normal"`, `"bold"`, `"italic"`, or `"bolditalic"`.
280
+ */
266
281
  static addFont(fontName: string, base64: string, fontStyle: 'normal' | 'bold' | 'italic' | 'bolditalic'): void;
267
282
  get doc(): any;
268
283
  get helperDoc(): any;
@@ -122,11 +122,15 @@ export declare class DrawCanvas {
122
122
  private alignRect;
123
123
  /**
124
124
  * Draws a piece of text within the drawing area.
125
+ *
126
+ * [View Demo](https://surveyjs.io/pdf-generator/examples/customize-header-and-footer-of-pdf-form/ (linkStyle))
125
127
  * @param textOptions An [`IDrawTextOptions`](https://surveyjs.io/pdf-generator/documentation/api-reference/idrawtextoptions) object that configures the drawing.
126
128
  */
127
129
  drawText(textOptions: IDrawTextOptions): void;
128
130
  /**
129
131
  * Draws an image within the drawing area.
132
+ *
133
+ * [View Demo](https://surveyjs.io/pdf-generator/examples/customize-header-and-footer-of-pdf-form/ (linkStyle))
130
134
  * @param imageOptions An [`IDrawImageOptions`](https://surveyjs.io/pdf-generator/documentation/api-reference/idrawimageoptions) object that configures drawing.
131
135
  */
132
136
  drawImage(imageOptions: IDrawImageOptions): Promise<void>;
@@ -136,8 +136,9 @@ export declare class SurveyPDF extends SurveyModel {
136
136
  private correctBricksPosition;
137
137
  protected renderSurvey(controller: DocController): Promise<void>;
138
138
  /**
139
- * An asynchronous method that starts download of the generated PDF file in the web browser.
139
+ * An asynchronous method that starts the download of the generated PDF file in the web browser.
140
140
  *
141
+ * [View Demo](https://surveyjs.io/pdf-generator/examples/save-completed-forms-as-pdf-files/ (linkStyle))
141
142
  * @param fileName *(Optional)* A file name with the ".pdf" extension. Default value: `"survey_result.pdf"`.
142
143
  */
143
144
  save(fileName?: string): Promise<any>;