@@ -27,26 +27,32 @@ import { FormsModule } from '@angular/forms';
2727} )
2828
2929export class AppComponent implements OnInit {
30+ // Access the PDF Viewer instance using ViewChild
3031 @ViewChild ( 'pdfviewer' ) public pdfviewerControl : PdfViewerComponent | undefined ;
3132
32- public document : string =
33- 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf' ;
34- public resource : string =
35- 'https://cdn.syncfusion.com/ej2/23.2.6/dist/ej2-pdfviewer-lib' ;
33+ // URL of the PDF document to be loaded
34+ public document : string = 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf' ;
3635
37- ngOnInit ( ) : void {
38- // Perform any initialization tasks here
39- }
36+ // URL for the PDF Viewer library resources
37+ public resource : string = 'https://cdn.syncfusion.com/ej2/23.2.6/dist/ej2-pdfviewer-lib' ;
38+
39+ ngOnInit ( ) : void { }
4040
41+ // Method to configure and apply a custom stamp to the PDF
4142 customStamp ( ) {
42- var viewer = ( < any > document . getElementById ( 'pdfViewer' ) ) . ej2_instances [ 0 ] ;
43+ // Access the PDF Viewer instance from the DOM
44+ const viewer = ( < any > document . getElementById ( 'pdfViewer' ) ) . ej2_instances [ 0 ] ;
45+
46+ // Set custom stamp settings (not added to toolbar menu)
4347 viewer . customStampSettings = {
4448 width : 300 ,
4549 height : 150 ,
4650 pageNumber : 1 ,
4751 isAddToMenu : false ,
4852 enableCustomStamp : false ,
4953 } ;
54+
55+ // Define the custom stamp image (base64 format)
5056 viewer . customStamp = [
5157 {
5258 customStampName : 'Image' ,
@@ -56,3 +62,4 @@ export class AppComponent implements OnInit {
5662 ] ;
5763 }
5864}
65+
0 commit comments