survey-pdf 2.0.7 → 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.
- package/fesm/survey.pdf.fonts.mjs +1 -1
- package/fesm/survey.pdf.mjs +18 -5
- package/fesm/survey.pdf.mjs.map +1 -1
- package/package.json +2 -2
- package/survey.pdf.fonts.js +1 -1
- package/survey.pdf.fonts.min.js.LICENSE.txt +1 -1
- package/survey.pdf.js +18 -5
- package/survey.pdf.js.map +1 -1
- package/survey.pdf.min.js +1 -1
- package/survey.pdf.min.js.LICENSE.txt +1 -1
- package/typings/doc_controller.d.ts +20 -5
- package/typings/event_handler/draw_canvas.d.ts +4 -0
- package/typings/survey.d.ts +2 -1
package/fesm/survey.pdf.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS PDF library v2.0.
|
|
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
|
*/
|
|
@@ -6221,9 +6221,9 @@ class DocOptions {
|
|
|
6221
6221
|
DocOptions.MM_TO_PT = 72 / 25.4;
|
|
6222
6222
|
DocOptions.FONT_SIZE = 14;
|
|
6223
6223
|
/**
|
|
6224
|
-
* The `DocController` object includes an API that allows you to configure
|
|
6224
|
+
* The `DocController` object includes an API that allows you to configure main PDF document properties (font, margins, page width and height).
|
|
6225
6225
|
*
|
|
6226
|
-
* [View Demo](https://surveyjs.io/pdf-generator/examples/
|
|
6226
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/change-font-in-pdf-form/ (linkStyle))
|
|
6227
6227
|
*/
|
|
6228
6228
|
class DocController extends DocOptions {
|
|
6229
6229
|
constructor(options = {}) {
|
|
@@ -6250,6 +6250,14 @@ class DocController extends DocOptions {
|
|
|
6250
6250
|
this._fontStyle = 'normal';
|
|
6251
6251
|
this.marginsStack = [];
|
|
6252
6252
|
}
|
|
6253
|
+
/**
|
|
6254
|
+
* Adds a custom font to the PDF Generator.
|
|
6255
|
+
*
|
|
6256
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/change-font-in-pdf-form/ (linkStyle))
|
|
6257
|
+
* @param fontName A custom name that you will use to apply the custom font.
|
|
6258
|
+
* @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.
|
|
6259
|
+
* @param fontStyle The style of the custom font: `"normal"`, `"bold"`, `"italic"`, or `"bolditalic"`.
|
|
6260
|
+
*/
|
|
6253
6261
|
static addFont(fontName, base64, fontStyle) {
|
|
6254
6262
|
let font = DocController.customFonts[fontName];
|
|
6255
6263
|
if (!font) {
|
|
@@ -7355,6 +7363,8 @@ class DrawCanvas {
|
|
|
7355
7363
|
}
|
|
7356
7364
|
/**
|
|
7357
7365
|
* Draws a piece of text within the drawing area.
|
|
7366
|
+
*
|
|
7367
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/customize-header-and-footer-of-pdf-form/ (linkStyle))
|
|
7358
7368
|
* @param textOptions An [`IDrawTextOptions`](https://surveyjs.io/pdf-generator/documentation/api-reference/idrawtextoptions) object that configures the drawing.
|
|
7359
7369
|
*/
|
|
7360
7370
|
drawText(textOptions) {
|
|
@@ -7377,6 +7387,8 @@ class DrawCanvas {
|
|
|
7377
7387
|
}
|
|
7378
7388
|
/**
|
|
7379
7389
|
* Draws an image within the drawing area.
|
|
7390
|
+
*
|
|
7391
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/customize-header-and-footer-of-pdf-form/ (linkStyle))
|
|
7380
7392
|
* @param imageOptions An [`IDrawImageOptions`](https://surveyjs.io/pdf-generator/documentation/api-reference/idrawimageoptions) object that configures drawing.
|
|
7381
7393
|
*/
|
|
7382
7394
|
drawImage(imageOptions) {
|
|
@@ -7655,8 +7667,9 @@ class SurveyPDF extends SurveyModel {
|
|
|
7655
7667
|
});
|
|
7656
7668
|
}
|
|
7657
7669
|
/**
|
|
7658
|
-
* An asynchronous method that starts download of the generated PDF file in the web browser.
|
|
7670
|
+
* An asynchronous method that starts the download of the generated PDF file in the web browser.
|
|
7659
7671
|
*
|
|
7672
|
+
* [View Demo](https://surveyjs.io/pdf-generator/examples/save-completed-forms-as-pdf-files/ (linkStyle))
|
|
7660
7673
|
* @param fileName *(Optional)* A file name with the ".pdf" extension. Default value: `"survey_result.pdf"`.
|
|
7661
7674
|
*/
|
|
7662
7675
|
save() {
|
|
@@ -9264,7 +9277,7 @@ class CustomBrick extends PdfBrick {
|
|
|
9264
9277
|
}
|
|
9265
9278
|
}
|
|
9266
9279
|
|
|
9267
|
-
checkLibraryVersion(`${"2.0.
|
|
9280
|
+
checkLibraryVersion(`${"2.0.8"}`, 'survey-pdf');
|
|
9268
9281
|
|
|
9269
9282
|
export { BooleanItemBrick, CheckItemBrick, CheckboxItemBrick, CommentBrick, CompositeBrick, CustomBrick, DocController, DocOptions, DrawCanvas, DropdownBrick, EmptyBrick, EventHandler, FlatBooleanCheckbox as FlatBoolean, FlatCheckbox, FlatComment, FlatCustomModel, FlatDropdown, FlatExpression, FlatFile, FlatHTML, FlatImage, FlatImagePicker, FlatMatrix, FlatMatrixDynamic, FlatMatrixMultiple, FlatMultipleText, FlatPanelDynamic, FlatQuestion, FlatQuestionDefault, FlatRadiogroup, FlatRanking, FlatRating, FlatRepository, FlatSelectBase, FlatSignaturePad, FlatSurvey, FlatTextbox, HTMLBrick, HorizontalAlign, ImageBrick, LinkBrick, PagePacker, PdfBrick, RadioItemBrick, RankingItemBrick, RowlineBrick, SurveyHelper, SurveyPDF, TextBoldBrick, TextBoxBrick, TextBrick, TextFieldBrick, TitlePanelBrick, VerticalAlign };
|
|
9270
9283
|
//# sourceMappingURL=survey.pdf.mjs.map
|