total_mess.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Html2Pdf</title>
  5. <link rel="stylesheet" type="text/css" href="examples.css">
  6. <style>
  7. </style>
  8. </head>
  9. <body>
  10. <div style='position: absolute; left: 0; width: 400px'>
  11. <br />
  12. <h1>Heading one</h1>
  13. <h2>Header two</h2>
  14. <h3>Header three</h3>
  15. <h4>Header four</h4>
  16. <h5>Header five</h5>
  17. <h6>Header six</h6>
  18. <p>
  19. This is a copy of one of the sample pages from the <a href="http://www.wordpress.org" onclick="_gaq.push(['_trackEvent', 'outbound-article', 'http://www.wordpress.org', 'WordPress']);">WordPress</a> theme development test content. I found it handy to keep a copy of this for building sites that aren’t using WordPress. 99% of the credit goes to them, I’m just hosting it in a handy place in case it’s useful to anyone other than me.
  20. </p>
  21. <h2>Blockquote Tests</h2>
  22. <p>Blockquote:</p>
  23. <blockquote>
  24. <p>Here’s a one line quote.</p>
  25. </blockquote>
  26. <p>This part isn’t quoted. Here’s a longer quote:</p>
  27. <blockquote>
  28. <p>I have learned, that if one advances confidently in the direction of his dreams, and endeavors to live the life he has imagined, he will meet with a success unexpected in common hours.</p>
  29. <p>
  30. <cite>Henry David Thoreau </cite>
  31. </p>
  32. </blockquote>
  33. <p>And some trailing text.</p>
  34. <h2>Table Layout Test</h2>
  35. <table class="statsDay">
  36. <tbody>
  37. <tr>
  38. <th>Title</th>
  39. <th class="views">Views</th>
  40. <th></th>
  41. </tr>
  42. <tr class="alternate">
  43. <td class="label"><a href="http:///example.com/" onclick="_gaq.push(['_trackEvent', 'outbound-article', 'http:///example.com/', 'About Test User']);">About Test User</a></td>
  44. <td class="views">1</td>
  45. <td class="more">More</td>
  46. </tr>
  47. <tr>
  48. <td class="label"><a href="http://example.com/" onclick="_gaq.push(['_trackEvent', 'outbound-article', 'http://example.com/', '260']);">260</a></td>
  49. <td class="views">1</td>
  50. <td class="more">More</td>
  51. </tr>
  52. <tr class="alternate">
  53. <td class="label"><a href="http://example.com" onclick="_gaq.push(['_trackEvent', 'outbound-article', 'http://example.com', 'Archives']);">Archives</a></td>
  54. <td class="views">1</td>
  55. <td class="more">More</td>
  56. </tr>
  57. <tr>
  58. <td class="label"><a href="http://example.com" onclick="_gaq.push(['_trackEvent', 'outbound-article', 'http://example.com', '235']);">235</a></td>
  59. <td class="views">1</td>
  60. <td class="more">More</td>
  61. </tr>
  62. </tbody>
  63. </table>
  64. <h2>List Type Tests</h2>
  65. <h3>Definition List</h3>
  66. <dl>
  67. <dt>Definition List Title</dt>
  68. <dd>This is a definition list division.</dd>
  69. <dt>Definition</dt>
  70. <dd>
  71. An exact statement or description of the nature, scope, or meaning of something: <em>our definition of what constitutes poetry.</em>
  72. </dd>
  73. <dt>Gallery</dt>
  74. <dd>A feature introduced with WordPress 2.5, that is specifically an exposition of images attached to a post. In that same vein, an upload is “attached to a post” when you upload it while editing a post.</dd>
  75. <dt>Gravatar</dt>
  76. <dd>A globally recognized avatar (a graphic image or picture that represents a user). A gravatar is associated with an email address, and is maintained by the Gravatar.com service. Using this service, a blog owner can configure their blog so that a user’s gravatar is displayed along with their comments.</dd>
  77. </dl>
  78. <h3>Unordered List (Nested)</h3>
  79. <ul>
  80. <li>List item one
  81. <ul>
  82. <li>List item one
  83. <ul>
  84. <li>List item one</li>
  85. <li>List item two</li>
  86. <li>List item three</li>
  87. <li>List item four</li>
  88. </ul>
  89. </li>
  90. <li>List item two</li>
  91. <li>List item three</li>
  92. <li>List item four</li>
  93. </ul>
  94. </li>
  95. <li>List item two</li>
  96. <li>List item three</li>
  97. <li>List item four</li>
  98. </ul>
  99. <h3>Ordered List</h3>
  100. <ol>
  101. <li>List item one
  102. <ol>
  103. <li>List item one
  104. <ol>
  105. <li>List item one</li>
  106. <li>List item two</li>
  107. <li>List item three</li>
  108. <li>List item four</li>
  109. </ol>
  110. </li>
  111. <li>List item two</li>
  112. <li>List item three</li>
  113. <li>List item four</li>
  114. </ol>
  115. </li>
  116. <li>List item two</li>
  117. <li>List item three</li>
  118. <li>List item four</li>
  119. </ol>
  120. <h2>HTML Element Tag Tests</h2>
  121. <p>
  122. All other HTML tags listed in the <a href="http://en.support.wordpress.com/code/" onclick="_gaq.push(['_trackEvent', 'outbound-article', 'http://en.support.wordpress.com/code/', 'FAQ']);">FAQ</a>:
  123. </p>
  124. <p>
  125. Here is the address for Automattic, using the
  126. <code>
  127. <address>
  128. </code>
  129. tag:
  130. </p>
  131. <address>
  132. 355 1st Street Suite 202<br /> San Francisco, CA 94105<br /> United States
  133. </address>
  134. <p>
  135. This is an example of <a href="http://example.com" onclick="_gaq.push(['_trackEvent', 'outbound-article', 'http://example.com', 'an <anchor>']);">an <code>
  136. <anchor>
  137. </code></a> (otherwise known as a link). This <abbr title="abbreviation">abbr.</abbr> is an example of an <abbr> tag in the middle of a sentence. Here is a <acronym title="three-letter acronym">TLA</acronym> showing off the <code>
  138. <acronym>
  139. </code> tag. What, you want to see <big>some over-sized text</big> using the <code>
  140. <big>
  141. </code> tag? Can you <cite>cite a reference</cite> for that, using the <code>
  142. <cite>
  143. </code> tag? Have you noticed that all of the tag names are displayed <code>in code-form</code>, using the <code>
  144. <code></code>
  145. tag? Similarly, I could
  146. <kbd>emulate keyboard text</kbd>
  147. , using the
  148. <code>
  149. <kbd>
  150. </code>
  151. text tag, or
  152. <tt>emulate teletype text</tt>
  153. using the
  154. <code>
  155. <tt>
  156. </code>
  157. tag.
  158. </p>
  159. <p>
  160. Oh no! I wrote something incorrectly.
  161. <del>I’d better delete it</del>
  162. , using the
  163. <code>
  164. <del>
  165. </code>
  166. tag. I could alternately <span style="text-decoration: line-through;">strike something out</span> using the
  167. <code>
  168. <strike>
  169. </code>
  170. tag, or strike something out using the
  171. <code>
  172. <s>
  173. </code>
  174. tag. <em>So many choices</em>, which I emphasize using the
  175. <code>
  176. <em>
  177. </code>
  178. tag. Just to clarify,
  179. <ins>this is some inserted text</ins>
  180. , that I’ll highlight using the
  181. <code>
  182. <ins>
  183. </code>
  184. tag.
  185. </p>
  186. <p>
  187. Need to display completely unformatted text, such as a large block of code? Use the
  188. <code>
  189. <pre>
  190. </code>
  191. tag, which lets you display:
  192. </p>
  193. <pre>#container {
  194. float: left;
  195. margin: 0 -240px 0 0;
  196. width: 100%;
  197. }</pre>
  198. <p>
  199. Want to quote the WordPress tagline <q>Code is Poetry</q>? Use the
  200. <code>
  201. <q>
  202. </code>
  203. tag to add quotes around it. <strong>This is strong text</strong> (otherwise known as bold), using the
  204. <code>
  205. <strong>
  206. </code>
  207. tag.
  208. </p>
  209. <p>
  210. Need to write H<sub>2</sub>O or E = MC<sup>2</sup>? You may find great use for <sub>subscripting</sub> text using the
  211. <code>
  212. <sub>
  213. </code>
  214. tag, or for <sup>superscripting</sup> text using the
  215. <code>
  216. <sup>
  217. </code>
  218. tag. Need to call out a
  219. <var>variable</var>
  220. ? Use the
  221. <code>
  222. <var>
  223. </code>
  224. tag.
  225. </p>
  226. <h2>Div and Span Tests</h2>
  227. <div>
  228. <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
  229. <div class="myclass">
  230. <strong>This is a div with “myclass” class, inside of another div, using the <code>
  231. <div>
  232. </code> tag.
  233. </strong>
  234. </div>
  235. <p>Sed odio nibh, tincidunt adipiscing, pretium nec, tincidunt id, enim. Fusce scelerisque nunc vitae nisl.</p>
  236. </div>
  237. <p>
  238. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. <span><strong>This is a span inside of a paragraph, using the <code>
  239. <span>
  240. </code> tag.
  241. </strong></span> Sed odio nibh, tincidunt adipiscing, pretium nec, tincidunt id, enim. Fusce scelerisque nunc vitae nisl.
  242. </p>
  243. <p>
  244. </div>
  245. <script src='../../dist/jspdf.debug.js'></script>
  246. <script src='../../libs/html2pdf.js'></script>
  247. <script>
  248. var pdf = new jsPDF('p', 'pt', 'letter');
  249. var canvas = pdf.canvas;
  250. canvas.height = 72 * 11;
  251. canvas.width=72 * 8.5;;
  252. // var width = 400;
  253. html2pdf(document.body, pdf,function(pdf) {
  254. var iframe = document.createElement('iframe');
  255. iframe.setAttribute('style','position:absolute;right:0; top:0; bottom:0; height:100%; width:500px');
  256. document.body.appendChild(iframe);
  257. iframe.src = pdf.output('datauristring');
  258. //var div = document.createElement('pre');
  259. //div.innerText=pdf.output();
  260. //document.body.appendChild(div);
  261. }
  262. );
  263. </script>
  264. </body>
  265. </html>