Skip to content

Commit cd2f75f

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 4795757 commit cd2f75f

25 files changed

+507
-21
lines changed
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
---
2+
title: PDF Viewer
3+
page_title: Configuration, methods and events of Kendo UI Pdf Viewer
4+
description: Display PDF files in the browser.
5+
res_type: api
6+
component: pdfviewer
7+
---
8+
9+
# kendo.ui.PDFViewer
10+
11+
Kendo UI PDF Viewer is used to display a PDF file in the browser. It provides ability to choose the PDF library used for processing. If processing option is set, pdfjs is used for processing. The viewer supports:
12+
13+
* `DPL`
14+
* `PDF.JS`
15+
16+
## Configuration
17+
18+
### dplProcessing `Object`
19+
20+
Specifies the DPL configuration options.
21+
22+
### dplProcessing.read `Object`
23+
24+
Specifies the configuration of the jQuery.ajax to make an HTTP request to the remote service.
25+
26+
### dplProcessing.read.url `String`
27+
28+
Specifies the url to which the request is sent.
29+
30+
### dplProcessing.read.pageField `String` *(default: 'pageNumber')*
31+
32+
Specifies the page field parameter submitted to the read url. It is used in scenario with `loadOnDemand` when requests are sent for each page.
33+
34+
### dplProcessing.read.type `String` *(default: 'GET')*
35+
Specifies the type of the request.
36+
37+
### dplProcessing.read.dataType `String`
38+
The type of result expected from the server. Used values are "json" and "jsonp". The PDFViewer expects a json to render the geometries.
39+
40+
### dplProcessing.upload `Object`
41+
Specifies the configuration of the jQuery.ajax to make an HTTP POST request to the remote service.
42+
43+
### dplProcessing.upload.url `String`
44+
Specifies the url that will receive the submitted file. The handler must accept `POST` requests.
45+
46+
### dplProcessing.upload.saveField `String`
47+
Specifies the name of the form field which is submitted to saveUrl.
48+
49+
### dplProcessing.download `Object`
50+
Specifies the download configuration.
51+
52+
### dplProcessing.download.url `String`
53+
Specifies the download action url that will be navigated to.
54+
55+
### dplProcessing.loadOnDemand `Boolean` *(default: false)*
56+
Specifies whether read requests should be sent for each page.
57+
58+
### pdfjsProcessing `Object`
59+
60+
Specifies the PDF.JS configuration options.
61+
62+
### pdfjsProcessing.file `Blob | byte[] | String`
63+
64+
Specifies the default file to be displayed.
65+
66+
### width `Number|String` *(default: 800)*
67+
68+
The selected page number in the viewer.
69+
70+
### height `Number|String` *(default: 1200)*
71+
72+
The selected page number in the viewer.
73+
74+
### page `Number` *(default: 1)*
75+
76+
The selected page number in the viewer.
77+
78+
### view `Object` *(default: 1)*
79+
80+
Defines the page surface options.
81+
82+
### view.type `String` *(default: "canvas")*
83+
84+
Defines the surface type. It accepts `canvas` or `svg`. This option is supported only for DPL.
85+
86+
#### Example - customizing the type of pages' surfaces
87+
88+
<div id="pdf-viewer"></div>
89+
<script>
90+
$("#pdfviewer").kendoPdfViewer({
91+
view: {
92+
type: "svg"
93+
}
94+
});
95+
</script>
96+
97+
### toolbar `Boolean|Object` *(default: true)*
98+
99+
Toolbar option accepts a Boolean value which indicates if the toolbar will be displayed or an Object with `items`.
100+
101+
### toolbar.items `Array`
102+
103+
The following list indicates the default tools:
104+
105+
* `pager`
106+
* `open`
107+
* `download`
108+
109+
#### Example - customizing the toolbar items
110+
111+
<div id="pdf-viewer"></div>
112+
<script>
113+
$("#pdfviewer").kendoPdfViewer({
114+
toolbar: {
115+
items: [
116+
"pager", "spacer", "open", "download", "exportAs"
117+
]
118+
}
119+
});
120+
</script>
121+
122+
### toolbar.items.type `String`
123+
124+
### toolbar.items.overflow `String`
125+
126+
### toolbar.items.command `String`
127+
128+
### toolbar.items.click `Function`
129+
130+
### messages `Object`
131+
132+
Specifies the localization messages of the PDFViewer.
133+
134+
### messages.defaultFileName `String` *(default: "Document")*
135+
136+
Specifies the default file name used for `Download`.
137+
138+
### messages.toolbar `Object`
139+
Specifies the localization messages of the toolbar.
140+
141+
### messages.toolbar.open `String` *(default: "Open")*
142+
### messages.toolbar.exportAs `String` *(default: "Export")*
143+
### messages.toolbar.download `String` *(default: "Download")*
144+
### messages.toolbar.pager `Object`
145+
### messages.toolbar.pager.first `String` *(default: "Go to the first page")*
146+
### messages.toolbar.pager.previous `String` *(default: "Go to the previous page")*
147+
### messages.toolbar.pager.next `String` *(default: "Go to the next page")*
148+
### messages.toolbar.pager.last `String` *(default: "Go to the last page")*
149+
### messages.toolbar.pager.of `String` *(default: " of {0} ")*
150+
### messages.toolbar.pager.page `String` *(default: "page")*
151+
### messages.toolbar.pager.pages `String` *(default: "pages")*
152+
### messages.errorMessages `Object`
153+
### messages.errorMessages.notSupported `String` *(default: "pages")*
154+
### messages.errorMessages.parseError `String` *(default: "pages")*
155+
### messages.dialogs `Object`
156+
### messages.dialogs.exportAsDialog `Object`
157+
### messages.dialogs.exportAsDialog.title `String` *(default: "pages")*
158+
### messages.dialogs.exportAsDialog.defaultFileName `String` *(default: "pages")*
159+
### messages.dialogs.exportAsDialog.pdf `String` *(default: "Portable Document Format (.pdf)")*
160+
### messages.dialogs.exportAsDialog.png `String` *(default: "Portable Network Graphics (.png)")*
161+
### messages.dialogs.exportAsDialog.svg `String` *(default: "Scalable Vector Graphics (.svg)")*
162+
### messages.dialogs.exportAsDialog.labels `Object`
163+
### messages.dialogs.exportAsDialog.labels.fileName `String` *(default: "File name")*
164+
### messages.dialogs.exportAsDialog.labels.saveAsType `String` *(default: "Save as")*
165+
### messages.dialogs.exportAsDialog.labels.page `String` *(default: "Page")*
166+
### messages.dialogs.okText `String` *(default: "OK")*
167+
### messages.dialogs.save `String` *(default: "Save")*
168+
### messages.dialogs.cancel `String` *(default: "Cancel")*
169+
170+
## Methods
171+
172+
### fromFile
173+
174+
### activatePage
175+
176+
### setOptions
177+
178+
### destroy
179+
180+
## Events
181+
182+
### render
183+
184+
### open
185+
186+
### error

