ng2-pdfjs-viewer 25.0.4 → 25.0.6
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 +74 -12
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
The most reliable, feature-rich Angular PDF viewer component powered by Mozilla's PDF.js
|
|
4
4
|
|
|
5
|
+
<div align="center">
|
|
6
|
+
<img src="logo.svg" alt="ng2-pdfjs-viewer Logo" width="120" height="140" />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
5
9
|
<div align="center">
|
|
6
10
|
|
|
7
11
|
[](https://www.npmjs.com/package/ng2-pdfjs-viewer)
|
|
@@ -17,7 +21,7 @@ The most reliable, feature-rich Angular PDF viewer component powered by Mozilla'
|
|
|
17
21
|
|
|
18
22
|
<div align="center">
|
|
19
23
|
|
|
20
|
-
[**Live Demo**](https://
|
|
24
|
+
[**Live Demo**](https://angular-pdf-viewer-demo.vercel.app/) • [**API Reference**](#-api-reference) • [**Examples**](#-examples) • [**Server Examples**](../Server-Side-Examples.md) • [**Migration Guide**](#-migration-guide)
|
|
21
25
|
|
|
22
26
|
</div>
|
|
23
27
|
|
|
@@ -94,6 +98,9 @@ Whether you need a simple embedded PDF viewer or a complex document management s
|
|
|
94
98
|
|
|
95
99
|
## 🚀 Quick Start
|
|
96
100
|
|
|
101
|
+
> **🎯 Live Demo**: [https://angular-pdf-viewer-demo.vercel.app/](https://angular-pdf-viewer-demo.vercel.app/)
|
|
102
|
+
> **📁 Source Code**: [https://github.com/intbot/ng2-pdfjs-viewer/tree/main/SampleApp](https://github.com/intbot/ng2-pdfjs-viewer/tree/main/SampleApp)
|
|
103
|
+
|
|
97
104
|
### 1. Install the Package
|
|
98
105
|
|
|
99
106
|
```bash
|
|
@@ -488,6 +495,9 @@ export class MyComponent {
|
|
|
488
495
|
|
|
489
496
|
## 🎨 Examples
|
|
490
497
|
|
|
498
|
+
> **🎯 Live Demo**: [https://angular-pdf-viewer-demo.vercel.app/](https://angular-pdf-viewer-demo.vercel.app/)
|
|
499
|
+
> **📁 Source Code**: [https://github.com/intbot/ng2-pdfjs-viewer/tree/main/SampleApp](https://github.com/intbot/ng2-pdfjs-viewer/tree/main/SampleApp)
|
|
500
|
+
|
|
491
501
|
### 1. Basic PDF Viewer
|
|
492
502
|
|
|
493
503
|
```html
|
|
@@ -534,7 +544,51 @@ export class MyComponent {
|
|
|
534
544
|
</ng2-pdfjs-viewer>
|
|
535
545
|
```
|
|
536
546
|
|
|
537
|
-
### 4.
|
|
547
|
+
### 4. Convenience Setters (Object-Based Configuration)
|
|
548
|
+
|
|
549
|
+
```typescript
|
|
550
|
+
export class PdfController {
|
|
551
|
+
// Group visibility configuration
|
|
552
|
+
groupVisibility = {
|
|
553
|
+
"download": true,
|
|
554
|
+
"print": true,
|
|
555
|
+
"find": true,
|
|
556
|
+
"fullScreen": true,
|
|
557
|
+
"openFile": true,
|
|
558
|
+
"viewBookmark": true,
|
|
559
|
+
"annotations": false
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
// Auto actions configuration
|
|
563
|
+
autoActions = {
|
|
564
|
+
"downloadOnLoad": false,
|
|
565
|
+
"printOnLoad": false
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
// Control visibility configuration
|
|
569
|
+
controlVisibility = {
|
|
570
|
+
"showToolbarLeft": true,
|
|
571
|
+
"showToolbarMiddle": true,
|
|
572
|
+
"showToolbarRight": true,
|
|
573
|
+
"showSecondaryToolbarToggle": true,
|
|
574
|
+
"showSidebar": true,
|
|
575
|
+
"showSidebarLeft": true,
|
|
576
|
+
"showSidebarRight": true
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
```html
|
|
582
|
+
<ng2-pdfjs-viewer
|
|
583
|
+
pdfSrc="assets/sample.pdf"
|
|
584
|
+
[groupVisibility]="groupVisibility"
|
|
585
|
+
[autoActions]="autoActions"
|
|
586
|
+
[controlVisibility]="controlVisibility"
|
|
587
|
+
>
|
|
588
|
+
</ng2-pdfjs-viewer>
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
### 5. Programmatic Control
|
|
538
592
|
|
|
539
593
|
```typescript
|
|
540
594
|
export class PdfController {
|
|
@@ -555,6 +609,20 @@ export class PdfController {
|
|
|
555
609
|
}
|
|
556
610
|
```
|
|
557
611
|
|
|
612
|
+
### 6. Server-Side Integration
|
|
613
|
+
|
|
614
|
+
For server-side developers, we provide comprehensive examples for integrating PDF APIs with ng2-pdfjs-viewer:
|
|
615
|
+
|
|
616
|
+
**[📋 Server-Side Examples](../Server-Side-Examples.md)** - Complete examples for:
|
|
617
|
+
- **ASP.NET Core (C#)** - RDLC reports, physical files, iTextSharp
|
|
618
|
+
- **Node.js (Express)** - File serving, PDFKit, Puppeteer
|
|
619
|
+
- **Python (FastAPI)** - ReportLab, WeasyPrint, file handling
|
|
620
|
+
- **Java (Spring Boot)** - iText, JasperReports, file serving
|
|
621
|
+
- **PHP (Laravel)** - TCPDF, DomPDF, file management
|
|
622
|
+
- **Go (Gin)** - gofpdf, file serving, PDF generation
|
|
623
|
+
|
|
624
|
+
Each example includes proper Content-Type headers, error handling, CORS configuration, and Angular integration patterns.
|
|
625
|
+
|
|
558
626
|
---
|
|
559
627
|
|
|
560
628
|
## 🔄 Migration Guide
|
|
@@ -678,8 +746,6 @@ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) f
|
|
|
678
746
|
# Clone the repository
|
|
679
747
|
git clone https://github.com/intbot/ng2-pdfjs-viewer.git
|
|
680
748
|
|
|
681
|
-
# Install dependencies
|
|
682
|
-
npm install
|
|
683
749
|
|
|
684
750
|
# Clear Angular cache (Windows)
|
|
685
751
|
Remove-Item -Recurse -Force "SampleApp\.angular"
|
|
@@ -689,11 +755,6 @@ Remove-Item -Recurse -Force "SampleApp\.angular"
|
|
|
689
755
|
@test.bat
|
|
690
756
|
```
|
|
691
757
|
|
|
692
|
-
### Reporting Issues
|
|
693
|
-
|
|
694
|
-
- 🐛 **Bug Reports**: [GitHub Issues](https://github.com/intbot/ng2-pdfjs-viewer/issues)
|
|
695
|
-
- 💡 **Feature Requests**: [GitHub Discussions](https://github.com/intbot/ng2-pdfjs-viewer/discussions)
|
|
696
|
-
- 📚 **Documentation**: [GitHub Wiki](https://github.com/intbot/ng2-pdfjs-viewer/wiki)
|
|
697
758
|
|
|
698
759
|
---
|
|
699
760
|
|
|
@@ -705,10 +766,11 @@ This project is licensed under the **Apache License 2.0 + Commons Clause License
|
|
|
705
766
|
|
|
706
767
|
## 🙏 Acknowledgments
|
|
707
768
|
|
|
708
|
-
|
|
709
|
-
|
|
769
|
+
|
|
770
|
+
|
|
710
771
|
- **Community Contributors** - For bug reports, feature requests, and contributions
|
|
711
772
|
- **7+ Million Users** - For trusting us with your PDF viewing needs
|
|
773
|
+
- **Mozilla PDF.js Team** - For the amazing PDF.js library
|
|
712
774
|
|
|
713
775
|
---
|
|
714
776
|
|
|
@@ -718,12 +780,12 @@ This project is licensed under the **Apache License 2.0 + Commons Clause License
|
|
|
718
780
|
- 💬 **Community**: [GitHub Discussions](https://github.com/intbot/ng2-pdfjs-viewer/discussions)
|
|
719
781
|
- 🐛 **Issues**: [GitHub Issues](https://github.com/intbot/ng2-pdfjs-viewer/issues)
|
|
720
782
|
- 📧 **Email**: codehippie1@gmail.com
|
|
783
|
+
- 📧 **Author**: [Aneesh Gopalakrishnan](http://github.com/codehippie1)
|
|
721
784
|
|
|
722
785
|
---
|
|
723
786
|
|
|
724
787
|
<div align="center">
|
|
725
788
|
|
|
726
|
-
**Made with ❤️ by [Aneesh](http://github.com/codehippie1)**
|
|
727
789
|
|
|
728
790
|
[](https://github.com/intbot/ng2-pdfjs-viewer)
|
|
729
791
|
[](https://www.npmjs.com/package/ng2-pdfjs-viewer)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ng2-pdfjs-viewer",
|
|
3
|
-
"version": "25.0.
|
|
3
|
+
"version": "25.0.6",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Aneesh Goapalakrishnan",
|
|
6
6
|
"email": "codehippie1@gmail.com"
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@angular/common": "
|
|
28
|
-
"@angular/core": "
|
|
27
|
+
"@angular/common": ">=10.0.0",
|
|
28
|
+
"@angular/core": ">=10.0.0"
|
|
29
29
|
},
|
|
30
30
|
"$schema": "./node_modules/ng-packagr/package.schema.json",
|
|
31
31
|
"bugs": {
|