Skip to content

Commit c8f9528

Browse files
committed
1 parent 225d527 commit c8f9528

1 file changed

Lines changed: 46 additions & 49 deletions

File tree

examples/basic.html

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<title>jsPDF</title>
55

6-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
77
<link rel="stylesheet" type="text/css" href="css/smoothness/jquery-ui-1.8.17.custom.css">
88
<link rel="stylesheet" type="text/css" href="css/main.css">
99

@@ -12,7 +12,7 @@
1212
<script type="text/javascript" src="../jspdf.js"></script>
1313
<script type="text/javascript" src="../libs/Deflate/adler32cs.js"></script>
1414
<script type="text/javascript" src="../libs/FileSaver.js/FileSaver.js"></script>
15-
<script type="text/javascript" src="../libs/Blob.js/BlobBuilder.js"></script>
15+
<script type="text/javascript" src="../libs/Blob.js/Blob.js"></script>
1616
<script type="text/javascript" src="../libs/async/lib/async.js"></script>
1717

1818
<script type="text/javascript" src="../jspdf.plugin.addimage.js"></script>
@@ -23,7 +23,7 @@
2323
<script type="text/javascript" src="../jspdf.plugin.cell.js"></script>
2424
<script type="text/javascript" src="../jspdf.plugin.from_html.js"></script>
2525
<script type="text/javascript" src="js/basic.js"></script>
26-
26+
2727
<script>
2828
$(function() {
2929
$("#accordion-basic, #accordion-text, #accordion-graphic").accordion({
@@ -79,7 +79,7 @@ <h2><a href="#">Adding metadata</a></h2>
7979
// Optional - set properties on the document
8080
doc.setProperties({
8181
title: 'Title',
82-
subject: 'This is the subject',
82+
subject: 'This is the subject',
8383
author: 'James Hall',
8484
keywords: 'generated, javascript, web 2.0, ajax',
8585
creator: 'MEEE'
@@ -95,7 +95,7 @@ <h2><a href="#">Example of user input</a></h2>
9595
multiplier = parseInt(multiplier);
9696

9797
var doc = new jsPDF();
98-
doc.setFontSize(22);
98+
doc.setFontSize(22);
9999
doc.text(20, 20, 'Questions');
100100
doc.setFontSize(16);
101101
doc.text(20, 30, 'This belongs to: ' + name);
@@ -111,13 +111,12 @@ <h2><a href="#">Example of user input</a></h2>
111111

112112
for(var i = 1; i <= 12; i ++) {
113113
doc.text(20, 30 + (i * 10), i + ' x ' + multiplier + ' = ' + (i * multiplier));
114-
}
114+
}
115115
doc.save('Test.pdf');</pre>
116116
<a href="javascript:demoUserInput()" class="button">Run Code</a></p></div>
117117
</div>
118118
</div>
119-
120-
119+
121120
<div id="tabs-text">
122121
<div id="accordion-text">
123122
<h2><a href="#">Different font sizes</a></h2>
@@ -126,32 +125,32 @@ <h2><a href="#">Different font sizes</a></h2>
126125
doc.text(20, 20, 'This is a title');
127126

128127
doc.setFontSize(16);
129-
doc.text(20, 30, 'This is some normal sized text underneath.');
128+
doc.text(20, 30, 'This is some normal sized text underneath.');
130129

131130
doc.save('Test.pdf');</pre>
132131
<a href="javascript:demoFontSizes()" class="button">Run Code</a>
133132
</p></div>
134133

135134
<h2><a href="#">Different font types</a></h2>
136135
<div><p><pre>var doc = new jsPDF();
137-
136+
138137
doc.text(20, 20, 'This is the default font.');
139-
138+
140139
doc.setFont("courier");
141140
doc.text(20, 30, 'This is courier normal.');
142-
141+
143142
doc.setFont("times");
144143
doc.setFontType("italic");
145144
doc.text(20, 40, 'This is times italic.');
146-
145+
147146
doc.setFont("helvetica");
148147
doc.setFontType("bold");
149148
doc.text(20, 50, 'This is helvetica bold.');
150-
149+
151150
doc.setFont("courier");
152151
doc.setFontType("bolditalic");
153152
doc.text(20, 60, 'This is courier bolditalic.');
154-
153+
155154
doc.save('Test.pdf');</pre>
156155
<a href="javascript:demoFontTypes()" class="button">Run Code</a></p></div>
157156

@@ -160,19 +159,19 @@ <h2><a href="#">Different text colors</a></h2>
160159

161160
doc.setTextColor(100);
162161
doc.text(20, 20, 'This is gray.');
163-
162+
164163
doc.setTextColor(150);
165-
doc.text(20, 30, 'This is light gray.');
166-
164+
doc.text(20, 30, 'This is light gray.');
165+
167166
doc.setTextColor(255,0,0);
168167
doc.text(20, 40, 'This is red.');
169-
168+
170169
doc.setTextColor(0,255,0);
171170
doc.text(20, 50, 'This is green.');
172-
171+
173172
doc.setTextColor(0,0,255);
174173
doc.text(20, 60, 'This is blue.');
175-
174+
176175
doc.save('Test.pdf');</pre>
177176
<a href="javascript:demoTextColors()" class="button">Run Code</a></p></div>
178177

@@ -250,41 +249,41 @@ <h2></h2>
250249
<thead>
251250
<tr>
252251
<th>
253-
Heading1
252+
Heading1
254253
</th>
255254
<th>
256-
Heading2
255+
Heading2
257256
</th>
258257
</tr>
259258
</thead>
260259
<tbody>
261260
<tr>
262261
<td>
263-
cell 1,1
262+
cell 1,1
264263
</td>
265264
<td>
266265
cell 1,2
267266
</td>
268267
</tr>
269268
<tr>
270269
<td>
271-
cell 2,1
270+
cell 2,1
272271
</td>
273272
<td>
274273
cell 2,2
275274
</td>
276275
</tr>
277276
<tr>
278277
<td>
279-
cell 3,1
278+
cell 3,1
280279
</td>
281280
<td>
282281
cell 3,2
283282
</td>
284283
</tr>
285284
<tr>
286285
<td>
287-
cell 4,1
286+
cell 4,1
288287
</td>
289288
<td>
290289
cell 4,2
@@ -299,9 +298,9 @@ <h2></h2>
299298
// to an actual DOM element from which the text will be scraped.
300299
, source = $('#fromHTMLtestdiv')[0]
301300

302-
// we support special element handlers. Register them with jQuery-style
301+
// we support special element handlers. Register them with jQuery-style
303302
// ID selector for either ID or node name. ("#iAmID", "div", "span" etc.)
304-
// There is no support for any other type of selectors
303+
// There is no support for any other type of selectors
305304
// (class, of compound) at this time.
306305
, specialElementHandlers = {
307306
// element with id of "bypass" - jQuery style selector
@@ -328,7 +327,7 @@ <h2></h2>
328327
, 'elementHandlers': specialElementHandlers
329328
},
330329
function (dispose) {
331-
// dispose: object with X, Y of the last line add to the PDF
330+
// dispose: object with X, Y of the last line add to the PDF
332331
// this allow the insertion of new lines after html
333332
pdf.save('Test.pdf');
334333
},
@@ -340,8 +339,7 @@ <h2></h2>
340339

341340
</div>
342341
</div>
343-
344-
342+
345343
<div id="tabs-graphic">
346344
<div id="accordion-graphic">
347345
<h2><a href="#">Draw example: rectangles / squares</a></h2>
@@ -350,17 +348,17 @@ <h2><a href="#">Draw example: rectangles / squares</a></h2>
350348
doc.rect(20, 20, 10, 10); // empty square
351349

352350
doc.rect(40, 20, 10, 10, 'F'); // filled square
353-
351+
354352
doc.setDrawColor(255,0,0);
355353
doc.rect(60, 20, 10, 10); // empty red square
356-
354+
357355
doc.setDrawColor(255,0,0);
358356
doc.rect(80, 20, 10, 10, 'FD'); // filled square with red borders
359-
357+
360358
doc.setDrawColor(0);
361359
doc.setFillColor(255,0,0);
362360
doc.rect(100, 20, 10, 10, 'F'); // filled red square
363-
361+
364362
doc.setDrawColor(0);
365363
doc.setFillColor(255,0,0);
366364
doc.rect(120, 20, 10, 10, 'FD'); // filled red square with black borders
@@ -369,38 +367,37 @@ <h2><a href="#">Draw example: rectangles / squares</a></h2>
369367
doc.setFillColor(255, 255, 255);
370368
doc.roundedRect(140, 20, 10, 10, 3, 3, 'FD'); // Black sqaure with rounded corners
371369

372-
373370
doc.save('Test.pdf');</pre>
374371
<a href="javascript:demoRectangles()" class="button">Run Code</a></p></div>
375372

376373
<h2><a href="#">Draw example: lines</a></h2>
377374
<div><p><pre>var doc = new jsPDF();
378375

379376
doc.line(20, 20, 60, 20); // horizontal line
380-
377+
381378
doc.setLineWidth(0.5);
382379
doc.line(20, 25, 60, 25);
383-
380+
384381
doc.setLineWidth(1);
385382
doc.line(20, 30, 60, 30);
386-
383+
387384
doc.setLineWidth(1.5);
388385
doc.line(20, 35, 60, 35);
389-
386+
390387
doc.setDrawColor(255,0,0); // draw red lines
391-
388+
392389
doc.setLineWidth(0.1);
393390
doc.line(100, 20, 100, 60); // vertical line
394-
391+
395392
doc.setLineWidth(0.5);
396393
doc.line(105, 20, 105, 60);
397-
394+
398395
doc.setLineWidth(1);
399396
doc.line(110, 20, 110, 60);
400-
397+
401398
doc.setLineWidth(1.5);
402399
doc.line(115, 20, 115, 60);
403-
400+
404401
doc.save('Test.pdf');</pre>
405402
<a href="javascript:demoLines()" class="button">Run Code</a></p></div>
406403

@@ -411,7 +408,7 @@ <h2><a href="#">Draw example: circles and ellipses</a></h2>
411408

412409
doc.setFillColor(0,0,255);
413410
doc.ellipse(80, 20, 10, 5, 'F');
414-
411+
415412
doc.setLineWidth(1);
416413
doc.setDrawColor(0);
417414
doc.setFillColor(255,0,0);
@@ -429,7 +426,7 @@ <h2><a href="#">Draw example: triangles</a></h2>
429426
doc.setDrawColor(255,0,0);
430427
doc.setFillColor(0,0,255);
431428
doc.triangle(100, 100, 110, 100, 120, 130, 'FD');
432-
429+
433430
doc.save('My file.pdf');</pre>
434431
<a href="javascript:demoTriangles()" class="button">Run Code</a></p></div>
435432

@@ -441,7 +438,7 @@ <h2><a href="#">Draw example: Images</a></h2>
441438
// to temporarily get around this issue.
442439
var getImageFromUrl = function(url, callback) {
443440
var img = new Image, data, ret={data: null, pending: true};
444-
441+
445442
img.onError = function() {
446443
throw new Error('Cannot load image: "'+url+'"');
447444
}

0 commit comments

Comments
 (0)