Skip to content

Commit da50364

Browse files
authored
Merge pull request #41 from SyncfusionExamples/Ej2-942079-hidecommentpanelItems
942079: Hide Comment panel Items
2 parents 5ad3647 + 2b02271 commit da50364

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<!DOCTYPE html><html lang="en"><head>
2+
<title>EJ2 PDF Viewer</title>
3+
<meta charset="utf-8">
4+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
5+
<meta name="description" content="Typescript PDF Viewer Control">
6+
<meta name="author" content="Syncfusion">
7+
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-base/styles/material.css" rel="stylesheet">
8+
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-pdfviewer/styles/material.css" rel="stylesheet">
9+
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-buttons/styles/material.css" rel="stylesheet">
10+
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-popups/styles/material.css" rel="stylesheet">
11+
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-navigations/styles/material.css" rel="stylesheet">
12+
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-dropdowns/styles/material.css" rel="stylesheet">
13+
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-lists/styles/material.css" rel="stylesheet">
14+
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-inputs/styles/material.css" rel="stylesheet">
15+
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-splitbuttons/styles/material.css" rel="stylesheet">
16+
<link href="https://cdn.syncfusion.com/ej2/31.1.17/ej2-notifications/styles/material.css" rel="stylesheet">
17+
18+
<!-- Essential JS 2 PDF Viewer's script -->
19+
<script src="https://cdn.syncfusion.com/ej2/31.1.17/dist/ej2.min.js" type="text/javascript"></script>
20+
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
21+
</head>
22+
<body>
23+
<button id="openCommentPanel">Open Commentpanel</button>
24+
<button id="closeCommentPanel">Close Commentpanel</button>
25+
<div id="container">
26+
<div id="PdfViewer" style="height:500px;width:100%;"></div>
27+
</div>
28+
<script>
29+
var ele = document.getElementById('container');
30+
if(ele) {
31+
ele.style.visibility = "visible";
32+
}
33+
</script>
34+
<script src="index.js" type="text/javascript"></script>
35+
</body></html>
36+
37+
<style>
38+
39+
.e-editable-inline {
40+
41+
display: none !important;
42+
43+
}
44+
45+
.e-pv-comment-panel-title-close-div {
46+
47+
display: none !important;
48+
49+
}
50+
51+
.e-pv-more-options-button {
52+
53+
display: none !important;
54+
55+
}
56+
57+
</style>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var pdfviewer = new ej.pdfviewer.PdfViewer({
2+
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
3+
resourceUrl: 'https://cdn.syncfusion.com/ej2/31.1.17/dist/ej2-pdfviewer-lib',
4+
});
5+
ej.pdfviewer.PdfViewer.Inject(ej.pdfviewer.TextSelection, ej.pdfviewer.TextSearch, ej.pdfviewer.Print, ej.pdfviewer.Navigation, ej.pdfviewer.Toolbar, ej.pdfviewer.Magnification, ej.pdfviewer.Annotation, ej.pdfviewer.FormDesigner, ej.pdfviewer.FormFields);
6+
pdfviewer.appendTo('#PdfViewer');
7+
// Open Comment Panel
8+
document.getElementById('openCommentPanel').addEventListener('click', ()=> {
9+
pdfviewer.annotation.showCommentsPanel();
10+
});
11+
// Close Comment Panel
12+
document.getElementById('closeCommentPanel').addEventListener('click', ()=> {
13+
pdfviewer.viewerBase.navigationPane.closeCommentPanelContainer();
14+
});
15+
// Automatically open Comment Panel on document load
16+
pdfviewer.documentLoad = function (args) {
17+
pdfviewer.annotation.showCommentsPanel();
18+
}

0 commit comments

Comments
 (0)