@progress/kendo-angular-pdf-export 17.0.0-develop.21 → 17.0.0-develop.22
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/{esm2020 → esm2022}/package-metadata.mjs +2 -2
- package/{esm2020 → esm2022}/pdf-export-margin.component.mjs +23 -3
- package/{esm2020 → esm2022}/pdf-export-template.directive.mjs +4 -3
- package/{esm2020 → esm2022}/pdf-export.component.mjs +142 -17
- package/{esm2020 → esm2022}/pdf-export.module.mjs +4 -4
- package/{fesm2020 → fesm2022}/progress-kendo-angular-pdf-export.mjs +175 -29
- package/package.json +11 -17
- package/pdf-export-margin.component.d.ts +1 -1
- package/pdf-export.component.d.ts +2 -2
- package/fesm2015/progress-kendo-angular-pdf-export.mjs +0 -324
- /package/{esm2020 → esm2022}/compile-template.mjs +0 -0
- /package/{esm2020 → esm2022}/directives.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/progress-kendo-angular-pdf-export.mjs +0 -0
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-pdf-export',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
13
|
-
version: '17.0.0-develop.
|
|
12
|
+
publishDate: 1730103526,
|
|
13
|
+
version: '17.0.0-develop.22',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
15
15
|
};
|
|
@@ -9,6 +9,26 @@ const FIELDS = ['bottom', 'left', 'right', 'top'];
|
|
|
9
9
|
* Represents the Kendo UI PDFMargin component for Angular.
|
|
10
10
|
*/
|
|
11
11
|
export class PDFExportMarginComponent {
|
|
12
|
+
/**
|
|
13
|
+
* The bottom margin. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"` (default).
|
|
14
|
+
* Numbers are considered to be points (`"pt"`).
|
|
15
|
+
*/
|
|
16
|
+
left;
|
|
17
|
+
/**
|
|
18
|
+
* The top margin. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"` (default).
|
|
19
|
+
* Numbers are considered to be points (`"pt"`).
|
|
20
|
+
*/
|
|
21
|
+
top;
|
|
22
|
+
/**
|
|
23
|
+
* The right margin. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"` (default).
|
|
24
|
+
* Numbers are considered to be points (`"pt"`).
|
|
25
|
+
*/
|
|
26
|
+
right;
|
|
27
|
+
/**
|
|
28
|
+
* The bottom margin. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"` (default).
|
|
29
|
+
* Numbers are considered to be points (`"pt"`).
|
|
30
|
+
*/
|
|
31
|
+
bottom;
|
|
12
32
|
/**
|
|
13
33
|
* @hidden
|
|
14
34
|
*/
|
|
@@ -23,10 +43,10 @@ export class PDFExportMarginComponent {
|
|
|
23
43
|
}
|
|
24
44
|
return options;
|
|
25
45
|
}
|
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportMarginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PDFExportMarginComponent, isStandalone: true, selector: "kendo-pdf-export-margin", inputs: { left: "left", top: "top", right: "right", bottom: "bottom" }, ngImport: i0, template: ``, isInline: true });
|
|
26
48
|
}
|
|
27
|
-
|
|
28
|
-
PDFExportMarginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PDFExportMarginComponent, isStandalone: true, selector: "kendo-pdf-export-margin", inputs: { left: "left", top: "top", right: "right", bottom: "bottom" }, ngImport: i0, template: ``, isInline: true });
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportMarginComponent, decorators: [{
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportMarginComponent, decorators: [{
|
|
30
50
|
type: Component,
|
|
31
51
|
args: [{
|
|
32
52
|
selector: 'kendo-pdf-export-margin',
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
import { Directive, Optional, TemplateRef } from '@angular/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export class PDFExportTemplateDirective {
|
|
8
|
+
templateRef;
|
|
8
9
|
constructor(templateRef) {
|
|
9
10
|
this.templateRef = templateRef;
|
|
10
11
|
}
|
|
12
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
13
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: PDFExportTemplateDirective, isStandalone: true, selector: "[kendoPDFTemplate]", ngImport: i0 });
|
|
11
14
|
}
|
|
12
|
-
|
|
13
|
-
PDFExportTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: PDFExportTemplateDirective, isStandalone: true, selector: "[kendoPDFTemplate]", ngImport: i0 });
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportTemplateDirective, decorators: [{
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportTemplateDirective, decorators: [{
|
|
15
16
|
type: Directive,
|
|
16
17
|
args: [{
|
|
17
18
|
selector: '[kendoPDFTemplate]',
|
|
@@ -35,20 +35,140 @@ import * as i0 from "@angular/core";
|
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
37
|
export class PDFExportComponent {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
element;
|
|
39
|
+
/**
|
|
40
|
+
* Specifies if the Print dialog should be opened immediately after loading the document ([see example](slug:autoprint_pdfexport)).
|
|
41
|
+
* Requires `@progress/kendo-drawing` v1.9.0 or later.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
autoPrint;
|
|
45
|
+
/**
|
|
46
|
+
* The author (metadata) of the PDF document.
|
|
47
|
+
*/
|
|
48
|
+
author;
|
|
49
|
+
/**
|
|
50
|
+
* A flag that indicates whether to produce actual hyperlinks in the exported PDF file ([see example](slug:hyperlinks_pdfexport)).
|
|
51
|
+
* It is also possible to set a CSS selector. All matching links will be ignored.
|
|
52
|
+
*/
|
|
53
|
+
avoidLinks;
|
|
54
|
+
/**
|
|
55
|
+
* An optional CSS selector that specifies the elements which cause the page breaks
|
|
56
|
+
* ([see example]({% slug multipagecontent_pdfexport %}#toc-manual-page-breaking)).
|
|
57
|
+
*/
|
|
58
|
+
forcePageBreak;
|
|
59
|
+
/**
|
|
60
|
+
* An optional CSS selector that specifies the elements which should not be split across the pages
|
|
61
|
+
* ([see example]({% slug multipagecontent_pdfexport %}#toc-preventing-page-breaking-in-elements)).
|
|
62
|
+
*/
|
|
63
|
+
keepTogether;
|
|
64
|
+
/**
|
|
65
|
+
* The creator of the PDF document.
|
|
66
|
+
* @default "Kendo UI PDF Generator"
|
|
67
|
+
*/
|
|
68
|
+
creator = 'Kendo UI PDF Generator';
|
|
69
|
+
/**
|
|
70
|
+
* The date when the PDF document is created. Defaults to `new Date()`.
|
|
71
|
+
*/
|
|
72
|
+
date;
|
|
73
|
+
/**
|
|
74
|
+
* The forced resolution of the images in the exported PDF document
|
|
75
|
+
* ([see example]({% slug embeddedimages_pdfexport %})).
|
|
76
|
+
* By default, the images are exported at their full resolution.
|
|
77
|
+
*/
|
|
78
|
+
imageResolution;
|
|
79
|
+
/**
|
|
80
|
+
* Specifies the name of the exported PDF file.
|
|
81
|
+
* @default "export.pdf"
|
|
82
|
+
*/
|
|
83
|
+
fileName = 'export.pdf';
|
|
84
|
+
/**
|
|
85
|
+
* If set to `true`, the content is forwarded to `proxyURL` even if the
|
|
86
|
+
* browser supports local saving of files.
|
|
87
|
+
*/
|
|
88
|
+
forceProxy;
|
|
89
|
+
/**
|
|
90
|
+
* The keywords (metadata) of the PDF document.
|
|
91
|
+
*/
|
|
92
|
+
keywords;
|
|
93
|
+
/**
|
|
94
|
+
* A flag that indicates if the page will be in a landscape orientation.
|
|
95
|
+
* By default, the page is in a portrait orientation.
|
|
96
|
+
*
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
landscape;
|
|
100
|
+
/**
|
|
101
|
+
* Specifies the margins of the page. Numbers are treated as points (`"pt"`).
|
|
102
|
+
*
|
|
103
|
+
*/
|
|
104
|
+
margin;
|
|
105
|
+
/**
|
|
106
|
+
* Specifies the paper size of the PDF document ([see example]({% slug multipagecontent_pdfexport %}#toc-automatic-page-breaking)).
|
|
107
|
+
* Defaults to `"auto"` which means that the paper size is determined by the content.
|
|
108
|
+
* The size of the content in pixels matches the size of the output in points (1 pixel = 1/72 inch).
|
|
109
|
+
* If `paperSize` is set, the content is split across multiple pages. This enables the `repeatHeaders` and
|
|
110
|
+
* `scale` options, and allows you to specify a template.
|
|
111
|
+
*
|
|
112
|
+
* The paper size can be a `PaperSize`, an array of two numbers which specify the width and height in points (1 pt = 1/72 in), or an
|
|
113
|
+
* array of two strings which specify the width and height in units. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"`.
|
|
114
|
+
* @default 'auto'
|
|
115
|
+
*/
|
|
116
|
+
paperSize;
|
|
117
|
+
/**
|
|
118
|
+
* Specifies if the `<thead>` elements of the tables will be repeated on each page
|
|
119
|
+
* ([see example]({% slug recurrenttableheaders_pdfexport %})).
|
|
120
|
+
*/
|
|
121
|
+
repeatHeaders;
|
|
122
|
+
/**
|
|
123
|
+
* A scale factor ([see example]({% slug scalingofcontent_pdfexport %})).
|
|
124
|
+
* The text size on the screen might be too big for printing.
|
|
125
|
+
* To scale down the output in PDF, use this option.
|
|
126
|
+
*
|
|
127
|
+
* @default 1
|
|
128
|
+
*/
|
|
129
|
+
scale;
|
|
130
|
+
/**
|
|
131
|
+
* A key/value dictionary of form values which will be sent to the proxy.
|
|
132
|
+
* Can be used to submit Anti-Forgery tokens and other metadata.
|
|
133
|
+
*/
|
|
134
|
+
proxyData;
|
|
135
|
+
/**
|
|
136
|
+
* The URL of the server-side proxy which streams the file to the end user. You need to use a proxy if
|
|
137
|
+
* the browser is not capable of saving files locally.
|
|
138
|
+
* It is your responsibility to implement the server-side proxy. The proxy returns the decoded file with
|
|
139
|
+
* the `"Content-Disposition"` header set to `attachment; filename="<fileName.pdf>"`.
|
|
140
|
+
*
|
|
141
|
+
* In the request body, the proxy receives a POST request with the specific parameters.
|
|
142
|
+
* [See example](slug:server_proxy#toc-implementations).
|
|
143
|
+
*/
|
|
144
|
+
proxyURL;
|
|
145
|
+
/**
|
|
146
|
+
* A name or keyword which indicates where to display the document that is returned from the proxy.
|
|
147
|
+
* To display the document in a new window or iframe,
|
|
148
|
+
* the proxy has to have the `"Content-Disposition"` header set to `inline; filename="<fileName.pdf>"`.
|
|
149
|
+
* @default "_self"
|
|
150
|
+
*/
|
|
151
|
+
proxyTarget;
|
|
152
|
+
/**
|
|
153
|
+
* The producer (metadata) of the PDF document.
|
|
154
|
+
*/
|
|
155
|
+
producer;
|
|
156
|
+
/**
|
|
157
|
+
* The subject (metadata) of the PDF document.
|
|
158
|
+
*/
|
|
159
|
+
subject;
|
|
160
|
+
/**
|
|
161
|
+
* The title (metadata) of the PDF document.
|
|
162
|
+
*/
|
|
163
|
+
title;
|
|
164
|
+
/**
|
|
165
|
+
* @hidden
|
|
166
|
+
*/
|
|
167
|
+
pageTemplateDirective;
|
|
168
|
+
/**
|
|
169
|
+
* @hidden
|
|
170
|
+
*/
|
|
171
|
+
marginComponent;
|
|
52
172
|
get drawMargin() {
|
|
53
173
|
const marginComponent = this.marginComponent;
|
|
54
174
|
let margin = this.margin;
|
|
@@ -57,6 +177,11 @@ export class PDFExportComponent {
|
|
|
57
177
|
}
|
|
58
178
|
return margin;
|
|
59
179
|
}
|
|
180
|
+
pageTemplate;
|
|
181
|
+
constructor(element) {
|
|
182
|
+
this.element = element;
|
|
183
|
+
validatePackage(packageMetadata);
|
|
184
|
+
}
|
|
60
185
|
/**
|
|
61
186
|
* Saves the content as a PDF file with the specified name.
|
|
62
187
|
* @param fileName - The name of the exported file.
|
|
@@ -139,10 +264,10 @@ export class PDFExportComponent {
|
|
|
139
264
|
saveDataUri(dataUri, fileName, options) {
|
|
140
265
|
saveAs(dataUri, fileName, options);
|
|
141
266
|
}
|
|
267
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
268
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PDFExportComponent, isStandalone: true, selector: "kendo-pdf-export", inputs: { autoPrint: "autoPrint", author: "author", avoidLinks: "avoidLinks", forcePageBreak: "forcePageBreak", keepTogether: "keepTogether", creator: "creator", date: "date", imageResolution: "imageResolution", fileName: "fileName", forceProxy: "forceProxy", keywords: "keywords", landscape: "landscape", margin: "margin", paperSize: "paperSize", repeatHeaders: "repeatHeaders", scale: "scale", proxyData: "proxyData", proxyURL: "proxyURL", proxyTarget: "proxyTarget", producer: "producer", subject: "subject", title: "title" }, queries: [{ propertyName: "pageTemplateDirective", first: true, predicate: PDFExportTemplateDirective, descendants: true }, { propertyName: "marginComponent", first: true, predicate: PDFExportMarginComponent, descendants: true }], ngImport: i0, template: `<div><ng-content></ng-content></div>`, isInline: true });
|
|
142
269
|
}
|
|
143
|
-
|
|
144
|
-
PDFExportComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PDFExportComponent, isStandalone: true, selector: "kendo-pdf-export", inputs: { autoPrint: "autoPrint", author: "author", avoidLinks: "avoidLinks", forcePageBreak: "forcePageBreak", keepTogether: "keepTogether", creator: "creator", date: "date", imageResolution: "imageResolution", fileName: "fileName", forceProxy: "forceProxy", keywords: "keywords", landscape: "landscape", margin: "margin", paperSize: "paperSize", repeatHeaders: "repeatHeaders", scale: "scale", proxyData: "proxyData", proxyURL: "proxyURL", proxyTarget: "proxyTarget", producer: "producer", subject: "subject", title: "title" }, queries: [{ propertyName: "pageTemplateDirective", first: true, predicate: PDFExportTemplateDirective, descendants: true }, { propertyName: "marginComponent", first: true, predicate: PDFExportMarginComponent, descendants: true }], ngImport: i0, template: `<div><ng-content></ng-content></div>`, isInline: true });
|
|
145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportComponent, decorators: [{
|
|
270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportComponent, decorators: [{
|
|
146
271
|
type: Component,
|
|
147
272
|
args: [{
|
|
148
273
|
selector: 'kendo-pdf-export',
|
|
@@ -13,11 +13,11 @@ import * as i3 from "./pdf-export-template.directive";
|
|
|
13
13
|
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the PDF Export directive.
|
|
14
14
|
*/
|
|
15
15
|
export class PDFExportModule {
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
17
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: PDFExportModule, imports: [i1.PDFExportComponent, i2.PDFExportMarginComponent, i3.PDFExportTemplateDirective], exports: [i1.PDFExportComponent, i2.PDFExportMarginComponent, i3.PDFExportTemplateDirective] });
|
|
18
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportModule });
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
PDFExportModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: PDFExportModule, imports: [i1.PDFExportComponent, i2.PDFExportMarginComponent, i3.PDFExportTemplateDirective], exports: [i1.PDFExportComponent, i2.PDFExportMarginComponent, i3.PDFExportTemplateDirective] });
|
|
19
|
-
PDFExportModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportModule, imports: [i1.PDFExportComponent, i2.PDFExportMarginComponent] });
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportModule, decorators: [{
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportModule, decorators: [{
|
|
21
21
|
type: NgModule,
|
|
22
22
|
args: [{
|
|
23
23
|
imports: [...KENDO_PDFEXPORT],
|
|
@@ -15,19 +15,20 @@ const packageMetadata = {
|
|
|
15
15
|
name: '@progress/kendo-angular-pdf-export',
|
|
16
16
|
productName: 'Kendo UI for Angular',
|
|
17
17
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
18
|
-
publishDate:
|
|
19
|
-
version: '17.0.0-develop.
|
|
18
|
+
publishDate: 1730103526,
|
|
19
|
+
version: '17.0.0-develop.22',
|
|
20
20
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
class PDFExportTemplateDirective {
|
|
24
|
+
templateRef;
|
|
24
25
|
constructor(templateRef) {
|
|
25
26
|
this.templateRef = templateRef;
|
|
26
27
|
}
|
|
28
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
29
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: PDFExportTemplateDirective, isStandalone: true, selector: "[kendoPDFTemplate]", ngImport: i0 });
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
PDFExportTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: PDFExportTemplateDirective, isStandalone: true, selector: "[kendoPDFTemplate]", ngImport: i0 });
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportTemplateDirective, decorators: [{
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportTemplateDirective, decorators: [{
|
|
31
32
|
type: Directive,
|
|
32
33
|
args: [{
|
|
33
34
|
selector: '[kendoPDFTemplate]',
|
|
@@ -42,6 +43,26 @@ const FIELDS = ['bottom', 'left', 'right', 'top'];
|
|
|
42
43
|
* Represents the Kendo UI PDFMargin component for Angular.
|
|
43
44
|
*/
|
|
44
45
|
class PDFExportMarginComponent {
|
|
46
|
+
/**
|
|
47
|
+
* The bottom margin. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"` (default).
|
|
48
|
+
* Numbers are considered to be points (`"pt"`).
|
|
49
|
+
*/
|
|
50
|
+
left;
|
|
51
|
+
/**
|
|
52
|
+
* The top margin. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"` (default).
|
|
53
|
+
* Numbers are considered to be points (`"pt"`).
|
|
54
|
+
*/
|
|
55
|
+
top;
|
|
56
|
+
/**
|
|
57
|
+
* The right margin. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"` (default).
|
|
58
|
+
* Numbers are considered to be points (`"pt"`).
|
|
59
|
+
*/
|
|
60
|
+
right;
|
|
61
|
+
/**
|
|
62
|
+
* The bottom margin. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"` (default).
|
|
63
|
+
* Numbers are considered to be points (`"pt"`).
|
|
64
|
+
*/
|
|
65
|
+
bottom;
|
|
45
66
|
/**
|
|
46
67
|
* @hidden
|
|
47
68
|
*/
|
|
@@ -56,10 +77,10 @@ class PDFExportMarginComponent {
|
|
|
56
77
|
}
|
|
57
78
|
return options;
|
|
58
79
|
}
|
|
80
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportMarginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
81
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PDFExportMarginComponent, isStandalone: true, selector: "kendo-pdf-export-margin", inputs: { left: "left", top: "top", right: "right", bottom: "bottom" }, ngImport: i0, template: ``, isInline: true });
|
|
59
82
|
}
|
|
60
|
-
|
|
61
|
-
PDFExportMarginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PDFExportMarginComponent, isStandalone: true, selector: "kendo-pdf-export-margin", inputs: { left: "left", top: "top", right: "right", bottom: "bottom" }, ngImport: i0, template: ``, isInline: true });
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportMarginComponent, decorators: [{
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportMarginComponent, decorators: [{
|
|
63
84
|
type: Component,
|
|
64
85
|
args: [{
|
|
65
86
|
selector: 'kendo-pdf-export-margin',
|
|
@@ -122,20 +143,140 @@ const compileTemplate = (templateRef) => {
|
|
|
122
143
|
* ```
|
|
123
144
|
*/
|
|
124
145
|
class PDFExportComponent {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
146
|
+
element;
|
|
147
|
+
/**
|
|
148
|
+
* Specifies if the Print dialog should be opened immediately after loading the document ([see example](slug:autoprint_pdfexport)).
|
|
149
|
+
* Requires `@progress/kendo-drawing` v1.9.0 or later.
|
|
150
|
+
* @default false
|
|
151
|
+
*/
|
|
152
|
+
autoPrint;
|
|
153
|
+
/**
|
|
154
|
+
* The author (metadata) of the PDF document.
|
|
155
|
+
*/
|
|
156
|
+
author;
|
|
157
|
+
/**
|
|
158
|
+
* A flag that indicates whether to produce actual hyperlinks in the exported PDF file ([see example](slug:hyperlinks_pdfexport)).
|
|
159
|
+
* It is also possible to set a CSS selector. All matching links will be ignored.
|
|
160
|
+
*/
|
|
161
|
+
avoidLinks;
|
|
162
|
+
/**
|
|
163
|
+
* An optional CSS selector that specifies the elements which cause the page breaks
|
|
164
|
+
* ([see example]({% slug multipagecontent_pdfexport %}#toc-manual-page-breaking)).
|
|
165
|
+
*/
|
|
166
|
+
forcePageBreak;
|
|
167
|
+
/**
|
|
168
|
+
* An optional CSS selector that specifies the elements which should not be split across the pages
|
|
169
|
+
* ([see example]({% slug multipagecontent_pdfexport %}#toc-preventing-page-breaking-in-elements)).
|
|
170
|
+
*/
|
|
171
|
+
keepTogether;
|
|
172
|
+
/**
|
|
173
|
+
* The creator of the PDF document.
|
|
174
|
+
* @default "Kendo UI PDF Generator"
|
|
175
|
+
*/
|
|
176
|
+
creator = 'Kendo UI PDF Generator';
|
|
177
|
+
/**
|
|
178
|
+
* The date when the PDF document is created. Defaults to `new Date()`.
|
|
179
|
+
*/
|
|
180
|
+
date;
|
|
181
|
+
/**
|
|
182
|
+
* The forced resolution of the images in the exported PDF document
|
|
183
|
+
* ([see example]({% slug embeddedimages_pdfexport %})).
|
|
184
|
+
* By default, the images are exported at their full resolution.
|
|
185
|
+
*/
|
|
186
|
+
imageResolution;
|
|
187
|
+
/**
|
|
188
|
+
* Specifies the name of the exported PDF file.
|
|
189
|
+
* @default "export.pdf"
|
|
190
|
+
*/
|
|
191
|
+
fileName = 'export.pdf';
|
|
192
|
+
/**
|
|
193
|
+
* If set to `true`, the content is forwarded to `proxyURL` even if the
|
|
194
|
+
* browser supports local saving of files.
|
|
195
|
+
*/
|
|
196
|
+
forceProxy;
|
|
197
|
+
/**
|
|
198
|
+
* The keywords (metadata) of the PDF document.
|
|
199
|
+
*/
|
|
200
|
+
keywords;
|
|
201
|
+
/**
|
|
202
|
+
* A flag that indicates if the page will be in a landscape orientation.
|
|
203
|
+
* By default, the page is in a portrait orientation.
|
|
204
|
+
*
|
|
205
|
+
* @default false
|
|
206
|
+
*/
|
|
207
|
+
landscape;
|
|
208
|
+
/**
|
|
209
|
+
* Specifies the margins of the page. Numbers are treated as points (`"pt"`).
|
|
210
|
+
*
|
|
211
|
+
*/
|
|
212
|
+
margin;
|
|
213
|
+
/**
|
|
214
|
+
* Specifies the paper size of the PDF document ([see example]({% slug multipagecontent_pdfexport %}#toc-automatic-page-breaking)).
|
|
215
|
+
* Defaults to `"auto"` which means that the paper size is determined by the content.
|
|
216
|
+
* The size of the content in pixels matches the size of the output in points (1 pixel = 1/72 inch).
|
|
217
|
+
* If `paperSize` is set, the content is split across multiple pages. This enables the `repeatHeaders` and
|
|
218
|
+
* `scale` options, and allows you to specify a template.
|
|
219
|
+
*
|
|
220
|
+
* The paper size can be a `PaperSize`, an array of two numbers which specify the width and height in points (1 pt = 1/72 in), or an
|
|
221
|
+
* array of two strings which specify the width and height in units. The supported units are `"mm"`, `"cm"`, `"in"`, and `"pt"`.
|
|
222
|
+
* @default 'auto'
|
|
223
|
+
*/
|
|
224
|
+
paperSize;
|
|
225
|
+
/**
|
|
226
|
+
* Specifies if the `<thead>` elements of the tables will be repeated on each page
|
|
227
|
+
* ([see example]({% slug recurrenttableheaders_pdfexport %})).
|
|
228
|
+
*/
|
|
229
|
+
repeatHeaders;
|
|
230
|
+
/**
|
|
231
|
+
* A scale factor ([see example]({% slug scalingofcontent_pdfexport %})).
|
|
232
|
+
* The text size on the screen might be too big for printing.
|
|
233
|
+
* To scale down the output in PDF, use this option.
|
|
234
|
+
*
|
|
235
|
+
* @default 1
|
|
236
|
+
*/
|
|
237
|
+
scale;
|
|
238
|
+
/**
|
|
239
|
+
* A key/value dictionary of form values which will be sent to the proxy.
|
|
240
|
+
* Can be used to submit Anti-Forgery tokens and other metadata.
|
|
241
|
+
*/
|
|
242
|
+
proxyData;
|
|
243
|
+
/**
|
|
244
|
+
* The URL of the server-side proxy which streams the file to the end user. You need to use a proxy if
|
|
245
|
+
* the browser is not capable of saving files locally.
|
|
246
|
+
* It is your responsibility to implement the server-side proxy. The proxy returns the decoded file with
|
|
247
|
+
* the `"Content-Disposition"` header set to `attachment; filename="<fileName.pdf>"`.
|
|
248
|
+
*
|
|
249
|
+
* In the request body, the proxy receives a POST request with the specific parameters.
|
|
250
|
+
* [See example](slug:server_proxy#toc-implementations).
|
|
251
|
+
*/
|
|
252
|
+
proxyURL;
|
|
253
|
+
/**
|
|
254
|
+
* A name or keyword which indicates where to display the document that is returned from the proxy.
|
|
255
|
+
* To display the document in a new window or iframe,
|
|
256
|
+
* the proxy has to have the `"Content-Disposition"` header set to `inline; filename="<fileName.pdf>"`.
|
|
257
|
+
* @default "_self"
|
|
258
|
+
*/
|
|
259
|
+
proxyTarget;
|
|
260
|
+
/**
|
|
261
|
+
* The producer (metadata) of the PDF document.
|
|
262
|
+
*/
|
|
263
|
+
producer;
|
|
264
|
+
/**
|
|
265
|
+
* The subject (metadata) of the PDF document.
|
|
266
|
+
*/
|
|
267
|
+
subject;
|
|
268
|
+
/**
|
|
269
|
+
* The title (metadata) of the PDF document.
|
|
270
|
+
*/
|
|
271
|
+
title;
|
|
272
|
+
/**
|
|
273
|
+
* @hidden
|
|
274
|
+
*/
|
|
275
|
+
pageTemplateDirective;
|
|
276
|
+
/**
|
|
277
|
+
* @hidden
|
|
278
|
+
*/
|
|
279
|
+
marginComponent;
|
|
139
280
|
get drawMargin() {
|
|
140
281
|
const marginComponent = this.marginComponent;
|
|
141
282
|
let margin = this.margin;
|
|
@@ -144,6 +285,11 @@ class PDFExportComponent {
|
|
|
144
285
|
}
|
|
145
286
|
return margin;
|
|
146
287
|
}
|
|
288
|
+
pageTemplate;
|
|
289
|
+
constructor(element) {
|
|
290
|
+
this.element = element;
|
|
291
|
+
validatePackage(packageMetadata);
|
|
292
|
+
}
|
|
147
293
|
/**
|
|
148
294
|
* Saves the content as a PDF file with the specified name.
|
|
149
295
|
* @param fileName - The name of the exported file.
|
|
@@ -226,10 +372,10 @@ class PDFExportComponent {
|
|
|
226
372
|
saveDataUri(dataUri, fileName, options) {
|
|
227
373
|
saveAs(dataUri, fileName, options);
|
|
228
374
|
}
|
|
375
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
376
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PDFExportComponent, isStandalone: true, selector: "kendo-pdf-export", inputs: { autoPrint: "autoPrint", author: "author", avoidLinks: "avoidLinks", forcePageBreak: "forcePageBreak", keepTogether: "keepTogether", creator: "creator", date: "date", imageResolution: "imageResolution", fileName: "fileName", forceProxy: "forceProxy", keywords: "keywords", landscape: "landscape", margin: "margin", paperSize: "paperSize", repeatHeaders: "repeatHeaders", scale: "scale", proxyData: "proxyData", proxyURL: "proxyURL", proxyTarget: "proxyTarget", producer: "producer", subject: "subject", title: "title" }, queries: [{ propertyName: "pageTemplateDirective", first: true, predicate: PDFExportTemplateDirective, descendants: true }, { propertyName: "marginComponent", first: true, predicate: PDFExportMarginComponent, descendants: true }], ngImport: i0, template: `<div><ng-content></ng-content></div>`, isInline: true });
|
|
229
377
|
}
|
|
230
|
-
|
|
231
|
-
PDFExportComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PDFExportComponent, isStandalone: true, selector: "kendo-pdf-export", inputs: { autoPrint: "autoPrint", author: "author", avoidLinks: "avoidLinks", forcePageBreak: "forcePageBreak", keepTogether: "keepTogether", creator: "creator", date: "date", imageResolution: "imageResolution", fileName: "fileName", forceProxy: "forceProxy", keywords: "keywords", landscape: "landscape", margin: "margin", paperSize: "paperSize", repeatHeaders: "repeatHeaders", scale: "scale", proxyData: "proxyData", proxyURL: "proxyURL", proxyTarget: "proxyTarget", producer: "producer", subject: "subject", title: "title" }, queries: [{ propertyName: "pageTemplateDirective", first: true, predicate: PDFExportTemplateDirective, descendants: true }, { propertyName: "marginComponent", first: true, predicate: PDFExportMarginComponent, descendants: true }], ngImport: i0, template: `<div><ng-content></ng-content></div>`, isInline: true });
|
|
232
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportComponent, decorators: [{
|
|
378
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportComponent, decorators: [{
|
|
233
379
|
type: Component,
|
|
234
380
|
args: [{
|
|
235
381
|
selector: 'kendo-pdf-export',
|
|
@@ -302,11 +448,11 @@ const KENDO_PDFEXPORT = [
|
|
|
302
448
|
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the PDF Export directive.
|
|
303
449
|
*/
|
|
304
450
|
class PDFExportModule {
|
|
451
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
452
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: PDFExportModule, imports: [PDFExportComponent, PDFExportMarginComponent, PDFExportTemplateDirective], exports: [PDFExportComponent, PDFExportMarginComponent, PDFExportTemplateDirective] });
|
|
453
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportModule });
|
|
305
454
|
}
|
|
306
|
-
|
|
307
|
-
PDFExportModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: PDFExportModule, imports: [PDFExportComponent, PDFExportMarginComponent, PDFExportTemplateDirective], exports: [PDFExportComponent, PDFExportMarginComponent, PDFExportTemplateDirective] });
|
|
308
|
-
PDFExportModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportModule, imports: [PDFExportComponent, PDFExportMarginComponent] });
|
|
309
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportModule, decorators: [{
|
|
455
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFExportModule, decorators: [{
|
|
310
456
|
type: NgModule,
|
|
311
457
|
args: [{
|
|
312
458
|
imports: [...KENDO_PDFEXPORT],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-pdf-export",
|
|
3
|
-
"version": "17.0.0-develop.
|
|
3
|
+
"version": "17.0.0-develop.22",
|
|
4
4
|
"description": "Kendo UI for Angular PDF Export Component",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -16,26 +16,22 @@
|
|
|
16
16
|
"friendlyName": "PDFExport"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@angular/animations": "
|
|
20
|
-
"@angular/common": "
|
|
21
|
-
"@angular/core": "
|
|
22
|
-
"@angular/platform-browser": "
|
|
19
|
+
"@angular/animations": "16 - 18",
|
|
20
|
+
"@angular/common": "16 - 18",
|
|
21
|
+
"@angular/core": "16 - 18",
|
|
22
|
+
"@angular/platform-browser": "16 - 18",
|
|
23
23
|
"@progress/kendo-drawing": "^1.20.4",
|
|
24
24
|
"@progress/kendo-licensing": "^1.0.2",
|
|
25
|
-
"@progress/kendo-angular-common": "17.0.0-develop.
|
|
25
|
+
"@progress/kendo-angular-common": "17.0.0-develop.22",
|
|
26
26
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"tslib": "^2.3.1",
|
|
30
|
-
"@progress/kendo-angular-schematics": "17.0.0-develop.
|
|
30
|
+
"@progress/kendo-angular-schematics": "17.0.0-develop.22",
|
|
31
31
|
"@progress/kendo-file-saver": "^1.0.1"
|
|
32
32
|
},
|
|
33
33
|
"schematics": "./schematics/collection.json",
|
|
34
|
-
"module": "
|
|
35
|
-
"es2020": "fesm2020/progress-kendo-angular-pdf-export.mjs",
|
|
36
|
-
"esm2020": "esm2020/progress-kendo-angular-pdf-export.mjs",
|
|
37
|
-
"fesm2020": "fesm2020/progress-kendo-angular-pdf-export.mjs",
|
|
38
|
-
"fesm2015": "fesm2015/progress-kendo-angular-pdf-export.mjs",
|
|
34
|
+
"module": "fesm2022/progress-kendo-angular-pdf-export.mjs",
|
|
39
35
|
"typings": "index.d.ts",
|
|
40
36
|
"exports": {
|
|
41
37
|
"./package.json": {
|
|
@@ -43,11 +39,9 @@
|
|
|
43
39
|
},
|
|
44
40
|
".": {
|
|
45
41
|
"types": "./index.d.ts",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"node": "./fesm2015/progress-kendo-angular-pdf-export.mjs",
|
|
50
|
-
"default": "./fesm2020/progress-kendo-angular-pdf-export.mjs"
|
|
42
|
+
"esm2022": "./esm2022/progress-kendo-angular-pdf-export.mjs",
|
|
43
|
+
"esm": "./esm2022/progress-kendo-angular-pdf-export.mjs",
|
|
44
|
+
"default": "./fesm2022/progress-kendo-angular-pdf-export.mjs"
|
|
51
45
|
}
|
|
52
46
|
},
|
|
53
47
|
"sideEffects": false
|
|
@@ -33,5 +33,5 @@ export declare class PDFExportMarginComponent implements pdf.PageMargin {
|
|
|
33
33
|
*/
|
|
34
34
|
get options(): any;
|
|
35
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<PDFExportMarginComponent, never>;
|
|
36
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PDFExportMarginComponent, "kendo-pdf-export-margin", never, { "left": "left"; "top": "top"; "right": "right"; "bottom": "bottom"; }, {}, never, never, true, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PDFExportMarginComponent, "kendo-pdf-export-margin", never, { "left": { "alias": "left"; "required": false; }; "top": { "alias": "top"; "required": false; }; "right": { "alias": "right"; "required": false; }; "bottom": { "alias": "bottom"; "required": false; }; }, {}, never, never, true, never>;
|
|
37
37
|
}
|
|
@@ -16,7 +16,7 @@ import * as i0 from "@angular/core";
|
|
|
16
16
|
* The type will be linked to the kendo-drawing documentation
|
|
17
17
|
* by using the slug provided in api-type-links.json
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export type PaperSize = pdf.PaperSize;
|
|
20
20
|
/**
|
|
21
21
|
* Represents the [Kendo UI PDF Export component for Angular]({% slug overview_pdfexport %}).
|
|
22
22
|
*
|
|
@@ -201,5 +201,5 @@ export declare class PDFExportComponent implements pdf.PDFOptions {
|
|
|
201
201
|
protected exportGroup(group: Group, options: pdf.PDFOptions): Promise<string>;
|
|
202
202
|
private saveDataUri;
|
|
203
203
|
static ɵfac: i0.ɵɵFactoryDeclaration<PDFExportComponent, never>;
|
|
204
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PDFExportComponent, "kendo-pdf-export", never, { "autoPrint": "autoPrint"; "author": "author"; "avoidLinks": "avoidLinks"; "forcePageBreak": "forcePageBreak"; "keepTogether": "keepTogether"; "creator": "creator"; "date": "date"; "imageResolution": "imageResolution"; "fileName": "fileName"; "forceProxy": "forceProxy"; "keywords": "keywords"; "landscape": "landscape"; "margin": "margin"; "paperSize": "paperSize"; "repeatHeaders": "repeatHeaders"; "scale": "scale"; "proxyData": "proxyData"; "proxyURL": "proxyURL"; "proxyTarget": "proxyTarget"; "producer": "producer"; "subject": "subject"; "title": "title"; }, {}, ["pageTemplateDirective", "marginComponent"], ["*"], true, never>;
|
|
204
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PDFExportComponent, "kendo-pdf-export", never, { "autoPrint": { "alias": "autoPrint"; "required": false; }; "author": { "alias": "author"; "required": false; }; "avoidLinks": { "alias": "avoidLinks"; "required": false; }; "forcePageBreak": { "alias": "forcePageBreak"; "required": false; }; "keepTogether": { "alias": "keepTogether"; "required": false; }; "creator": { "alias": "creator"; "required": false; }; "date": { "alias": "date"; "required": false; }; "imageResolution": { "alias": "imageResolution"; "required": false; }; "fileName": { "alias": "fileName"; "required": false; }; "forceProxy": { "alias": "forceProxy"; "required": false; }; "keywords": { "alias": "keywords"; "required": false; }; "landscape": { "alias": "landscape"; "required": false; }; "margin": { "alias": "margin"; "required": false; }; "paperSize": { "alias": "paperSize"; "required": false; }; "repeatHeaders": { "alias": "repeatHeaders"; "required": false; }; "scale": { "alias": "scale"; "required": false; }; "proxyData": { "alias": "proxyData"; "required": false; }; "proxyURL": { "alias": "proxyURL"; "required": false; }; "proxyTarget": { "alias": "proxyTarget"; "required": false; }; "producer": { "alias": "producer"; "required": false; }; "subject": { "alias": "subject"; "required": false; }; "title": { "alias": "title"; "required": false; }; }, {}, ["pageTemplateDirective", "marginComponent"], ["*"], true, never>;
|
|
205
205
|
}
|
|
@@ -1,324 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as i0 from '@angular/core';
|
|
6
|
-
import { Directive, Optional, Component, Input, ContentChild, NgModule } from '@angular/core';
|
|
7
|
-
import { drawDOM, exportPDF } from '@progress/kendo-drawing';
|
|
8
|
-
import { saveAs } from '@progress/kendo-file-saver';
|
|
9
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @hidden
|
|
13
|
-
*/
|
|
14
|
-
const packageMetadata = {
|
|
15
|
-
name: '@progress/kendo-angular-pdf-export',
|
|
16
|
-
productName: 'Kendo UI for Angular',
|
|
17
|
-
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
18
|
-
publishDate: 1729874120,
|
|
19
|
-
version: '17.0.0-develop.21',
|
|
20
|
-
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
class PDFExportTemplateDirective {
|
|
24
|
-
constructor(templateRef) {
|
|
25
|
-
this.templateRef = templateRef;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
PDFExportTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
29
|
-
PDFExportTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: PDFExportTemplateDirective, isStandalone: true, selector: "[kendoPDFTemplate]", ngImport: i0 });
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportTemplateDirective, decorators: [{
|
|
31
|
-
type: Directive,
|
|
32
|
-
args: [{
|
|
33
|
-
selector: '[kendoPDFTemplate]',
|
|
34
|
-
standalone: true
|
|
35
|
-
}]
|
|
36
|
-
}], ctorParameters: function () {
|
|
37
|
-
return [{ type: i0.TemplateRef, decorators: [{
|
|
38
|
-
type: Optional
|
|
39
|
-
}] }];
|
|
40
|
-
} });
|
|
41
|
-
|
|
42
|
-
const FIELDS = ['bottom', 'left', 'right', 'top'];
|
|
43
|
-
/**
|
|
44
|
-
* Represents the Kendo UI PDFMargin component for Angular.
|
|
45
|
-
*/
|
|
46
|
-
class PDFExportMarginComponent {
|
|
47
|
-
/**
|
|
48
|
-
* @hidden
|
|
49
|
-
*/
|
|
50
|
-
get options() {
|
|
51
|
-
const options = {};
|
|
52
|
-
for (let idx = 0; idx < FIELDS.length; idx++) {
|
|
53
|
-
const field = FIELDS[idx];
|
|
54
|
-
const value = this[field];
|
|
55
|
-
if (typeof value !== 'undefined') {
|
|
56
|
-
options[field] = value;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return options;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
PDFExportMarginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportMarginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
63
|
-
PDFExportMarginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PDFExportMarginComponent, isStandalone: true, selector: "kendo-pdf-export-margin", inputs: { left: "left", top: "top", right: "right", bottom: "bottom" }, ngImport: i0, template: ``, isInline: true });
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportMarginComponent, decorators: [{
|
|
65
|
-
type: Component,
|
|
66
|
-
args: [{
|
|
67
|
-
selector: 'kendo-pdf-export-margin',
|
|
68
|
-
template: ``,
|
|
69
|
-
standalone: true
|
|
70
|
-
}]
|
|
71
|
-
}], propDecorators: { left: [{
|
|
72
|
-
type: Input
|
|
73
|
-
}], top: [{
|
|
74
|
-
type: Input
|
|
75
|
-
}], right: [{
|
|
76
|
-
type: Input
|
|
77
|
-
}], bottom: [{
|
|
78
|
-
type: Input
|
|
79
|
-
}] } });
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @hidden
|
|
83
|
-
*/
|
|
84
|
-
const compileTemplate = (templateRef) => {
|
|
85
|
-
const context = {};
|
|
86
|
-
let embeddedView = templateRef.createEmbeddedView(context);
|
|
87
|
-
const result = (data) => {
|
|
88
|
-
Object.assign(context, data);
|
|
89
|
-
embeddedView.detectChanges();
|
|
90
|
-
const templateWrap = document.createElement('span');
|
|
91
|
-
embeddedView.rootNodes.forEach((rootNode) => {
|
|
92
|
-
templateWrap.appendChild(rootNode.cloneNode(true));
|
|
93
|
-
});
|
|
94
|
-
return templateWrap;
|
|
95
|
-
};
|
|
96
|
-
result.destroy = () => {
|
|
97
|
-
embeddedView.destroy();
|
|
98
|
-
embeddedView = null;
|
|
99
|
-
};
|
|
100
|
-
return result;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Represents the [Kendo UI PDF Export component for Angular]({% slug overview_pdfexport %}).
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* ```ts-preview
|
|
108
|
-
* _@Component({
|
|
109
|
-
* selector: 'my-app',
|
|
110
|
-
* template: `
|
|
111
|
-
* <div class="example-config">
|
|
112
|
-
* <button kendoButton (click)="pdf.saveAs('document.pdf')">
|
|
113
|
-
* Save As PDF...
|
|
114
|
-
* </button>
|
|
115
|
-
* </div>
|
|
116
|
-
*
|
|
117
|
-
* <kendo-pdf-export #pdf paperSize="A4" margin="2cm">
|
|
118
|
-
* Content goes here
|
|
119
|
-
* </kendo-pdf-export>
|
|
120
|
-
* `
|
|
121
|
-
* })
|
|
122
|
-
* export class AppComponent {
|
|
123
|
-
* }
|
|
124
|
-
* ```
|
|
125
|
-
*/
|
|
126
|
-
class PDFExportComponent {
|
|
127
|
-
constructor(element) {
|
|
128
|
-
this.element = element;
|
|
129
|
-
/**
|
|
130
|
-
* The creator of the PDF document.
|
|
131
|
-
* @default "Kendo UI PDF Generator"
|
|
132
|
-
*/
|
|
133
|
-
this.creator = 'Kendo UI PDF Generator';
|
|
134
|
-
/**
|
|
135
|
-
* Specifies the name of the exported PDF file.
|
|
136
|
-
* @default "export.pdf"
|
|
137
|
-
*/
|
|
138
|
-
this.fileName = 'export.pdf';
|
|
139
|
-
validatePackage(packageMetadata);
|
|
140
|
-
}
|
|
141
|
-
get drawMargin() {
|
|
142
|
-
const marginComponent = this.marginComponent;
|
|
143
|
-
let margin = this.margin;
|
|
144
|
-
if (marginComponent) {
|
|
145
|
-
margin = Object.assign(margin || {}, marginComponent.options);
|
|
146
|
-
}
|
|
147
|
-
return margin;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Saves the content as a PDF file with the specified name.
|
|
151
|
-
* @param fileName - The name of the exported file.
|
|
152
|
-
*/
|
|
153
|
-
saveAs(fileName = this.fileName) {
|
|
154
|
-
this.save(this.element.nativeElement, fileName);
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Exports the content as a `Group` for further processing.
|
|
158
|
-
*
|
|
159
|
-
* @return The root group of the exported scene.
|
|
160
|
-
*/
|
|
161
|
-
export() {
|
|
162
|
-
return this.exportElement(this.element.nativeElement);
|
|
163
|
-
}
|
|
164
|
-
save(element, fileName) {
|
|
165
|
-
this.exportElement(element)
|
|
166
|
-
.then(group => this.exportGroup(group, this.pdfOptions()))
|
|
167
|
-
.then(dataUri => this.saveDataUri(dataUri, fileName, this.saveOptions()));
|
|
168
|
-
}
|
|
169
|
-
exportElement(element) {
|
|
170
|
-
const promise = this.drawElement(element, this.drawOptions());
|
|
171
|
-
const cleanup = this.cleanup.bind(this);
|
|
172
|
-
promise.then(cleanup, cleanup);
|
|
173
|
-
return promise;
|
|
174
|
-
}
|
|
175
|
-
cleanup() {
|
|
176
|
-
if (this.pageTemplate) {
|
|
177
|
-
this.pageTemplate.destroy();
|
|
178
|
-
delete this.pageTemplate;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
drawOptions() {
|
|
182
|
-
if (this.pageTemplateDirective) {
|
|
183
|
-
this.pageTemplate = compileTemplate(this.pageTemplateDirective.templateRef);
|
|
184
|
-
}
|
|
185
|
-
return {
|
|
186
|
-
avoidLinks: this.avoidLinks,
|
|
187
|
-
forcePageBreak: this.forcePageBreak,
|
|
188
|
-
keepTogether: this.keepTogether,
|
|
189
|
-
margin: this.drawMargin,
|
|
190
|
-
paperSize: this.paperSize,
|
|
191
|
-
landscape: this.landscape,
|
|
192
|
-
repeatHeaders: this.repeatHeaders,
|
|
193
|
-
scale: this.scale,
|
|
194
|
-
template: this.pageTemplate
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
pdfOptions() {
|
|
198
|
-
return {
|
|
199
|
-
autoPrint: this.autoPrint,
|
|
200
|
-
author: this.author,
|
|
201
|
-
creator: this.creator,
|
|
202
|
-
date: this.date,
|
|
203
|
-
imgDPI: this.imageResolution,
|
|
204
|
-
keywords: this.keywords,
|
|
205
|
-
landscape: this.landscape,
|
|
206
|
-
margin: this.drawMargin,
|
|
207
|
-
multiPage: true,
|
|
208
|
-
paperSize: this.paperSize,
|
|
209
|
-
producer: this.producer,
|
|
210
|
-
subject: this.subject,
|
|
211
|
-
title: this.title
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
saveOptions() {
|
|
215
|
-
return {
|
|
216
|
-
forceProxy: this.forceProxy,
|
|
217
|
-
proxyData: this.proxyData,
|
|
218
|
-
proxyTarget: this.proxyTarget,
|
|
219
|
-
proxyURL: this.proxyURL
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
drawElement(element, options) {
|
|
223
|
-
return drawDOM(element, options);
|
|
224
|
-
}
|
|
225
|
-
exportGroup(group, options) {
|
|
226
|
-
return exportPDF(group, options);
|
|
227
|
-
}
|
|
228
|
-
saveDataUri(dataUri, fileName, options) {
|
|
229
|
-
saveAs(dataUri, fileName, options);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
PDFExportComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
233
|
-
PDFExportComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PDFExportComponent, isStandalone: true, selector: "kendo-pdf-export", inputs: { autoPrint: "autoPrint", author: "author", avoidLinks: "avoidLinks", forcePageBreak: "forcePageBreak", keepTogether: "keepTogether", creator: "creator", date: "date", imageResolution: "imageResolution", fileName: "fileName", forceProxy: "forceProxy", keywords: "keywords", landscape: "landscape", margin: "margin", paperSize: "paperSize", repeatHeaders: "repeatHeaders", scale: "scale", proxyData: "proxyData", proxyURL: "proxyURL", proxyTarget: "proxyTarget", producer: "producer", subject: "subject", title: "title" }, queries: [{ propertyName: "pageTemplateDirective", first: true, predicate: PDFExportTemplateDirective, descendants: true }, { propertyName: "marginComponent", first: true, predicate: PDFExportMarginComponent, descendants: true }], ngImport: i0, template: `<div><ng-content></ng-content></div>`, isInline: true });
|
|
234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportComponent, decorators: [{
|
|
235
|
-
type: Component,
|
|
236
|
-
args: [{
|
|
237
|
-
selector: 'kendo-pdf-export',
|
|
238
|
-
template: `<div><ng-content></ng-content></div>`,
|
|
239
|
-
standalone: true
|
|
240
|
-
}]
|
|
241
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { autoPrint: [{
|
|
242
|
-
type: Input
|
|
243
|
-
}], author: [{
|
|
244
|
-
type: Input
|
|
245
|
-
}], avoidLinks: [{
|
|
246
|
-
type: Input
|
|
247
|
-
}], forcePageBreak: [{
|
|
248
|
-
type: Input
|
|
249
|
-
}], keepTogether: [{
|
|
250
|
-
type: Input
|
|
251
|
-
}], creator: [{
|
|
252
|
-
type: Input
|
|
253
|
-
}], date: [{
|
|
254
|
-
type: Input
|
|
255
|
-
}], imageResolution: [{
|
|
256
|
-
type: Input
|
|
257
|
-
}], fileName: [{
|
|
258
|
-
type: Input
|
|
259
|
-
}], forceProxy: [{
|
|
260
|
-
type: Input
|
|
261
|
-
}], keywords: [{
|
|
262
|
-
type: Input
|
|
263
|
-
}], landscape: [{
|
|
264
|
-
type: Input
|
|
265
|
-
}], margin: [{
|
|
266
|
-
type: Input
|
|
267
|
-
}], paperSize: [{
|
|
268
|
-
type: Input
|
|
269
|
-
}], repeatHeaders: [{
|
|
270
|
-
type: Input
|
|
271
|
-
}], scale: [{
|
|
272
|
-
type: Input
|
|
273
|
-
}], proxyData: [{
|
|
274
|
-
type: Input
|
|
275
|
-
}], proxyURL: [{
|
|
276
|
-
type: Input
|
|
277
|
-
}], proxyTarget: [{
|
|
278
|
-
type: Input
|
|
279
|
-
}], producer: [{
|
|
280
|
-
type: Input
|
|
281
|
-
}], subject: [{
|
|
282
|
-
type: Input
|
|
283
|
-
}], title: [{
|
|
284
|
-
type: Input
|
|
285
|
-
}], pageTemplateDirective: [{
|
|
286
|
-
type: ContentChild,
|
|
287
|
-
args: [PDFExportTemplateDirective, { static: false }]
|
|
288
|
-
}], marginComponent: [{
|
|
289
|
-
type: ContentChild,
|
|
290
|
-
args: [PDFExportMarginComponent, { static: false }]
|
|
291
|
-
}] } });
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Utility array that contains all `PDFExport` related components and directives
|
|
295
|
-
*/
|
|
296
|
-
const KENDO_PDFEXPORT = [
|
|
297
|
-
PDFExportComponent,
|
|
298
|
-
PDFExportMarginComponent,
|
|
299
|
-
PDFExportTemplateDirective
|
|
300
|
-
];
|
|
301
|
-
|
|
302
|
-
// IMPORTANT: NgModule export kept for backwards compatibility
|
|
303
|
-
/**
|
|
304
|
-
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the PDF Export directive.
|
|
305
|
-
*/
|
|
306
|
-
class PDFExportModule {
|
|
307
|
-
}
|
|
308
|
-
PDFExportModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
309
|
-
PDFExportModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: PDFExportModule, imports: [PDFExportComponent, PDFExportMarginComponent, PDFExportTemplateDirective], exports: [PDFExportComponent, PDFExportMarginComponent, PDFExportTemplateDirective] });
|
|
310
|
-
PDFExportModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportModule, imports: [PDFExportComponent, PDFExportMarginComponent] });
|
|
311
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PDFExportModule, decorators: [{
|
|
312
|
-
type: NgModule,
|
|
313
|
-
args: [{
|
|
314
|
-
imports: [...KENDO_PDFEXPORT],
|
|
315
|
-
exports: [...KENDO_PDFEXPORT]
|
|
316
|
-
}]
|
|
317
|
-
}] });
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Generated bundle index. Do not edit.
|
|
321
|
-
*/
|
|
322
|
-
|
|
323
|
-
export { KENDO_PDFEXPORT, PDFExportComponent, PDFExportMarginComponent, PDFExportModule, PDFExportTemplateDirective, compileTemplate };
|
|
324
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|