12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <!doctype html>
- <!--
- /**
- * jsPDF Test HTML 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>Test HTML</title>
- <script src='../libs/require/require.js'></script>
- <script>
- require_baseUrl_override = '../';
- require(['../libs/require/config'], function(){
- require(['test/test_harness', 'plugins/from_html'], function(){
- var pdf = new jsPDF('p', 'pt', 'letter');
- var ta = document.getElementById('textarea');
- pdf.fromHTML(ta.value, 0, 0);
- ta.onkeyup = function(){
- var pdf = new jsPDF('p', 'pt', 'letter');
- pdf.fromHTML(ta.value, 0, 0);
- harness.setPdf(pdf);
- }
- ta.onkeyup = function(){
- var pdf = new jsPDF('p', 'pt', 'letter');
- pdf.fromHTML(ta.value, 0, 0);
- harness.setPdf(pdf);
- }
- var harness = pdf_test_harness_init(pdf);
- harness.header.style.left='300px';
- harness.body.style.left='300px';
- }); //require
- }); //require
- </script>
- <script>
- pdf_test_harness.onload = function(harness) {
- }
- </script>
- </head>
- <body style='background-color: silver; margin: 0;'>
- <textarea id='textarea' style='position:fixed;left:0;width:290px;height:100%'>
- <html>
- <head>
- <style>
- .break{
- page-break-before:always;
- }
- body{
- font-size:2em;
- }
- </style>
- </head>
- <body>
- <div>page 1 <em>ok?</em></div>
- <div class='break'>page 2</div>
- <div class='break' style='margin-top:1in'>page 3</div>
- </body>
- </html>
- </textarea>
- </body>
- </html>
|