src/kendo.toolbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ var __meta__ = { // jshint ignore:line
13461346
visibility: "visible",
13471347
width: ""
13481348
});
1349-
this.wrapper.css(paddingEnd, this.overflowAnchor.outerWidth());
1349+
this.wrapper.css(paddingEnd, this.overflowAnchor.outerWidth(true));
13501350
} else {
13511351
this.overflowAnchor.css({
13521352
visibility: "hidden",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.k-pdf-viewer {
2+
display: flex;
3+
flex-direction: column;
4+
overflow: hidden;
5+
6+
// Toolbar
7+
.k-toolbar {
8+
border-top-width: 0;
9+
border-right-width: 0;
10+
border-left-width: 0;
11+
border-color: inherit;
12+
flex: 0 0 auto;
13+
z-index: 2;
14+
}
15+
.k-toolbar .k-pager-wrap {
16+
padding: 0;
17+
color: inherit;
18+
background: none;
19+
}
20+
21+
22+
// Canvas
23+
.k-list-scroller {
24+
flex: 1 1 auto;
25+
}
26+
27+
// Pager
28+
.k-pager-wrap {
29+
display: flex;
30+
flex: 0 0 auto;
31+
align-items: center;
32+
min-height: auto;
33+
}
34+
35+
// Page
36+
.k-page {
37+
margin: @pdf-viewer-page-spacing auto;
38+
}
39+
40+
}
41+
42+
// Window
43+
.k-pdf-viewer-window {
44+
flex: 1 1 auto;
45+
46+
.k-edit-field {
47+
.k-textbox,
48+
.k-file-format {
49+
width: 100%;
50+
}
51+
}
52+
53+
.k-action-buttons {
54+
top: @pdf-viewer-action-buttons-top-offset;
55+
padding: @pdf-viewer-action-buttons-padding;
56+
margin-bottom: calc(@pdf-viewer-action-buttons-padding - 1em);
57+
}
58+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.k-pdf-viewer {
2+
.fill(
3+
@pdf-viewer-text,
4+
@pdf-viewer-bg,
5+
@pdf-viewer-border
6+
);
7+
8+
9+
// Toolbar
10+
.k-toolbar {
11+
.k-icon,
12+
.k-pager-input {
13+
color: @pdf-viewer-toolbar-button-bg;
14+
}
15+
}
16+
17+
18+
// Canvas
19+
.k-canvas {
20+
.fill(
21+
@pdf-viewer-canvas-text,
22+
@pdf-viewer-canvas-bg,
23+
@pdf-viewer-canvas-border
24+
);
25+
}
26+
27+
28+
// Page
29+
.k-page {
30+
.fill(
31+
@pdf-viewer-page-text,
32+
@pdf-viewer-page-bg,
33+
@pdf-viewer-page-border
34+
);
35+
.box-shadow( @pdf-viewer-page-shadow );
36+
}
37+
38+
}
File renamed without changes.

styles/web/common/all.less

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@
3535
@import "font-icons.less";
3636
@import "spreadsheet.less";
3737
@import "dialog.less";
38-
@import "../Default/card/layout.less";
39-
@import "../Default/chat/layout.less";
38+
@import "../Default/card/_layout.less";
39+
@import "../Default/chat/_layout.less";
4040
@import "../Default/calendar/_layout.less";
4141
@import "../Default/multiviewcalendar/_layout.less";
42+
@import "../Default/pdf-viewer/_layout.less";
4243
@import "../Default/scrollview/_layout.less";
4344
@import "../Default/switch/_layout.less";
4445

0 commit comments

Comments
 (0)