forked from parallax/jsPDF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
305 lines (228 loc) · 13.5 KB
/
index.html
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jsPDF - Create PDFs with HTML5 JavaScript Library</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Bootstrap -->
<link href="./examples/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="./examples/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<!-- Editor CSS -->
<link href="./examples/css/editor.css" rel="stylesheet">
<!-- See closing body for JS -->
<script src="http://use.edgefonts.net/source-code-pro.js"></script>
</head>
<body>
<div class="container">
<div class="masthead">
<div class="pull-right">
<div class="tweet-buttons">
<a href="https://twitter.com/share" class="twitter-share-button" data-via="MrRio" data-size="large">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<a href="https://twitter.com/MrRio" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @MrRio</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<a class="btn btn-primary btn-large" href="https://github.com/MrRio/jsPDF/zipball/master">Download Now</a>
<p class="muted" style="text-align: right;">Version 0.9.0rc1</p>
</div>
<h1 class="muted">jsPDF</h1>
<h4>HTML5 JavaScript PDF generation library from <a href="http://twitter.com/MrRio">@MrRio</a></h4>
</div>
<div class="row-fluid">
<div class="span6" style="float: right">
<iframe class="preview-pane" width="100%" height="650" frameborder="0"></iframe>
</div>
<div class="span5 no-gutter">
<h2>Have a play.</h2>
<p>A HTML5 client-side solution for generating PDFs. Perfect for event tickets, reports, certificates, you name it! </p>
<p><b>No servers were used in the making of this demo.</b></p>
<div class="template-picker">
<label for="template">Choose example</label>
<select id="template" name="template">
<option>Hold your horses...</option>
</select>
</div>
</div>
<div id="editor" class="bypass"></div>
<div class="controls">
<div class="pull-right">
<!--<a href="#" class="btn btn-primary">Download Your Code</a>-->
<a href="#" class="btn btn-primary download-pdf">Download PDF</a>
</div>
<label class="checkbox">
<input type="checkbox" id="auto-refresh" checked="checked"> Auto refresh on changes?
</label>
<a href="#" class="run-code hide btn btn-success">Run Code</a>
<div class="alert hide">
Auto refresh disabled for this
</div>
</div>
</div>
<div class="clerfix"></div>
<div class="span12 credits">
<h2>The Basics</h2>
<p>Simply include the jsPDF library in your <span class="source"><head></span>, generate your PDF using the <i>many</i> built-in functions, then hook up a button to trigger the download. All the examples here use jQuery.</p>
<h2>Browser Compatibility</h2>
<p>jsPDF will work in IE6+*, Firefox 3+, Chrome, Safari 3+, Opera. For IE9 and below, we lazily load a Flash shim called Downloadify which enables the files to be downloaded.</p>
<p>* Current build does not have IE6-9 shim enabled</p>
<h2>Credits</h2>
<p>Big thanks to Daniel Dotsenko from <a href="http://willow-systems.com">Willow Systems Corporation</a> for making huge contributions to the codebase. </p>
<p>Thanks to Ajaxian.com for <a href="http://ajaxian.com/archives/dynamically-generic-pdfs-with-javascript">featuring us back in 2009</a>.</p>
<p>Everyone else that's contributed patches or bug reports. You rock.</p>
<h2>License</h2>
<p>(MIT License)</p>
<p>Copyright (c) 2010-2012 James Hall, <a href="https://github.com/MrRio/jsPDF">https://github.com/MrRio/jsPDF</a></p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:</p>
<p>The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
</div>
</div> <!-- /container -->
<footer>© 2013 James Hall</footer>
<!-- Scripts down here -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<!-- Code editor -->
<script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
<!-- Scripts in development mode -->
<script type="text/javascript" src="jspdf.js"></script>
<script type="text/javascript" src="./libs/FileSaver.js/FileSaver.js"></script>
<script type="text/javascript" src="./libs/BlobBuilder.js/BlobBuilder.js"></script>
<script type="text/javascript" src="./jspdf.plugin.addimage.js"></script>
<script type="text/javascript" src="./jspdf.plugin.from_html.js"></script>
<script type="text/javascript" src="./jspdf.plugin.ie_below_9_shim.js"></script>
<script type="text/javascript" src="./jspdf.plugin.sillysvgrenderer.js"></script>
<script type="text/javascript" src="./jspdf.plugin.split_text_to_size.js"></script>
<script type="text/javascript" src="./jspdf.plugin.standard_fonts_metrics.js"></script>
<!-- Editor -->
<script type="text/javascript" src="./examples/js/editor.js"></script>
<!-- Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-32767308-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript">
adroll_adv_id = "P3OVQHTGMBA37E2Z6M77AQ";
adroll_pix_id = "GHWLXTPCARHSXCCSWFFDR7";
(function () {
var oldonload = window.onload;
window.onload = function(){
__adroll_loaded=true;
var scr = document.createElement("script");
var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");
scr.setAttribute('async', 'true');
scr.type = "text/javascript";
scr.src = host + "/j/roundtrip.js";
((document.getElementsByTagName('head') || [null])[0] ||
document.getElementsByTagName('script')[0].parentNode).appendChild(scr);
if(oldonload){oldonload()}};
}());
</script>
</body>
</html>
=======
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="description" content="jsPDF : Generating PDF files purely in Javascript" />
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<title>jsPDF</title>
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<header class="inner">
<a id="forkme_banner" href="https://github.com/MrRio/jsPDF">View on GitHub</a>
<h1 id="project_title">jsPDF</h1>
<h2 id="project_tagline">Generating PDF files purely in Javascript</h2>
<section id="downloads">
<a class="zip_download_link" href="https://github.com/MrRio/jsPDF/zipball/master">Download this project as a .zip file</a>
<a class="tar_download_link" href="https://github.com/MrRio/jsPDF/tarball/master">Download this project as a tar.gz file</a>
</section>
</header>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<section id="main_content" class="inner">
<p>You can <a href="http://twitter.com/MrRio">catch me on twitter</a>: <a href="http://twitter.com/MrRio">@MrRio</a> or head over to <a href="http://snapshotmedia.co.uk">my company's website</a> for consultancy. </p>
<h2>Creating your first document</h2>
<p>See examples/basic.html. Make sure you include BlobBuilder.js and FileSaver.js. </p>
<div class="highlight"><pre>
<span class="kd">var</span> <span class="nx">doc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">jsPDF</span><span class="p">();</span>
<span class="nx">doc</span><span class="p">.</span><span class="nx">text</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="s1">'Hello world.'</span><span class="p">);</span>
<span class="nx">doc</span><span class="p">.</span><span class="nx">save</span><span class="p">(</span><span class="s1">'Test.pdf'</span><span class="p">);</span>
</pre></div>
<h2>Demo</h2>
<h3>Simple two-page text document</h3>
<div class="highlight"><pre><span class="kd">var</span> <span class="nx">doc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">jsPDF</span><span class="p">();</span>
<span class="nx">doc</span><span class="p">.</span><span class="nx">text</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="s1">'Hello world!'</span><span class="p">);</span>
<span class="nx">doc</span><span class="p">.</span><span class="nx">text</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="s1">'This is client-side Javascript, creating a PDF.'</span><span class="p">);</span>
<span class="nx">doc</span><span class="p">.</span><span class="nx">addPage</span><span class="p">();</span>
<span class="nx">doc</span><span class="p">.</span><span class="nx">text</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="s1">'Do you like that?'</span><span class="p">);</span>
<span class="nx">doc</span><span class="p">.</span><span class="nx">save</span><span class="p">(</span><span class="s1">'Test.pdf'</span><span class="p">);</span>
</pre></div>
<h2>Credits</h2>
<p>Big thanks to Daniel Dotsenko from <a href="http://willow-systems.com">Willow Systems Corporation</a> for making huge contributions to the codebase. </p>
<p>Thanks to Ajaxian.com for <a href="http://ajaxian.com/archives/dynamically-generic-pdfs-with-javascript">featuring us back in 2009</a>.</p>
<p>Everyone else that's contributed patches or bug reports. You rock.</p>
<h2>License</h2>
<p>(MIT License)</p>
<p>Copyright (c) 2010-2012 James Hall, <a href="https://github.com/MrRio/jsPDF">https://github.com/MrRio/jsPDF</a></p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:</p>
<p>The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
</section>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<footer class="inner">
<p class="copyright">jsPDF maintained by <a href="https://github.com/MrRio">MrRio</a></p>
<p>Published with <a href="http://pages.github.com">GitHub Pages</a></p>
</footer>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-32767308-2");
pageTracker._trackPageview();
} catch(err) {}
</script>
</body>
</html>