@@ -293,7 +293,7 @@ <h2></h2>
293293 </ tvody >
294294</ table >
295295</ div >
296- < div > < p > < pre > var pdf = new jsPDF('p','in', 'letter')
296+ < div > < p > < pre > var pdf = new jsPDF('p', 'pt', 'letter')
297297
298298// source can be HTML-formatted string, or a reference
299299// to an actual DOM element from which the text will be scraped.
@@ -310,29 +310,30 @@ <h2></h2>
310310 return true
311311 }
312312}
313+
313314margins = {
314- top: 80,
315- bottom: 60,
316- left: 40
317- width: 522
318- };
319- // all coords and widths are in jsPDF instance's declared units
320- // 'inches' in this case
315+ top: 80,
316+ bottom: 60,
317+ left: 40,
318+ width: 522
319+ };
320+ // all coords and widths are in jsPDF instance's declared units
321+ // 'inches' in this case
321322pdf.fromHTML(
322- source // HTML string or DOM elem ref.
323- , 0.5 // x coord
324- , 0.5 // y coord
325- , {
326- 'width':7.5 // max width of content on PDF
327- , 'elementHandlers': specialElementHandlers
328- },
329- function (dispose) - >
330- // dispose: object with X, Y of the last line add to the PDF
331- // this allow the insertion of new lines after html
332- pdf.save('Test.pdf');
333- ,
334- margins
335- )
323+ source // HTML string or DOM elem ref.
324+ , margins.left // x coord
325+ , margins.top // y coord
326+ , {
327+ 'width': margins.width // max width of content on PDF
328+ , 'elementHandlers': specialElementHandlers
329+ },
330+ function (dispose) {
331+ // dispose: object with X, Y of the last line add to the PDF
332+ // this allow the insertion of new lines after html
333+ pdf.save('Test.pdf');
334+ } ,
335+ margins
336+ )
336337
337338</ pre >
338339< botton onclick ="javascript:demoFromHTML() " class ="button "> Run Code</ buttom > </ p > </ div > </ div >
0 commit comments