You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.MD
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@
8
8
</a>
9
9
</p>
10
10
11
-
***🎉 Thanks a ton to the community - Now standing tall over 350,000 downloads!!!***
11
+
***🎉 Thanks a ton to the community - Now standing tall over 400,000 downloads!!!***
12
12
13
-
*Pull requests and contributions are much appreciated.*
13
+
***Pull requests and contributions are much appreciated.***
14
14
15
15
This is a super simple angular 8 component for displaying pdfs inline(embedded) OR in a new tab along with a feature rich viewer. It uses mozilla's pdfjs viewer(v2.2.171) behind the scenes and supports angular(2/4/5/6/7/8). Extremely lightweight, easiest to integrate and use, most reliable, this library has only one dependancy (@angular/core).
Copy file name to clipboardExpand all lines: dist/README.MD
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,16 @@
8
8
</a>
9
9
</p>
10
10
11
-
***🎉 Thanks a ton to the community - Now standing tall over 350,000 downloads!!!***
11
+
***🎉 Thanks a ton to the community - Now standing tall over 400,000 downloads!!!***
12
12
13
-
*Looking for contributors to this project. Reach at [email protected]*
13
+
***Pull requests and contributions are much appreciated.***
14
14
15
15
This is a super simple angular 8 component for displaying pdfs inline(embedded) OR in a new tab along with a feature rich viewer. It uses mozilla's pdfjs viewer(v2.2.171) behind the scenes and supports angular(2/4/5/6/7/8). Extremely lightweight, easiest to integrate and use, most reliable, this library has only one dependancy (@angular/core).
16
16
17
17
## What is new?
18
18
1.**Direct access to underlying viewer** - Exposed PDFViewerApplication and PDFViewerApplicationOptions objects opens a whole world of customizable PDFJS and ViewerJS properties and methods, allowing to change them programmatically; thus producing a unique viewer experience.
19
19
2.**Dynamic page number** - Getter/Setter added for page number. Change page number after document loaded, or access current page in parent component.
20
-
3.**Support for events** - You may now register several events such as document load, page change, before print, after print etc.
20
+
3.**Support for events** - You may now register several events such as document load, page change, before print, after print etc. Please make sure to provide `viewerId` for events to work properly.
21
21
22
22
## Tutorials, Demos & Examples
23
23
**Hosted Demo app showing unique use cases**: https://ng2-pdfjs-viewer.azurewebsites.net
@@ -30,7 +30,7 @@ Some of below features are unique to this component, which is unavailable in nat
30
30
✔️ **Direct access to underlying viewer** 👨💻👩💻- Exposed PDFViewerApplication and PDFViewerApplicationOptions objects opens a whole world of customizable PDFJS and ViewerJS properties and methods, allowing to change them programmatically; thus producing a unique viewer experience.
31
31
✔️ **Embed pdf** 🗎 - Embeds viewer and pdf inside your web page/component.
32
32
✔️ **Blob and byte arrays** 🔟 - Have pdf as a byte array? Still works.
33
-
✔️ **Events** ⚡ - Catch events such as document loaded, page change, before/after print etc.
33
+
✔️ **Events** ⚡ - Catch events such as document loaded, page change, before/after print etc.Please make sure to provide `viewerId` for events to work properly.
34
34
✔️ **Print preview** 🖨️ - You can set the pdf to open in a new tab or another browser window and provide an immediate print preview, A use case will be a 'Print' button opening pdf in new window with print dialog.
35
35
✔️ **Defaults** - There are a ton of built in functionality Mozilla's viewer supports; such as print, download, bookmark, fullscreen, open file, zoom, search, pan, spread, navigate, attachments etc which is also available as-is in this viewer. Not mentioning them individually.
36
36
✔️ **Auto download** 💾 - This option allows you to download the pdf file to user device automatically without manually invoking the download.
@@ -53,7 +53,7 @@ Some of below features are unique to this component, which is unavailable in nat
53
53
<imgsrc="/sampledoc/ng2pdfjsviewerExternal.JPG"alt="angular 8 pdfjs viewer in new window"/>
@@ -119,10 +119,10 @@ _Please note if you decide to put `pdfjs` folder anywhere else other than the `a
119
119
|`[viewerFolder]`| Set path to _pdfjs's_`web` and `build` folders. |`string`|`assets` folder path |
120
120
|`[externalWindow]`| Open in new tab. Set to `true` to open document in a new tab |`boolean`|`false`|
121
121
|`externalWindowOptions`| External window options. For allowed comma separated values, refer to https://developer.mozilla.org/en-US/docs/Web/API/Window/open|`string`||
122
-
|`(onDocumentLoad)`| Event to be invoked once document is fully loaded. Also returns number of pages in the `$event` parameter. E.g. `(onDocumentLoad)="testPagesLoaded($event)""`|`Function`||
123
-
|`(onPageChange)`| Event to be invoked when user scrolls through pages. Also returns current page number user is at in the `$event` parameter. E.g. `(onPageChange)="testPageChange($event)""`|`Function`||
124
-
|`(onBeforePrint)`| Event to be invoked before document gets printed. E.g. `(onBeforePrint)="testBeforePrint()"`|`Function`||
125
-
|`(onAfterPrint)`| Event to be invoked after document gets printed. E.g. `(onAfterPrint)="testAfterPrint()"`|`Function`||
122
+
|`(onDocumentLoad)`| Event to be invoked once document is fully loaded(Must provide `viewerId`). Also returns number of pages in the `$event` parameter. E.g. `(onDocumentLoad)="testPagesLoaded($event)""`|`Function`||
123
+
|`(onPageChange)`| Event to be invoked when user scrolls through pages(Must provide `viewerId`). Also returns current page number user is at in the `$event` parameter. E.g. `(onPageChange)="testPageChange($event)""`|`Function`||
124
+
|`(onBeforePrint)`| Event to be invoked before document gets printed(Must provide `viewerId`). E.g. `(onBeforePrint)="testBeforePrint()"`|`Function`||
125
+
|`(onAfterPrint)`| Event to be invoked after document gets printed(Must provide `viewerId`). E.g. `(onAfterPrint)="testAfterPrint()"`|`Function`||
126
126
|`downloadFileName`| Sets/Changes the name of document to be downloaded. If the file name does not ends in `.pdf`, the component will automatically add it for you. |`string`| Actual name of the document |
127
127
|`[page]`| Show specific page. E.g _page=3_. You may also get/set the page number from your component using '.' notation explicitly, after document is loaded. E.g. `myPdfViewer.page = 3;`|`number`|`1`|
128
128
|`[lastPage]`| Show last page of the document once it is loaded(If set to `true`). If you use this option along with _`page`_ option, undesired effects might occur |`boolean`|`false`|
0 commit comments