jsPDF.html 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="JsDoc Toolkit" />
  7. <title>JsDoc Reference - jsPDF</title>
  8. <style type="text/css">
  9. /* default.css */
  10. body
  11. {
  12. font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
  13. width: 800px;
  14. }
  15. .header
  16. {
  17. clear: both;
  18. background-color: #ccc;
  19. padding: 8px;
  20. }
  21. h1
  22. {
  23. font-size: 150%;
  24. font-weight: bold;
  25. padding: 0;
  26. margin: 1em 0 0 .3em;
  27. }
  28. hr
  29. {
  30. border: none 0;
  31. border-top: 1px solid #7F8FB1;
  32. height: 1px;
  33. }
  34. pre.code
  35. {
  36. display: block;
  37. padding: 8px;
  38. border: 1px dashed #ccc;
  39. }
  40. #index
  41. {
  42. margin-top: 24px;
  43. float: left;
  44. width: 160px;
  45. position: absolute;
  46. left: 8px;
  47. background-color: #F3F3F3;
  48. padding: 8px;
  49. }
  50. #content
  51. {
  52. margin-left: 190px;
  53. width: 600px;
  54. }
  55. .classList
  56. {
  57. list-style-type: none;
  58. padding: 0;
  59. margin: 0 0 0 8px;
  60. font-family: arial, sans-serif;
  61. font-size: 1em;
  62. overflow: auto;
  63. }
  64. .classList li
  65. {
  66. padding: 0;
  67. margin: 0 0 8px 0;
  68. }
  69. .summaryTable { width: 100%; }
  70. h1.classTitle
  71. {
  72. font-size:170%;
  73. line-height:130%;
  74. }
  75. h2 { font-size: 110%; }
  76. caption, div.sectionTitle
  77. {
  78. background-color: #7F8FB1;
  79. color: #fff;
  80. font-size:130%;
  81. text-align: left;
  82. padding: 2px 6px 2px 6px;
  83. border: 1px #7F8FB1 solid;
  84. }
  85. div.sectionTitle { margin-bottom: 8px; }
  86. .summaryTable thead { display: none; }
  87. .summaryTable td
  88. {
  89. vertical-align: top;
  90. padding: 4px;
  91. border-bottom: 1px #7F8FB1 solid;
  92. border-right: 1px #7F8FB1 solid;
  93. }
  94. /*col#summaryAttributes {}*/
  95. .summaryTable td.attributes
  96. {
  97. border-left: 1px #7F8FB1 solid;
  98. width: 140px;
  99. text-align: right;
  100. }
  101. td.attributes, .fixedFont
  102. {
  103. line-height: 15px;
  104. color: #002EBE;
  105. font-family: "Courier New",Courier,monospace;
  106. font-size: 13px;
  107. }
  108. .summaryTable td.nameDescription
  109. {
  110. text-align: left;
  111. font-size: 13px;
  112. line-height: 15px;
  113. }
  114. .summaryTable td.nameDescription, .description
  115. {
  116. line-height: 15px;
  117. padding: 4px;
  118. padding-left: 4px;
  119. }
  120. .summaryTable { margin-bottom: 8px; }
  121. ul.inheritsList
  122. {
  123. list-style: square;
  124. margin-left: 20px;
  125. padding-left: 0;
  126. }
  127. .detailList {
  128. margin-left: 20px;
  129. line-height: 15px;
  130. }
  131. .detailList dt { margin-left: 20px; }
  132. .detailList .heading
  133. {
  134. font-weight: bold;
  135. padding-bottom: 6px;
  136. margin-left: 0;
  137. }
  138. .light, td.attributes, .light a:link, .light a:visited
  139. {
  140. color: #777;
  141. font-style: italic;
  142. }
  143. .fineprint
  144. {
  145. text-align: right;
  146. font-size: 10px;
  147. }
  148. </style>
  149. </head>
  150. <body>
  151. <!-- ============================== header ================================= -->
  152. <!-- begin static/header.html -->
  153. <div id="header">
  154. </div>
  155. <!-- end static/header.html -->
  156. <!-- ============================== classes index ============================ -->
  157. <div id="index">
  158. <!-- begin publish.classesIndex -->
  159. <div align="center"><a href="../index.html">Class Index</a>
  160. | <a href="../files.html">File Index</a></div>
  161. <hr />
  162. <h2>Classes</h2>
  163. <ul class="classList">
  164. <li><i><a href="../symbols/_global_.html">_global_</a></i></li>
  165. <li><a href="../symbols/FontObject.html">FontObject</a></li>
  166. <li><a href="../symbols/jsPDF.html">jsPDF</a></li>
  167. <li><a href="../symbols/PubSub.html">PubSub</a></li>
  168. </ul>
  169. <hr />
  170. <!-- end publish.classesIndex -->
  171. </div>
  172. <div id="content">
  173. <!-- ============================== class title ============================ -->
  174. <h1 class="classTitle">
  175. Class jsPDF
  176. </h1>
  177. <!-- ============================== class summary ========================== -->
  178. <p class="description">
  179. <br /><i>Defined in: </i> <a href="../symbols/src/c__work_jsPDF_jspdf.js.html">jspdf.js</a>.
  180. </p>
  181. <!-- ============================== constructor summary ==================== -->
  182. <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jsPDF.">
  183. <caption>Class Summary</caption>
  184. <thead>
  185. <tr>
  186. <th scope="col">Constructor Attributes</th>
  187. <th scope="col">Constructor Name and Description</th>
  188. </tr>
  189. </thead>
  190. <tbody>
  191. <tr>
  192. <td class="attributes">&nbsp;</td>
  193. <td class="nameDescription" >
  194. <div class="fixedFont">
  195. <b><a href="../symbols/jsPDF.html#constructor">jsPDF</a></b>(orientation, unit, format)
  196. </div>
  197. <div class="description">Creates new jsPDF document object instance</div>
  198. </td>
  199. </tr>
  200. </tbody>
  201. </table>
  202. <!-- ============================== properties summary ===================== -->
  203. <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class jsPDF.">
  204. <caption>Field Summary</caption>
  205. <thead>
  206. <tr>
  207. <th scope="col">Field Attributes</th>
  208. <th scope="col">Field Name and Description</th>
  209. </tr>
  210. </thead>
  211. <tbody>
  212. <tr>
  213. <td class="attributes">&nbsp;</td>
  214. <td class="nameDescription">
  215. <div class="fixedFont">
  216. jsPDF.<b><a href="../symbols/jsPDF.html#.API">API</a></b>
  217. </div>
  218. <div class="description">jsPDF.API is a STATIC property of jsPDF class.</div>
  219. </td>
  220. </tr>
  221. <tr>
  222. <td class="attributes">&nbsp;</td>
  223. <td class="nameDescription">
  224. <div class="fixedFont">
  225. <b><a href="../symbols/jsPDF.html#CapJoinStyles">CapJoinStyles</a></b>
  226. </div>
  227. <div class="description">Is an Object providing a mapping from human-readable to
  228. integer flag values designating the varieties of line cap
  229. and join styles.</div>
  230. </td>
  231. </tr>
  232. </tbody>
  233. </table>
  234. <!-- ============================== methods summary ======================== -->
  235. <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jsPDF.">
  236. <caption>Method Summary</caption>
  237. <thead>
  238. <tr>
  239. <th scope="col">Method Attributes</th>
  240. <th scope="col">Method Name and Description</th>
  241. </tr>
  242. </thead>
  243. <tbody>
  244. <tr>
  245. <td class="attributes">&nbsp;</td>
  246. <td class="nameDescription">
  247. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#addPage">addPage</a></b>()
  248. </div>
  249. <div class="description">Adds (and transfers the focus to) new page to the PDF document.</div>
  250. </td>
  251. </tr>
  252. <tr>
  253. <td class="attributes">&nbsp;</td>
  254. <td class="nameDescription">
  255. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#circle">circle</a></b>(x, y, r, style)
  256. </div>
  257. <div class="description">Adds an circle to PDF</div>
  258. </td>
  259. </tr>
  260. <tr>
  261. <td class="attributes">&nbsp;</td>
  262. <td class="nameDescription">
  263. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#ellipse">ellipse</a></b>(x, y, rx, rx, style)
  264. </div>
  265. <div class="description">Adds an ellipse to PDF</div>
  266. </td>
  267. </tr>
  268. <tr>
  269. <td class="attributes">&nbsp;</td>
  270. <td class="nameDescription">
  271. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#getFontList">getFontList</a></b>()
  272. </div>
  273. <div class="description">Returns an object - a tree of fontName to fontStyle relationships available to
  274. active PDF document.</div>
  275. </td>
  276. </tr>
  277. <tr>
  278. <td class="attributes">&nbsp;</td>
  279. <td class="nameDescription">
  280. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#lines">lines</a></b>(lines, x, y, scale)
  281. </div>
  282. <div class="description">Adds series of curves (straight lines or cubic bezier curves) to canvas, starting at `x`, `y` coordinates.</div>
  283. </td>
  284. </tr>
  285. <tr>
  286. <td class="attributes">&nbsp;</td>
  287. <td class="nameDescription">
  288. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#output">output</a></b>(type, options)
  289. </div>
  290. <div class="description">Generates the PDF document.</div>
  291. </td>
  292. </tr>
  293. <tr>
  294. <td class="attributes">&nbsp;</td>
  295. <td class="nameDescription">
  296. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#rect">rect</a></b>(x, y, w, h, style)
  297. </div>
  298. <div class="description">Adds a rectangle to PDF</div>
  299. </td>
  300. </tr>
  301. <tr>
  302. <td class="attributes">&nbsp;</td>
  303. <td class="nameDescription">
  304. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#setDrawColor">setDrawColor</a></b>(ch1, ch2, ch3, ch4)
  305. </div>
  306. <div class="description">Sets the stroke color for upcoming elements.</div>
  307. </td>
  308. </tr>
  309. <tr>
  310. <td class="attributes">&nbsp;</td>
  311. <td class="nameDescription">
  312. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#setFillColor">setFillColor</a></b>(ch1, ch2, ch3, ch4)
  313. </div>
  314. <div class="description">Sets the fill color for upcoming elements.</div>
  315. </td>
  316. </tr>
  317. <tr>
  318. <td class="attributes">&nbsp;</td>
  319. <td class="nameDescription">
  320. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#setFont">setFont</a></b>(fontName, fontStyle)
  321. </div>
  322. <div class="description">Sets text font face, variant for upcoming text elements.</div>
  323. </td>
  324. </tr>
  325. <tr>
  326. <td class="attributes">&nbsp;</td>
  327. <td class="nameDescription">
  328. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#setFontSize">setFontSize</a></b>(size)
  329. </div>
  330. <div class="description">Sets font size for upcoming text elements.</div>
  331. </td>
  332. </tr>
  333. <tr>
  334. <td class="attributes">&nbsp;</td>
  335. <td class="nameDescription">
  336. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#setFontStyle">setFontStyle</a></b>(style)
  337. </div>
  338. <div class="description">Switches font style or variant for upcoming text elements,
  339. while keeping the font face or family same.</div>
  340. </td>
  341. </tr>
  342. <tr>
  343. <td class="attributes">&nbsp;</td>
  344. <td class="nameDescription">
  345. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#setLineCap">setLineCap</a></b>(style)
  346. </div>
  347. <div class="description">Sets the line cap styles
  348. See {jsPDF.CapJoinStyles} for variants</div>
  349. </td>
  350. </tr>
  351. <tr>
  352. <td class="attributes">&nbsp;</td>
  353. <td class="nameDescription">
  354. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#setLineJoin">setLineJoin</a></b>(style)
  355. </div>
  356. <div class="description">Sets the line join styles
  357. See {jsPDF.CapJoinStyles} for variants</div>
  358. </td>
  359. </tr>
  360. <tr>
  361. <td class="attributes">&nbsp;</td>
  362. <td class="nameDescription">
  363. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#setLineWidth">setLineWidth</a></b>(width)
  364. </div>
  365. <div class="description">Sets line width for upcoming lines.</div>
  366. </td>
  367. </tr>
  368. <tr>
  369. <td class="attributes">&nbsp;</td>
  370. <td class="nameDescription">
  371. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#setProperties">setProperties</a></b>(A)
  372. </div>
  373. <div class="description">Adds a properties to the PDF document</div>
  374. </td>
  375. </tr>
  376. <tr>
  377. <td class="attributes">&nbsp;</td>
  378. <td class="nameDescription">
  379. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#setTextColor">setTextColor</a></b>(r, g, b)
  380. </div>
  381. <div class="description">Sets the text color for upcoming elements.</div>
  382. </td>
  383. </tr>
  384. <tr>
  385. <td class="attributes">&nbsp;</td>
  386. <td class="nameDescription">
  387. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#text">text</a></b>(text, x, y, flags)
  388. </div>
  389. <div class="description">Adds text to page.</div>
  390. </td>
  391. </tr>
  392. <tr>
  393. <td class="attributes">&nbsp;</td>
  394. <td class="nameDescription">
  395. <div class="fixedFont"><b><a href="../symbols/jsPDF.html#triangle">triangle</a></b>(x1, y1, x2, y2, x3, y3, style)
  396. </div>
  397. <div class="description">Adds a triangle to PDF</div>
  398. </td>
  399. </tr>
  400. </tbody>
  401. </table>
  402. <!-- ============================== events summary ======================== -->
  403. <!-- ============================== constructor details ==================== -->
  404. <div class="details"><a name="constructor"> </a>
  405. <div class="sectionTitle">
  406. Class Detail
  407. </div>
  408. <div class="fixedFont">
  409. <b>jsPDF</b>(orientation, unit, format)
  410. </div>
  411. <div class="description">
  412. Creates new jsPDF document object instance
  413. </div>
  414. <dl class="detailList">
  415. <dt class="heading">Parameters:</dt>
  416. <dt>
  417. <b>orientation</b>
  418. </dt>
  419. <dd>One of "portrait" or "landscape" (or shortcuts "p" (Default), "l")</dd>
  420. <dt>
  421. <b>unit</b>
  422. </dt>
  423. <dd>Measurement unit to be used when coordinates are specified. One of "pt" (points), "mm" (Default), "cm", "in"</dd>
  424. <dt>
  425. <b>format</b>
  426. </dt>
  427. <dd>One of 'a3', 'a4' (Default),'a5' ,'letter' ,'legal'</dd>
  428. </dl>
  429. <dl class="detailList">
  430. <dt class="heading">Returns:</dt>
  431. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  432. </dl>
  433. </div>
  434. <!-- ============================== field details ========================== -->
  435. <div class="sectionTitle">
  436. Field Detail
  437. </div>
  438. <a name=".API"> </a>
  439. <div class="fixedFont">
  440. <span class="light">jsPDF.</span><b>API</b>
  441. </div>
  442. <div class="description">
  443. jsPDF.API is a STATIC property of jsPDF class.
  444. jsPDF.API is an object you can add methods and properties to.
  445. The methods / properties you add will show up in new jsPDF objects.
  446. One property is prepopulated. It is the 'events' Object. Plugin authors can add topics, callbacks to this object. These will be reassigned to all new instances of jsPDF.
  447. Examples:
  448. jsPDF.API.events['initialized'] = function(){ 'this' is API object }
  449. jsPDF.API.events['addFont'] = function(added_font_object){ 'this' is API object }
  450. </div>
  451. <pre class="code"> jsPDF.API.mymethod = function(){
  452. // 'this' will be ref to internal API object. see jsPDF source
  453. // , so you can refer to built-in methods like so:
  454. // this.line(....)
  455. // this.text(....)
  456. }
  457. var pdfdoc = new jsPDF()
  458. pdfdoc.mymethod() // <- !!!!!!</pre>
  459. <hr />
  460. <a name="CapJoinStyles"> </a>
  461. <div class="fixedFont">
  462. <span class="light">{Object}</span>
  463. <b>CapJoinStyles</b>
  464. </div>
  465. <div class="description">
  466. Is an Object providing a mapping from human-readable to
  467. integer flag values designating the varieties of line cap
  468. and join styles.
  469. </div>
  470. <!-- ============================== method details ========================= -->
  471. <div class="sectionTitle">
  472. Method Detail
  473. </div>
  474. <a name="addPage"> </a>
  475. <div class="fixedFont">
  476. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  477. <b>addPage</b>()
  478. </div>
  479. <div class="description">
  480. Adds (and transfers the focus to) new page to the PDF document.
  481. </div>
  482. <dl class="detailList">
  483. <dt class="heading">Returns:</dt>
  484. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  485. </dl>
  486. <hr />
  487. <a name="circle"> </a>
  488. <div class="fixedFont">
  489. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  490. <b>circle</b>(x, y, r, style)
  491. </div>
  492. <div class="description">
  493. Adds an circle to PDF
  494. </div>
  495. <dl class="detailList">
  496. <dt class="heading">Parameters:</dt>
  497. <dt>
  498. <span class="light fixedFont">{Number}</span> <b>x</b>
  499. </dt>
  500. <dd>Coordinate (in units declared at inception of PDF document) against left edge of the page</dd>
  501. <dt>
  502. <span class="light fixedFont">{Number}</span> <b>y</b>
  503. </dt>
  504. <dd>Coordinate (in units declared at inception of PDF document) against upper edge of the page</dd>
  505. <dt>
  506. <span class="light fixedFont">{Number}</span> <b>r</b>
  507. </dt>
  508. <dd>Radius (in units declared at inception of PDF document)</dd>
  509. <dt>
  510. <span class="light fixedFont">{String}</span> <b>style</b>
  511. </dt>
  512. <dd>(Defaults to active fill/stroke style) A string signalling if stroke, fill or both are to be applied.</dd>
  513. </dl>
  514. <dl class="detailList">
  515. <dt class="heading">Returns:</dt>
  516. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  517. </dl>
  518. <hr />
  519. <a name="ellipse"> </a>
  520. <div class="fixedFont">
  521. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  522. <b>ellipse</b>(x, y, rx, rx, style)
  523. </div>
  524. <div class="description">
  525. Adds an ellipse to PDF
  526. </div>
  527. <dl class="detailList">
  528. <dt class="heading">Parameters:</dt>
  529. <dt>
  530. <span class="light fixedFont">{Number}</span> <b>x</b>
  531. </dt>
  532. <dd>Coordinate (in units declared at inception of PDF document) against left edge of the page</dd>
  533. <dt>
  534. <span class="light fixedFont">{Number}</span> <b>y</b>
  535. </dt>
  536. <dd>Coordinate (in units declared at inception of PDF document) against upper edge of the page</dd>
  537. <dt>
  538. <span class="light fixedFont">{Number}</span> <b>rx</b>
  539. </dt>
  540. <dd>Radius along x axis (in units declared at inception of PDF document)</dd>
  541. <dt>
  542. <span class="light fixedFont">{Number}</span> <b>rx</b>
  543. </dt>
  544. <dd>Radius along y axis (in units declared at inception of PDF document)</dd>
  545. <dt>
  546. <span class="light fixedFont">{String}</span> <b>style</b>
  547. </dt>
  548. <dd>(Defaults to active fill/stroke style) A string signalling if stroke, fill or both are to be applied.</dd>
  549. </dl>
  550. <dl class="detailList">
  551. <dt class="heading">Returns:</dt>
  552. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  553. </dl>
  554. <hr />
  555. <a name="getFontList"> </a>
  556. <div class="fixedFont">
  557. <span class="light">{Object}</span>
  558. <b>getFontList</b>()
  559. </div>
  560. <div class="description">
  561. Returns an object - a tree of fontName to fontStyle relationships available to
  562. active PDF document.
  563. </div>
  564. <dl class="detailList">
  565. <dt class="heading">Returns:</dt>
  566. <dd><span class="light fixedFont">{Object}</span> Like {'times':['normal', 'italic', ... ], 'arial':['normal', 'bold', ... ], ... }</dd>
  567. </dl>
  568. <hr />
  569. <a name="lines"> </a>
  570. <div class="fixedFont">
  571. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  572. <b>lines</b>(lines, x, y, scale)
  573. </div>
  574. <div class="description">
  575. Adds series of curves (straight lines or cubic bezier curves) to canvas, starting at `x`, `y` coordinates.
  576. All data points in `lines` are relative to last line origin.
  577. `x`, `y` become x1,y1 for first line / curve in the set.
  578. For lines you only need to specify [x2, y2] - (ending point) vector against x1, y1 starting point.
  579. For bezier curves you need to specify [x2,y2,x3,y3,x4,y4] - vectors to control points 1, 2, ending point. All vectors are against the start of the curve - x1,y1.
  580. </div>
  581. <pre class="code">.lines([[2,2],[-2,2],[1,1,2,2,3,3],[2,1]], 212,110, 10) // line, line, bezier curve, line</pre>
  582. <dl class="detailList">
  583. <dt class="heading">Parameters:</dt>
  584. <dt>
  585. <span class="light fixedFont">{Array}</span> <b>lines</b>
  586. </dt>
  587. <dd>Array of *vector* shifts as pairs (lines) or sextets (cubic bezier curves).</dd>
  588. <dt>
  589. <span class="light fixedFont">{Number}</span> <b>x</b>
  590. </dt>
  591. <dd>Coordinate (in units declared at inception of PDF document) against left edge of the page</dd>
  592. <dt>
  593. <span class="light fixedFont">{Number}</span> <b>y</b>
  594. </dt>
  595. <dd>Coordinate (in units declared at inception of PDF document) against upper edge of the page</dd>
  596. <dt>
  597. <span class="light fixedFont">{Number}</span> <b>scale</b>
  598. </dt>
  599. <dd>(Defaults to [1.0,1.0]) x,y Scaling factor for all vectors. Elements can be any floating number Sub-one makes drawing smaller. Over-one grows the drawing. Negative flips the direction.</dd>
  600. </dl>
  601. <dl class="detailList">
  602. <dt class="heading">Returns:</dt>
  603. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  604. </dl>
  605. <hr />
  606. <a name="output"> </a>
  607. <div class="fixedFont">
  608. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  609. <b>output</b>(type, options)
  610. </div>
  611. <div class="description">
  612. Generates the PDF document.
  613. Possible values:
  614. datauristring (alias dataurlstring) - Data-Url-formatted data returned as string.
  615. datauri (alias datauri) - Data-Url-formatted data pushed into current window's location (effectively reloading the window with contents of the PDF).
  616. If `type` argument is undefined, output is raw body of resulting PDF returned as a string.
  617. </div>
  618. <dl class="detailList">
  619. <dt class="heading">Parameters:</dt>
  620. <dt>
  621. <span class="light fixedFont">{String}</span> <b>type</b>
  622. </dt>
  623. <dd>A string identifying one of the possible output types.</dd>
  624. <dt>
  625. <span class="light fixedFont">{Object}</span> <b>options</b>
  626. </dt>
  627. <dd>An object providing some additional signalling to PDF generator.</dd>
  628. </dl>
  629. <dl class="detailList">
  630. <dt class="heading">Returns:</dt>
  631. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  632. </dl>
  633. <hr />
  634. <a name="rect"> </a>
  635. <div class="fixedFont">
  636. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  637. <b>rect</b>(x, y, w, h, style)
  638. </div>
  639. <div class="description">
  640. Adds a rectangle to PDF
  641. </div>
  642. <dl class="detailList">
  643. <dt class="heading">Parameters:</dt>
  644. <dt>
  645. <span class="light fixedFont">{Number}</span> <b>x</b>
  646. </dt>
  647. <dd>Coordinate (in units declared at inception of PDF document) against left edge of the page</dd>
  648. <dt>
  649. <span class="light fixedFont">{Number}</span> <b>y</b>
  650. </dt>
  651. <dd>Coordinate (in units declared at inception of PDF document) against upper edge of the page</dd>
  652. <dt>
  653. <span class="light fixedFont">{Number}</span> <b>w</b>
  654. </dt>
  655. <dd>Width (in units declared at inception of PDF document)</dd>
  656. <dt>
  657. <span class="light fixedFont">{Number}</span> <b>h</b>
  658. </dt>
  659. <dd>Height (in units declared at inception of PDF document)</dd>
  660. <dt>
  661. <span class="light fixedFont">{String}</span> <b>style</b>
  662. </dt>
  663. <dd>(Defaults to active fill/stroke style) A string signalling if stroke, fill or both are to be applied.</dd>
  664. </dl>
  665. <dl class="detailList">
  666. <dt class="heading">Returns:</dt>
  667. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  668. </dl>
  669. <hr />
  670. <a name="setDrawColor"> </a>
  671. <div class="fixedFont">
  672. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  673. <b>setDrawColor</b>(ch1, ch2, ch3, ch4)
  674. </div>
  675. <div class="description">
  676. Sets the stroke color for upcoming elements.
  677. Depending on the number of arguments given, Gray, RGB, or CMYK
  678. color space is implied.
  679. When only ch1 is given, "Gray" color space is implied and it
  680. must be a value in the range from 0.00 (solid black) to to 1.00 (white)
  681. if values are communicated as String types, or in range from 0 (black)
  682. to 255 (white) if communicated as Number type.
  683. The RGB-like 0-255 range is provided for backward compatibility.
  684. When only ch1,ch2,ch3 are given, "RGB" color space is implied and each
  685. value must be in the range from 0.00 (minimum intensity) to to 1.00
  686. (max intensity) if values are communicated as String types, or
  687. from 0 (min intensity) to to 255 (max intensity) if values are communicated
  688. as Number types.
  689. The RGB-like 0-255 range is provided for backward compatibility.
  690. When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each
  691. value must be a in the range from 0.00 (0% concentration) to to
  692. 1.00 (100% concentration)
  693. Because JavaScript treats fixed point numbers badly (rounds to
  694. floating point nearest to binary representation) it is highly advised to
  695. communicate the fractional numbers as String types, not JavaScript Number type.
  696. </div>
  697. <dl class="detailList">
  698. <dt class="heading">Parameters:</dt>
  699. <dt>
  700. <span class="light fixedFont">{Number|String}</span> <b>ch1</b>
  701. </dt>
  702. <dd>Color channel value</dd>
  703. <dt>
  704. <span class="light fixedFont">{Number|String}</span> <b>ch2</b>
  705. </dt>
  706. <dd>Color channel value</dd>
  707. <dt>
  708. <span class="light fixedFont">{Number|String}</span> <b>ch3</b>
  709. </dt>
  710. <dd>Color channel value</dd>
  711. <dt>
  712. <span class="light fixedFont">{Number|String}</span> <b>ch4</b>
  713. </dt>
  714. <dd>Color channel value</dd>
  715. </dl>
  716. <dl class="detailList">
  717. <dt class="heading">Returns:</dt>
  718. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  719. </dl>
  720. <hr />
  721. <a name="setFillColor"> </a>
  722. <div class="fixedFont">
  723. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  724. <b>setFillColor</b>(ch1, ch2, ch3, ch4)
  725. </div>
  726. <div class="description">
  727. Sets the fill color for upcoming elements.
  728. Depending on the number of arguments given, Gray, RGB, or CMYK
  729. color space is implied.
  730. When only ch1 is given, "Gray" color space is implied and it
  731. must be a value in the range from 0.00 (solid black) to to 1.00 (white)
  732. if values are communicated as String types, or in range from 0 (black)
  733. to 255 (white) if communicated as Number type.
  734. The RGB-like 0-255 range is provided for backward compatibility.
  735. When only ch1,ch2,ch3 are given, "RGB" color space is implied and each
  736. value must be in the range from 0.00 (minimum intensity) to to 1.00
  737. (max intensity) if values are communicated as String types, or
  738. from 0 (min intensity) to to 255 (max intensity) if values are communicated
  739. as Number types.
  740. The RGB-like 0-255 range is provided for backward compatibility.
  741. When ch1,ch2,ch3,ch4 are given, "CMYK" color space is implied and each
  742. value must be a in the range from 0.00 (0% concentration) to to
  743. 1.00 (100% concentration)
  744. Because JavaScript treats fixed point numbers badly (rounds to
  745. floating point nearest to binary representation) it is highly advised to
  746. communicate the fractional numbers as String types, not JavaScript Number type.
  747. </div>
  748. <dl class="detailList">
  749. <dt class="heading">Parameters:</dt>
  750. <dt>
  751. <span class="light fixedFont">{Number|String}</span> <b>ch1</b>
  752. </dt>
  753. <dd>Color channel value</dd>
  754. <dt>
  755. <span class="light fixedFont">{Number|String}</span> <b>ch2</b>
  756. </dt>
  757. <dd>Color channel value</dd>
  758. <dt>
  759. <span class="light fixedFont">{Number|String}</span> <b>ch3</b>
  760. </dt>
  761. <dd>Color channel value</dd>
  762. <dt>
  763. <span class="light fixedFont">{Number|String}</span> <b>ch4</b>
  764. </dt>
  765. <dd>Color channel value</dd>
  766. </dl>
  767. <dl class="detailList">
  768. <dt class="heading">Returns:</dt>
  769. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  770. </dl>
  771. <hr />
  772. <a name="setFont"> </a>
  773. <div class="fixedFont">
  774. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  775. <b>setFont</b>(fontName, fontStyle)
  776. </div>
  777. <div class="description">
  778. Sets text font face, variant for upcoming text elements.
  779. See output of jsPDF.getFontList() for possible font names, styles.
  780. </div>
  781. <dl class="detailList">
  782. <dt class="heading">Parameters:</dt>
  783. <dt>
  784. <span class="light fixedFont">{String}</span> <b>fontName</b>
  785. </dt>
  786. <dd>Font name or family. Example: "times"</dd>
  787. <dt>
  788. <span class="light fixedFont">{String}</span> <b>fontStyle</b>
  789. </dt>
  790. <dd>Font style or variant. Example: "italic"</dd>
  791. </dl>
  792. <dl class="detailList">
  793. <dt class="heading">Returns:</dt>
  794. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  795. </dl>
  796. <hr />
  797. <a name="setFontSize"> </a>
  798. <div class="fixedFont">
  799. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  800. <b>setFontSize</b>(size)
  801. </div>
  802. <div class="description">
  803. Sets font size for upcoming text elements.
  804. </div>
  805. <dl class="detailList">
  806. <dt class="heading">Parameters:</dt>
  807. <dt>
  808. <span class="light fixedFont">{Number}</span> <b>size</b>
  809. </dt>
  810. <dd>Font size in points.</dd>
  811. </dl>
  812. <dl class="detailList">
  813. <dt class="heading">Returns:</dt>
  814. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  815. </dl>
  816. <hr />
  817. <a name="setFontStyle"> </a>
  818. <div class="fixedFont">
  819. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  820. <b>setFontStyle</b>(style)
  821. </div>
  822. <div class="description">
  823. Switches font style or variant for upcoming text elements,
  824. while keeping the font face or family same.
  825. See output of jsPDF.getFontList() for possible font names, styles.
  826. </div>
  827. <dl class="detailList">
  828. <dt class="heading">Parameters:</dt>
  829. <dt>
  830. <span class="light fixedFont">{String}</span> <b>style</b>
  831. </dt>
  832. <dd>Font style or variant. Example: "italic"</dd>
  833. </dl>
  834. <dl class="detailList">
  835. <dt class="heading">Returns:</dt>
  836. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  837. </dl>
  838. <hr />
  839. <a name="setLineCap"> </a>
  840. <div class="fixedFont">
  841. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  842. <b>setLineCap</b>(style)
  843. </div>
  844. <div class="description">
  845. Sets the line cap styles
  846. See {jsPDF.CapJoinStyles} for variants
  847. </div>
  848. <dl class="detailList">
  849. <dt class="heading">Parameters:</dt>
  850. <dt>
  851. <span class="light fixedFont">{String|Number}</span> <b>style</b>
  852. </dt>
  853. <dd>A string or number identifying the type of line cap</dd>
  854. </dl>
  855. <dl class="detailList">
  856. <dt class="heading">Returns:</dt>
  857. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  858. </dl>
  859. <hr />
  860. <a name="setLineJoin"> </a>
  861. <div class="fixedFont">
  862. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  863. <b>setLineJoin</b>(style)
  864. </div>
  865. <div class="description">
  866. Sets the line join styles
  867. See {jsPDF.CapJoinStyles} for variants
  868. </div>
  869. <dl class="detailList">
  870. <dt class="heading">Parameters:</dt>
  871. <dt>
  872. <span class="light fixedFont">{String|Number}</span> <b>style</b>
  873. </dt>
  874. <dd>A string or number identifying the type of line join</dd>
  875. </dl>
  876. <dl class="detailList">
  877. <dt class="heading">Returns:</dt>
  878. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  879. </dl>
  880. <hr />
  881. <a name="setLineWidth"> </a>
  882. <div class="fixedFont">
  883. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  884. <b>setLineWidth</b>(width)
  885. </div>
  886. <div class="description">
  887. Sets line width for upcoming lines.
  888. </div>
  889. <dl class="detailList">
  890. <dt class="heading">Parameters:</dt>
  891. <dt>
  892. <span class="light fixedFont">{Number}</span> <b>width</b>
  893. </dt>
  894. <dd>Line width (in units declared at inception of PDF document)</dd>
  895. </dl>
  896. <dl class="detailList">
  897. <dt class="heading">Returns:</dt>
  898. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  899. </dl>
  900. <hr />
  901. <a name="setProperties"> </a>
  902. <div class="fixedFont">
  903. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  904. <b>setProperties</b>(A)
  905. </div>
  906. <div class="description">
  907. Adds a properties to the PDF document
  908. </div>
  909. <dl class="detailList">
  910. <dt class="heading">Parameters:</dt>
  911. <dt>
  912. <span class="light fixedFont">{Object}</span> <b>A</b>
  913. </dt>
  914. <dd>property_name-to-property_value object structure.</dd>
  915. </dl>
  916. <dl class="detailList">
  917. <dt class="heading">Returns:</dt>
  918. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  919. </dl>
  920. <hr />
  921. <a name="setTextColor"> </a>
  922. <div class="fixedFont">
  923. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  924. <b>setTextColor</b>(r, g, b)
  925. </div>
  926. <div class="description">
  927. Sets the text color for upcoming elements.
  928. If only one, first argument is given,
  929. treats the value as gray-scale color value.
  930. </div>
  931. <dl class="detailList">
  932. <dt class="heading">Parameters:</dt>
  933. <dt>
  934. <span class="light fixedFont">{Number}</span> <b>r</b>
  935. </dt>
  936. <dd>Red channel color value in range 0-255</dd>
  937. <dt>
  938. <span class="light fixedFont">{Number}</span> <b>g</b>
  939. </dt>
  940. <dd>Green channel color value in range 0-255</dd>
  941. <dt>
  942. <span class="light fixedFont">{Number}</span> <b>b</b>
  943. </dt>
  944. <dd>Blue channel color value in range 0-255</dd>
  945. </dl>
  946. <dl class="detailList">
  947. <dt class="heading">Returns:</dt>
  948. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  949. </dl>
  950. <hr />
  951. <a name="text"> </a>
  952. <div class="fixedFont">
  953. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  954. <b>text</b>(text, x, y, flags)
  955. </div>
  956. <div class="description">
  957. Adds text to page. Supports adding multiline text when 'text' argument is an Array of Strings.
  958. </div>
  959. <dl class="detailList">
  960. <dt class="heading">Parameters:</dt>
  961. <dt>
  962. <span class="light fixedFont">{String|Array}</span> <b>text</b>
  963. </dt>
  964. <dd>String or array of strings to be added to the page. Each line is shifted one line down per font, spacing settings declared before this call.</dd>
  965. <dt>
  966. <span class="light fixedFont">{Number}</span> <b>x</b>
  967. </dt>
  968. <dd>Coordinate (in units declared at inception of PDF document) against left edge of the page</dd>
  969. <dt>
  970. <span class="light fixedFont">{Number}</span> <b>y</b>
  971. </dt>
  972. <dd>Coordinate (in units declared at inception of PDF document) against upper edge of the page</dd>
  973. <dt>
  974. <span class="light fixedFont">{Object}</span> <b>flags</b>
  975. </dt>
  976. <dd>Collection of settings signalling how the text must be encoded. Defaults are sane. If you think you want to pass some flags, you likely can read the source.</dd>
  977. </dl>
  978. <dl class="detailList">
  979. <dt class="heading">Returns:</dt>
  980. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  981. </dl>
  982. <hr />
  983. <a name="triangle"> </a>
  984. <div class="fixedFont">
  985. <span class="light">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span>
  986. <b>triangle</b>(x1, y1, x2, y2, x3, y3, style)
  987. </div>
  988. <div class="description">
  989. Adds a triangle to PDF
  990. </div>
  991. <dl class="detailList">
  992. <dt class="heading">Parameters:</dt>
  993. <dt>
  994. <span class="light fixedFont">{Number}</span> <b>x1</b>
  995. </dt>
  996. <dd>Coordinate (in units declared at inception of PDF document) against left edge of the page</dd>
  997. <dt>
  998. <span class="light fixedFont">{Number}</span> <b>y1</b>
  999. </dt>
  1000. <dd>Coordinate (in units declared at inception of PDF document) against upper edge of the page</dd>
  1001. <dt>
  1002. <span class="light fixedFont">{Number}</span> <b>x2</b>
  1003. </dt>
  1004. <dd>Coordinate (in units declared at inception of PDF document) against left edge of the page</dd>
  1005. <dt>
  1006. <span class="light fixedFont">{Number}</span> <b>y2</b>
  1007. </dt>
  1008. <dd>Coordinate (in units declared at inception of PDF document) against upper edge of the page</dd>
  1009. <dt>
  1010. <span class="light fixedFont">{Number}</span> <b>x3</b>
  1011. </dt>
  1012. <dd>Coordinate (in units declared at inception of PDF document) against left edge of the page</dd>
  1013. <dt>
  1014. <span class="light fixedFont">{Number}</span> <b>y3</b>
  1015. </dt>
  1016. <dd>Coordinate (in units declared at inception of PDF document) against upper edge of the page</dd>
  1017. <dt>
  1018. <span class="light fixedFont">{String}</span> <b>style</b>
  1019. </dt>
  1020. <dd>(Defaults to active fill/stroke style) A string signalling if stroke, fill or both are to be applied.</dd>
  1021. </dl>
  1022. <dl class="detailList">
  1023. <dt class="heading">Returns:</dt>
  1024. <dd><span class="light fixedFont">{<a href="../symbols/jsPDF.html">jsPDF</a>}</span> </dd>
  1025. </dl>
  1026. <!-- ============================== event details ========================= -->
  1027. <hr />
  1028. </div>
  1029. <!-- ============================== footer ================================= -->
  1030. <div class="fineprint" style="clear:both">
  1031. Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Mon Oct 15 2012 22:41:49 GMT-0700 (PDT)
  1032. </div>
  1033. </body>
  1034. </html>