-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink.html
More file actions
43 lines (27 loc) · 913 Bytes
/
link.html
File metadata and controls
43 lines (27 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8' />
<script type="module" >
import { PDF, PDFPage, PDFAction, PDFAnnot, PDFStream } from "../source/index.mjs"
window.addEventListener('load', function() {
var doc = PDF.Create();
var action = new PDFAction( 'http://github.com/devConcordia', PDFAction.URI );
var annot = new PDFAnnot( action, PDFAnnot.LINK, 50, 50, 100, 100 );
var page = new PDFPage();
var content = new PDF.Path2D();
// content.scale( PDF.MM, PDF.MM )
content.rect( 50, 50, 100, 100 ).fill();
page.append( new PDFStream( content ), annot );
doc.attach( page );
doc.preview( document.body, innerWidth, innerHeight );
}, false);
</script>
<style>
* { padding:0; margin:0; }
iframe { position: absolute; margin:auto; left:0; top:0; bottom:0; right:0; }
</style>
</head>
<body>
</body>
</html>