survey-pdf 1.9.32 → 1.9.35

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/README.md CHANGED
@@ -1,6 +1,4 @@
1
- ## PDF Export for SurveyJS
2
-
3
- SurveyJS PDF exporter library is an easy way to render [SurveyJS Library](https://surveyjs.io/Overview/Library/) surveys to PDF which can be emailed or printed.
1
+ # SurveyJS PDF Export
4
2
 
5
3
  [![Build Status](https://dev.azure.com/SurveyJS/SurveyJS%20Integration%20Tests/_apis/build/status/SurveyJS%20Library?branchName=master)](https://dev.azure.com/SurveyJS/SurveyJS%20Integration%20Tests/_build/latest?definitionId=7&branchName=master)
6
4
  <a href="https://github.com/surveyjs/survey-pdf/issues">
@@ -10,102 +8,72 @@ SurveyJS PDF exporter library is an easy way to render [SurveyJS Library](https:
10
8
  <img alt="Closed issues" title="Closed Issues" src="https://img.shields.io/github/issues-closed/surveyjs/survey-pdf.svg">
11
9
  </a>
12
10
 
11
+ SurveyJS PDF Export is a client-side extension over the [SurveyJS Library](https://github.com/surveyjs/survey-library) that enables users to save surveys as PDF documents.
12
+
13
13
  ### Features
14
14
 
15
- SurveyJS PDF exporter is represented by [SurveyPDF](https://surveyjs.io/Documentation/Pdf-Export?id=surveypdf) object which is a [SurveyModel](https://surveyjs.io/Documentation/Library?id=surveymodel) descendant. It inherits all the functionality of SurveyJS Model and adds PDF export specific features.
16
-
17
- - Render all SurveyJS questions (textboxes, checkboxes, dropdowns, etc.) with results
18
- - Support of SurveyJS widgets and your own custom adorners
19
- - Generate PDF interactive forms which can be filled inside the PDF document
20
- - Automatic splitting into separate pages without cuts inside the questions
21
- - Customizable font and sizes of page and markdown text
22
- - Ability to draw header and footer with logo and company information
23
- - API to save PDF on disk or get PDF file via raw string
24
-
25
- ### Screenshots
26
-
27
- ![SurveyJS PDF Exporter example page 1](https://raw.githubusercontent.com/surveyjs/survey-pdf/master/docs/images/survey-pdf-page-1.png)
28
- ![SurveyJS PDF Exporter example page 2](https://raw.githubusercontent.com/surveyjs/survey-pdf/master/docs/images/survey-pdf-page-2.png)
29
-
30
- ### Usage (modern ES, modules)
31
-
32
- ```javascript
33
- import * as SurveyPDF from "survey-pdf";
34
- ```
35
-
36
- ### Usage (ES5, scripts)
37
-
38
- Add these scripts to your web page
39
-
40
- ```html
41
- <!-- jsPDF library -->
42
- <script src="https://unpkg.com/jspdf@latest/dist/jspdf.umd.min.js"></script>
43
- <!-- SurveyJS Core library -->
44
- <script src="https://unpkg.com/survey-core@latest/survey.core.min.js"></script>
45
- <!-- SurveyPDF Exporter library -->
46
- <script src="https://unpkg.com/survey-pdf@latest/survey.pdf.min.js"></script>
47
-
48
- <!-- Uncomment next line to add html and markdown text support -->
49
- <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.6.4/showdown.min.js"></script> -->
50
- <!-- Uncomment next line to add IE11 support -->
51
- <!-- <script src="https://unpkg.com/jspdf/dist/polyfills.umd.js"></script> -->
52
- ```
53
-
54
- Also you may load any of SurveyJS with framework scripts without loading SurveyJS Core. Look at simple package dependency diagram
55
-
56
- <img src="https://raw.githubusercontent.com/surveyjs/survey-pdf/master/docs/images/package-dependency.png" alt="SurveyJS package dependency" width="50%"/>
57
-
58
- Example of export SurveyJS library JSON to PDF
59
-
60
- ```javascript
61
- var options = {
62
- fontSize: 14,
63
- margins: {
64
- left: 10,
65
- right: 10,
66
- top: 18,
67
- bot: 10
68
- }
69
- };
70
- //json is same as for SurveyJS Library
71
- var surveyPDF = new SurveyPDF.SurveyPDF(json, options);
72
-
73
- //uncomment next code to add html and markdown text support
74
- /*var converter = new showdown.Converter();
75
- surveyPDF.onTextMarkdown.add(function(survey, options) {
76
- var str = converter.makeHtml(options.text);
77
- str = str.substring(3);
78
- str = str.substring(0, str.length - 4);
79
- options.html = str;
80
- });*/
81
-
82
- surveyPDF.onRenderHeader.add(function(_, canvas) {
83
- canvas.drawText({
84
- text:
85
- "SurveyJS PDF | Please purchase a SurveyJS PDF developer license to use it in your app | https://surveyjs.io/Buy",
86
- fontSize: 10
87
- });
88
- });
89
- surveyPDF.save();
90
- ```
91
-
92
- ### Examples
93
-
94
- - [es5 style example](https://surveyjs.io/Examples/Pdf-Export)
95
- - [angular-cli](https://codesandbox.io/s/survey-pdf-angular-example-xpev7)
96
-
97
- ### Constraints
98
-
99
- - No support of dynamic elements (visibleIf, buttons, validators, etc.)
100
- - Implied DPI 72 when set questions width
101
- - Question Text input types supported: text, password, color
102
- - Question Radiogroup not able to set readOnly for separate items
103
- - Question Imagepicker imagefit is always fill
104
- - Question Html support restricted subset of html markup
105
- - Question File save files via RMB in Chrome only
106
- - Question Panel state is always expanded
107
- - Question Panel Dynamic mode is only list and state default
108
-
109
- ### License
110
-
111
- [Commercial](https://surveyjs.io/Home/Licenses#PdfExport)
15
+ - Support for all built-in SurveyJS Library question types
16
+ - Export of survey results
17
+ - Interactive PDF documents that allow users to fill them
18
+ - Automatic page breaks
19
+ - Markdown support
20
+ - Customizable page format and font
21
+ - Header and footer support
22
+ - An API to save a PDF document on the user's computer or get raw PDF content
23
+
24
+ ## Get Started
25
+
26
+ - [Angular](https://surveyjs.io/Documentation/Pdf-Export?id=get-started-angular)
27
+ - [Vue](https://surveyjs.io/Documentation/Pdf-Export?id=get-started-vue)
28
+ - [React](https://surveyjs.io/Documentation/Pdf-Export?id=get-started-react)
29
+ - [Knockout](https://surveyjs.io/Documentation/Pdf-Export?id=get-started-knockout)
30
+ - [jQuery](https://surveyjs.io/Documentation/Pdf-Export?id=get-started-jquery)
31
+
32
+ ## Resources
33
+
34
+ - [Website](https://surveyjs.io/)
35
+ - [Documentation](https://surveyjs.io/Documentation/Pdf-Export)
36
+ - [Live Examples](https://surveyjs.io/Examples/Pdf-Export)
37
+ - [What's New](https://surveyjs.io/WhatsNew)
38
+
39
+ ## Build SurveyJS PDF Export from Sources
40
+
41
+ 1. **Clone the repo**
42
+
43
+ ```
44
+ git clone https://github.com/surveyjs/survey-pdf.git
45
+ cd survey-pdf
46
+ ```
47
+
48
+ 1. **Install dependencies**
49
+ Make sure that you have Node.js v6.0.0 or later and npm v2.7.0 or later installed.
50
+
51
+ ```
52
+ npm install
53
+ ```
54
+
55
+ 1. **Build the library**
56
+
57
+ ```
58
+ npm run build_prod
59
+ ```
60
+
61
+ You can find the built scripts and style sheets in the `survey-pdf` folder under the `packages` directory.
62
+
63
+ 1. **Run test examples**
64
+
65
+ ```
66
+ npm start
67
+ ```
68
+
69
+ This command runs a local HTTP server at http://localhost:7777/.
70
+
71
+ 1. **Run unit tests**
72
+
73
+ ```
74
+ npm test
75
+ ```
76
+
77
+ ## Licensing
78
+
79
+ SurveyJS PDF Export is **not available for free commercial usage**. If you want to integrate it into your application, you must purchase a [commercial license](/Licenses#SurveyCreator).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-pdf",
3
- "version": "1.9.32",
3
+ "version": "1.9.35",
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",
package/survey.pdf.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*Type definitions for SurveyJS PDF library v1.9.32
1
+ /*Type definitions for SurveyJS PDF library v1.9.35
2
2
  Copyright (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
3
3
  Definitions by: Devsoft Baltic OÜ <https://github.com/surveyjs/>
4
4
  */
@@ -601,7 +601,7 @@ export declare class FlatMatrixRow extends FlatRadiogroup {
601
601
  generateFlatsContent(point: IPoint): Promise<IPdfBrick[]>;
602
602
  protected generateTextComposite(point: IPoint, column: ItemValue, index: number): Promise<IPdfBrick>;
603
603
  protected generateItemCompoiste(point: IPoint, column: ItemValue, index: number): Promise<IPdfBrick>;
604
- protected generateFlatsHorizontallyCells(point: IPoint): Promise<IPdfBrick[]>;
604
+ protected generateFlatsHorizontallyCells(point: IPoint): Promise<(IPdfBrick | CompositeBrick)[]>;
605
605
  protected generateFlatsVerticallyCells(point: IPoint): Promise<IPdfBrick[]>;
606
606
  }
607
607
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v1.9.32
2
+ * surveyjs - SurveyJS PDF library v1.9.35
3
3
  * Copyright (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS PDF library v1.9.32
2
+ * surveyjs - SurveyJS PDF library v1.9.35
3
3
  * Copyright (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */