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
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 >
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
8080doc.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>
9595multiplier = parseInt(multiplier);
9696
9797var doc = new jsPDF();
98- doc.setFontSize(22);
98+ doc.setFontSize(22);
9999doc.text(20, 20, 'Questions');
100100doc.setFontSize(16);
101101doc.text(20, 30, 'This belongs to: ' + name);
@@ -111,13 +111,12 @@ <h2><a href="#">Example of user input</a></h2>
111111
112112for(var i = 1; i < = 12; i ++) {
113113 doc.text(20, 30 + (i * 10), i + ' x ' + multiplier + ' = ' + (i * multiplier));
114- }
114+ }
115115doc.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>
126125doc.text(20, 20, 'This is a title');
127126
128127doc.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
131130doc.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+
138137doc.text(20, 20, 'This is the default font.');
139-
138+
140139doc.setFont("courier");
141140doc.text(20, 30, 'This is courier normal.');
142-
141+
143142doc.setFont("times");
144143doc.setFontType("italic");
145144doc.text(20, 40, 'This is times italic.');
146-
145+
147146doc.setFont("helvetica");
148147doc.setFontType("bold");
149148doc.text(20, 50, 'This is helvetica bold.');
150-
149+
151150doc.setFont("courier");
152151doc.setFontType("bolditalic");
153152doc.text(20, 60, 'This is courier bolditalic.');
154-
153+
155154doc.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
161160doc.setTextColor(100);
162161doc.text(20, 20, 'This is gray.');
163-
162+
164163doc.setTextColor(150);
165- doc.text(20, 30, 'This is light gray.');
166-
164+ doc.text(20, 30, 'This is light gray.');
165+
167166doc.setTextColor(255,0,0);
168167doc.text(20, 40, 'This is red.');
169-
168+
170169doc.setTextColor(0,255,0);
171170doc.text(20, 50, 'This is green.');
172-
171+
173172doc.setTextColor(0,0,255);
174173doc.text(20, 60, 'This is blue.');
175-
174+
176175doc.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>
350348doc.rect(20, 20, 10, 10); // empty square
351349
352350doc.rect(40, 20, 10, 10, 'F'); // filled square
353-
351+
354352doc.setDrawColor(255,0,0);
355353doc.rect(60, 20, 10, 10); // empty red square
356-
354+
357355doc.setDrawColor(255,0,0);
358356doc.rect(80, 20, 10, 10, 'FD'); // filled square with red borders
359-
357+
360358doc.setDrawColor(0);
361359doc.setFillColor(255,0,0);
362360doc.rect(100, 20, 10, 10, 'F'); // filled red square
363-
361+
364362doc.setDrawColor(0);
365363doc.setFillColor(255,0,0);
366364doc.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>
369367doc.setFillColor(255, 255, 255);
370368doc.roundedRect(140, 20, 10, 10, 3, 3, 'FD'); // Black sqaure with rounded corners
371369
372-
373370doc.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
379376doc.line(20, 20, 60, 20); // horizontal line
380-
377+
381378doc.setLineWidth(0.5);
382379doc.line(20, 25, 60, 25);
383-
380+
384381doc.setLineWidth(1);
385382doc.line(20, 30, 60, 30);
386-
383+
387384doc.setLineWidth(1.5);
388385doc.line(20, 35, 60, 35);
389-
386+
390387doc.setDrawColor(255,0,0); // draw red lines
391-
388+
392389doc.setLineWidth(0.1);
393390doc.line(100, 20, 100, 60); // vertical line
394-
391+
395392doc.setLineWidth(0.5);
396393doc.line(105, 20, 105, 60);
397-
394+
398395doc.setLineWidth(1);
399396doc.line(110, 20, 110, 60);
400-
397+
401398doc.setLineWidth(1.5);
402399doc.line(115, 20, 115, 60);
403-
400+
404401doc.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
412409doc.setFillColor(0,0,255);
413410doc.ellipse(80, 20, 10, 5, 'F');
414-
411+
415412doc.setLineWidth(1);
416413doc.setDrawColor(0);
417414doc.setFillColor(255,0,0);
@@ -429,7 +426,7 @@ <h2><a href="#">Draw example: triangles</a></h2>
429426doc.setDrawColor(255,0,0);
430427doc.setFillColor(0,0,255);
431428doc.triangle(100, 100, 110, 100, 120, 130, 'FD');
432-
429+
433430doc.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.
442439var 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