12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <!doctype html>
- <!--
- /**
- * jsPDF Annotations PlugIn
- * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
- *
- * Licensed under the MIT License.
- * http://opensource.org/licenses/mit-license
- */
- -->
- <html>
- <head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <title>Annotation Test - Text</title>
- <script src='../../libs/require/require.js'></script>
- <script>
- require_baseUrl_override = '../../';
- require(['../../libs/require/config'], function(){
- require(['plugins/annotations', 'examples/js/test_harness'], function(){
- var pdf = new jsPDF('p', 'pt', 'letter');
- var y = 20;
- var w;
- var text = 'Text Annotations';
- pdf.text(text, 20, y);
- pdf.setFontSize(12);
- y += pdf.getLineHeight() * 2;
- pdf.text("Text Annotation With Popup (closed)", 20, y);
- pdf.createAnnotation({
- type : 'text',
- title: 'note',
- bounds : {
- x : 0,
- y : y,
- w : 200,
- h : 80
- },
- contents : 'This is text annotation (closed by default)',
- open : false
- });
- y += pdf.getLineHeight() * 5;
- pdf.text("Text Annotation With Popup (opened)", 20, y);
- pdf.createAnnotation({
- type : 'text',
- title: 'another note',
- bounds : {
- x : 0,
- y : y,
- w : 200,
- h : 80
- },
- contents : 'This is a text annotation (opened)',
- open : true
- });
- y += pdf.getLineHeight() * 5;
- pdf.text("Free Text Annotation", 20, y);
- pdf.createAnnotation({
- type : 'freetext',
- bounds : {
- x : 0,
- y : y + 10,
- w : 200,
- h : 20
- },
- contents : 'This is a freetext annotation',
- color : '#ff0000'
- });
- var warning = 'Most web browsers do not display annotations. Download the PDF and open in Adobe Reader, etc).'
- pdf_test_harness_init(pdf, warning);
- }); // require
- }); // require
- </script>
- </head>
- <body style='background-color: silver; margin: 0;'>
- </body>
- </html>
|