Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Annotations/Link Annotation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 PDF Viewer</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript PDF Viewer Control">
<meta name="author" content="Syncfusion">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-base/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-pdfviewer/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-popups/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-navigations/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-dropdowns/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-lists/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-inputs/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-notifications/styles/material.css" rel="stylesheet">

<!-- Essential JS 2 PDF Viewer's script -->
<script src="https://cdn.syncfusion.com/ej2/35.1.37/dist/ej2.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>

<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id="container">
<button id="AddInternalLink">Add Internal Link</button>
<button id="AddExternalLink">Add External Link</button>
<button id="EditLink">Edit Link</button>
<button id="DeleteLink">Delete Link</button>
<div id="PdfViewer" style="height:500px;width:100%;"></div>
</div>


<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
55 changes: 55 additions & 0 deletions Annotations/Link Annotation/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
var pdfviewer = new ej.pdfviewer.PdfViewer({
documentPath: 'https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf',
resourceUrl: "https://cdn.syncfusion.com/ej2/35.1.37/dist/ej2-pdfviewer-lib",
});
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, ej.pdfviewer.PageOrganizer);

pdfviewer.appendTo('#PdfViewer');
document.getElementById("AddInternalLink").addEventListener('click', function(){
pdfviewer.annotation.addAnnotation('Link', {
offset: { x: 200, y: 480 },
pageNumber: 1,
width: 150,
height: 75,
destinationPageIndex: 4,
destinationLocation: { x: 100, y: 200 },
zoomValue: 4,
strokeColor: '#1433e3'
});
});

document.getElementById("AddExternalLink").addEventListener('click', function(){
pdfviewer.annotation.addAnnotation('Link', {
offset: { x: 450, y: 480 },
pageNumber: 1,
width: 150,
height: 75,
url: 'https://www.syncfusion.com',
strokeColor: '#FF0000'
});
});

document.getElementById("EditLink").addEventListener('click', function(){
for (var i = 0; i < pdfviewer.annotationCollection.length; i++) {
if (pdfviewer.annotationCollection[i].subject === 'Link') {
pdfviewer.annotationCollection[i].strokeColor = '#1fcbd4';
pdfviewer.annotationCollection[i].thickness = 2;
pdfviewer.annotationCollection[i].bounds = { left: 100, top: 100, width: 100, height: 100 };
pdfviewer.annotationCollection[i].url = 'https://www.google.com';
pdfviewer.annotationCollection[i].destinationPageIndex = 3;
pdfviewer.annotationCollection[i].destinationLocation = { x: 300, y: 300 };
pdfviewer.annotationCollection[i].zoomValue = 1;
pdfviewer.annotation.editAnnotation(pdfviewer.annotationCollection[i]);
break;
}
}
});

document.getElementById("DeleteLink").addEventListener('click', function(){
var linkAnnotation = pdfviewer.annotationCollection.find(function (item) { return item.subject === 'Link'; });

if (linkAnnotation) {
pdfviewer.annotation.deleteAnnotationById(linkAnnotation.annotationId);
}
});
39 changes: 39 additions & 0 deletions Annotations/Text and Image Stamp Annotation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 PDF Viewer</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript PDF Viewer Control">
<meta name="author" content="Syncfusion">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-base/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-pdfviewer/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-popups/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-navigations/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-dropdowns/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-lists/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-inputs/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="https://cdn.syncfusion.com/ej2/35.1.37/ej2-notifications/styles/material.css" rel="stylesheet">

<!-- Essential JS 2 PDF Viewer's script -->
<script src="https://cdn.syncfusion.com/ej2/35.1.37/dist/ej2.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>

<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>
</head>
<body>
<div id="container">
<button id="AddTextStamp">Add Text Stamp</button>
<button id="AddImageStamp">Add Image Stamp</button>
<div id="PdfViewer" style="height:500px;width:100%;"></div>
</div>


<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
49 changes: 49 additions & 0 deletions Annotations/Text and Image Stamp Annotation/index.js

Large diffs are not rendered by default.

Loading