|
6 | 6 | *
|
7 | 7 | * Licensed under the MIT License.
|
8 | 8 | * http://opensource.org/licenses/mit-license
|
9 |
| - */ |
| 9 | + */ |
10 | 10 | -->
|
11 | 11 |
|
12 | 12 | <html>
|
|
20 | 20 | <script>
|
21 | 21 | require_baseUrl_override = '../../';
|
22 | 22 | require(['../../libs/require/config'], function(){
|
23 |
| - require(['jspdf.plugin.annotations', 'examples/js/test_harness'], function(){ |
| 23 | + require(['plugins/annotations', 'examples/js/test_harness'], function(){ |
24 | 24 |
|
25 | 25 | var pdf = new jsPDF('p', 'pt', 'letter');
|
26 |
| - |
| 26 | + |
27 | 27 | // Create pages with a table of contents.
|
28 | 28 | // TOC links to each page
|
29 | 29 | // Each page links back to TOC and to an external URL
|
|
32 | 32 | var text = 'Table of Contents';
|
33 | 33 | pdf.text(text, 20, y);
|
34 | 34 | y += pdf.getLineHeight() * 2;
|
35 |
| - |
| 35 | + |
36 | 36 | for (var i=2; i<10; i++){
|
37 | 37 | text = "Page " + i;
|
38 | 38 | pdf.textWithLink(text, 20, y, {pageNumber:i});
|
39 | 39 | y += pdf.getLineHeight();
|
40 |
| - |
| 40 | + |
41 | 41 | var x = 20;
|
42 | 42 | var width = pdf.textWithLink(" [100%]", x, y, {pageNumber:i, magFactor:'XYZ', zoom:1});
|
43 |
| - x += width; |
| 43 | + x += width; |
44 | 44 | var width = pdf.textWithLink(" [200%]", x, y, {pageNumber:i, magFactor:'XYZ', zoom:2});
|
45 |
| - x += width; |
| 45 | + x += width; |
46 | 46 | var width = pdf.textWithLink(" [50%]", x, y, {pageNumber:i, magFactor:'XYZ', zoom:.5});
|
47 |
| - x += width; |
| 47 | + x += width; |
48 | 48 | var width = pdf.textWithLink(" [Fit]", x, y, {pageNumber:i, magFactor:'Fit'});
|
49 |
| - x += width; |
| 49 | + x += width; |
50 | 50 | var width = pdf.textWithLink(" [FitH]", x, y, {pageNumber:i, magFactor:'FitH'});
|
51 |
| - x += width; |
| 51 | + x += width; |
52 | 52 | var width = pdf.textWithLink(" [FitV]", x, y, {pageNumber:i, magFactor:'FitV'});
|
53 |
| - |
| 53 | + |
54 | 54 | y += pdf.getLineHeight();
|
55 | 55 | }
|
56 |
| - |
| 56 | + |
57 | 57 | // Create Test Pages
|
58 | 58 | for (var i=2; i<10; i++){
|
59 | 59 | pdf.addPage();
|
60 | 60 | y = 20;
|
61 | 61 | var text = 'Page ' + i;
|
62 | 62 | pdf.text(text, 20, y);
|
63 | 63 | y += pdf.getLineHeight() * 2;
|
64 |
| - |
| 64 | + |
65 | 65 | text = "Goto First Page";
|
66 | 66 | pdf.textWithLink(text, 20, y, {pageNumber:1});
|
67 |
| - y += pdf.getLineHeight(); |
68 |
| - |
| 67 | + y += pdf.getLineHeight(); |
| 68 | + |
69 | 69 | text = "Goto External URL";
|
70 | 70 | pdf.textWithLink(text, 20, y, {url:'http://www.twelvetone.tv'});
|
71 |
| - y += pdf.getLineHeight(); |
| 71 | + y += pdf.getLineHeight(); |
72 | 72 | }
|
73 |
| - |
| 73 | + |
74 | 74 | var message = 'Chrome default PDF reader currently does not support magFactor links, \
|
75 | 75 | although links still work after manualy changing magFactor. <br /> \
|
76 | 76 | Firefox has a bug displaying annotations after the magFactor changes, but links do work. <br /> \
|
77 | 77 | To test magFactor links [...] without bugs, use Adobe Reader or compatible application.';
|
78 |
| - |
| 78 | + |
79 | 79 | pdf_test_harness_init(pdf, message);
|
80 |
| - |
| 80 | + |
81 | 81 | }); // require
|
82 | 82 | }); // require
|
83 |
| - |
| 83 | + |
84 | 84 | </script>
|
85 | 85 |
|
86 | 86 | </head>
|
|
0 commit comments