apollodec/Apollo/bower_components/jsPDF/docs/global.html
2017-12-19 18:55:23 +05:30

5426 lines
70 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Global - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="jsPDF.html">jsPDF</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addFont">addFont</a></li><li><a href="global.html#addHTML">addHTML</a></li><li><a href="global.html#addMetadata">addMetadata</a></li><li><a href="global.html#addPage">addPage</a></li><li><a href="global.html#autoPrint">autoPrint</a></li><li><a href="global.html#CapJoinStyles">CapJoinStyles</a></li><li><a href="global.html#circle">circle</a></li><li><a href="global.html#ellipse">ellipse</a></li><li><a href="global.html#getFontList">getFontList</a></li><li><a href="global.html#lines">lines</a></li><li><a href="global.html#lstext">lstext</a></li><li><a href="global.html#output">output</a></li><li><a href="global.html#rect">rect</a></li><li><a href="global.html#roundedRect">roundedRect</a></li><li><a href="global.html#save">save</a></li><li><a href="global.html#setDisplayMode">setDisplayMode</a></li><li><a href="global.html#setDrawColor">setDrawColor</a></li><li><a href="global.html#setFillColor">setFillColor</a></li><li><a href="global.html#setFont">setFont</a></li><li><a href="global.html#setFontSize">setFontSize</a></li><li><a href="global.html#setFontStyle">setFontStyle</a></li><li><a href="global.html#setLineCap">setLineCap</a></li><li><a href="global.html#setLineJoin">setLineJoin</a></li><li><a href="global.html#setLineWidth">setLineWidth</a></li><li><a href="global.html#setPage">setPage</a></li><li><a href="global.html#setProperties">setProperties</a></li><li><a href="global.html#setTextColor">setTextColor</a></li><li><a href="global.html#text">text</a></li><li><a href="global.html#triangle">triangle</a></li></ul>
</nav>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2>
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="addHTML"><span class="type-signature"></span>addHTML<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="plugins_addhtml.js.html">plugins/addhtml.js</a>, <a href="plugins_addhtml.js.html#line12">line 12</a>
</li></ul></dd>
<dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li><p>This is being replace with a vector-supporting API. See
<a href="https://cdn.rawgit.com/MrRio/jsPDF/master/examples/html2pdf/showcase_supported_html.html">this link</a></p></li></ul></dd>
</dl>
<div class="description">
<p>Renders an HTML element to canvas object which added to the PDF</p>
<p>This feature requires <a href="https://github.com/niklasvh/html2canvas">html2canvas</a>
or <a href="https://github.com/cburgmer/rasterizeHTML.js">rasterizeHTML</a></p>
</div>
<h4 class="name" id="autoPrint"><span class="type-signature"></span>autoPrint<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="plugins_autoprint.js.html">plugins/autoprint.js</a>, <a href="plugins_autoprint.js.html#line8">line 8</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Makes the PDF automatically print. This works in Chrome, Firefox, Acrobat
Reader.</p>
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>var doc = new jsPDF()
doc.text(10, 10, 'This is a test')
doc.autoPrint()
doc.save('autoprint.pdf')</code></pre>
<h4 class="name" id="CapJoinStyles"><span class="type-signature"></span>CapJoinStyles<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line2109">line 2109</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Is an Object providing a mapping from human-readable to
integer flag values designating the varieties of line cap
and join styles.</p>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="addFont"><span class="type-signature"></span>addFont<span class="signature">(Postscript, Name, Font)</span><span class="type-signature"> &rarr; {fontKey}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1910">line 1910</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Add a custom font.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>Postscript</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>name of the Font. Example: &quot;Menlo-Regular&quot;</p></td>
</tr>
<tr>
<td class="name"><code>Name</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>of font-family from @font-face definition. Example: &quot;Menlo Regular&quot;</p></td>
</tr>
<tr>
<td class="name"><code>Font</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>style. Example: &quot;normal&quot;</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
<p>the (same as the internal method)</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">fontKey</span>
</dd>
</dl>
<h4 class="name" id="addMetadata"><span class="type-signature"></span>addMetadata<span class="signature">(metadata, namespaceuri)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="plugins_xmp_metadata.js.html">plugins/xmp_metadata.js</a>, <a href="plugins_xmp_metadata.js.html#line28">line 28</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds XMP formatted metadata to PDF</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>metadata</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>The actual metadata to be added. The metadata shall be stored as XMP simple value. Note that if the metadata string contains XML markup characters &quot;&lt;&quot;, &quot;&gt;&quot; or &quot;&amp;&quot;, those characters should be written using XML entities.</p></td>
</tr>
<tr>
<td class="name"><code>namespaceuri</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Sets the namespace URI for the metadata. Last character should be slash or hash.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="addPage"><span class="type-signature"></span>addPage<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1185">line 1185</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds (and transfers the focus to) new page to the PDF document.</p>
</div>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="circle"><span class="type-signature"></span>circle<span class="signature">(x, y, r, style)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1797">line 1797</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds an circle to PDF</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against left edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against upper edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>r</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Radius (in units declared at inception of PDF document)</p></td>
</tr>
<tr>
<td class="name"><code>style</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="ellipse"><span class="type-signature"></span>ellipse<span class="signature">(x, y, rx, rx, style)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1733">line 1733</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds an ellipse to PDF</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against left edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against upper edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>rx</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Radius along x axis (in units declared at inception of PDF document)</p></td>
</tr>
<tr>
<td class="name"><code>rx</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Radius along y axis (in units declared at inception of PDF document)</p></td>
</tr>
<tr>
<td class="name"><code>style</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="getFontList"><span class="type-signature"></span>getFontList<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1881">line 1881</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Returns an object - a tree of fontName to fontStyle relationships available to
active PDF document.</p>
</div>
<h5>Returns:</h5>
<div class="param-desc">
<p>Like {'times':['normal', 'italic', ... ], 'arial':['normal', 'bold', ... ], ... }</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="lines"><span class="type-signature"></span>lines<span class="signature">(lines, x, y, scale, style, closed)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1554">line 1554</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds series of curves (straight lines or cubic bezier curves) to canvas, starting at <code>x</code>, <code>y</code> coordinates.
All data points in <code>lines</code> are relative to last line origin.
<code>x</code>, <code>y</code> become x1,y1 for first line / curve in the set.
For lines you only need to specify [x2, y2] - (ending point) vector against x1, y1 starting point.
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.</p>
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>.lines([[2,2],[-2,2],[1,1,2,2,3,3],[2,1]], 212,110, 10) // line, line, bezier curve, line</code></pre>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>lines</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last"><p>Array of <em>vector</em> shifts as pairs (lines) or sextets (cubic bezier curves).</p></td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against left edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against upper edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>scale</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>(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.</p></td>
</tr>
<tr>
<td class="name"><code>style</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.</p></td>
</tr>
<tr>
<td class="name"><code>closed</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last"><p>If true, the path is closed with a straight line from the end of the last curve to the starting point.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="lstext"><span class="type-signature"></span>lstext<span class="signature">(text, x, y, spacing)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1502">line 1502</a>
</li></ul></dd>
<dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li><p>We'll be removing this function. It doesn't take character width into account.</p></li></ul></dd>
</dl>
<div class="description">
<p>Letter spacing method to print text with gaps</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>text</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Array</span>
</td>
<td class="description last"><p>String to be added to the page.</p></td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against left edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against upper edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>spacing</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Spacing (in units declared at inception)</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="output"><span class="type-signature"></span>output<span class="signature">(type, options)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line992">line 992</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Generates the PDF document.</p>
<p>If <code>type</code> argument is undefined, output is raw body of resulting PDF returned as a string.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>A string identifying one of the possible output types.</p></td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>An object providing some additional signalling to PDF generator.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="rect"><span class="type-signature"></span>rect<span class="signature">(x, y, w, h, style)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1638">line 1638</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds a rectangle to PDF</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against left edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against upper edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>w</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Width (in units declared at inception of PDF document)</p></td>
</tr>
<tr>
<td class="name"><code>h</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Height (in units declared at inception of PDF document)</p></td>
</tr>
<tr>
<td class="name"><code>style</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="roundedRect"><span class="type-signature"></span>roundedRect<span class="signature">(x, y, w, h, rx, rx, style)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1698">line 1698</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds a rectangle with rounded corners to PDF</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against left edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against upper edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>w</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Width (in units declared at inception of PDF document)</p></td>
</tr>
<tr>
<td class="name"><code>h</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Height (in units declared at inception of PDF document)</p></td>
</tr>
<tr>
<td class="name"><code>rx</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Radius along x axis (in units declared at inception of PDF document)</p></td>
</tr>
<tr>
<td class="name"><code>rx</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Radius along y axis (in units declared at inception of PDF document)</p></td>
</tr>
<tr>
<td class="name"><code>style</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">(filename)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line2183">line 2183</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Saves as PDF document. An alias of jsPDF.output('save', 'filename.pdf')</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filename</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>The filename including extension.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setDisplayMode"><span class="type-signature"></span>setDisplayMode<span class="signature">(zoom, layout, pmode)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1258">line 1258</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Set the display mode options of the page like zoom and layout.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>zoom</code></td>
<td class="type">
<span class="param-type">integer</span>
|
<span class="param-type">String</span>
</td>
<td class="description last"><p>You can pass an integer or percentage as
a string. 2 will scale the document up 2x, '200%' will scale up by the
same amount. You can also set it to 'fullwidth', 'fullheight',
'fullpage', or 'original'.</p>
<p>Only certain PDF readers support this, such as Adobe Acrobat</p></td>
</tr>
<tr>
<td class="name"><code>layout</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Layout mode can be: 'continuous' - this is the
default continuous scroll. 'single' - the single page mode only shows one
page at a time. 'twoleft' - two column left mode, first page starts on
the left, and 'tworight' - pages are laid out in two columns, with the
first page on the right. This would be used for books.</p></td>
</tr>
<tr>
<td class="name"><code>pmode</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>'UseOutlines' - it shows the
outline of the document on the left. 'UseThumbs' - shows thumbnails along
the left. 'FullScreen' - prompts the user to enter fullscreen mode.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setDrawColor"><span class="type-signature"></span>setDrawColor<span class="signature">(ch1, ch2, ch3, ch4)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1939">line 1939</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Sets the stroke color for upcoming elements.</p>
<p>Depending on the number of arguments given, Gray, RGB, or CMYK
color space is implied.</p>
<p>When only ch1 is given, &quot;Gray&quot; color space is implied and it
must be a value in the range from 0.00 (solid black) to to 1.00 (white)
if values are communicated as String types, or in range from 0 (black)
to 255 (white) if communicated as Number type.
The RGB-like 0-255 range is provided for backward compatibility.</p>
<p>When only ch1,ch2,ch3 are given, &quot;RGB&quot; color space is implied and each
value must be in the range from 0.00 (minimum intensity) to to 1.00
(max intensity) if values are communicated as String types, or
from 0 (min intensity) to to 255 (max intensity) if values are communicated
as Number types.
The RGB-like 0-255 range is provided for backward compatibility.</p>
<p>When ch1,ch2,ch3,ch4 are given, &quot;CMYK&quot; color space is implied and each
value must be a in the range from 0.00 (0% concentration) to to
1.00 (100% concentration)</p>
<p>Because JavaScript treats fixed point numbers badly (rounds to
floating point nearest to binary representation) it is highly advised to
communicate the fractional numbers as String types, not JavaScript Number type.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>ch1</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<span class="param-type">String</span>
</td>
<td class="description last"><p>Color channel value</p></td>
</tr>
<tr>
<td class="name"><code>ch2</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<span class="param-type">String</span>
</td>
<td class="description last"><p>Color channel value</p></td>
</tr>
<tr>
<td class="name"><code>ch3</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<span class="param-type">String</span>
</td>
<td class="description last"><p>Color channel value</p></td>
</tr>
<tr>
<td class="name"><code>ch4</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<span class="param-type">String</span>
</td>
<td class="description last"><p>Color channel value</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setFillColor"><span class="type-signature"></span>setFillColor<span class="signature">(ch1, ch2, ch3, ch4)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line2006">line 2006</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Sets the fill color for upcoming elements.</p>
<p>Depending on the number of arguments given, Gray, RGB, or CMYK
color space is implied.</p>
<p>When only ch1 is given, &quot;Gray&quot; color space is implied and it
must be a value in the range from 0.00 (solid black) to to 1.00 (white)
if values are communicated as String types, or in range from 0 (black)
to 255 (white) if communicated as Number type.
The RGB-like 0-255 range is provided for backward compatibility.</p>
<p>When only ch1,ch2,ch3 are given, &quot;RGB&quot; color space is implied and each
value must be in the range from 0.00 (minimum intensity) to to 1.00
(max intensity) if values are communicated as String types, or
from 0 (min intensity) to to 255 (max intensity) if values are communicated
as Number types.
The RGB-like 0-255 range is provided for backward compatibility.</p>
<p>When ch1,ch2,ch3,ch4 are given, &quot;CMYK&quot; color space is implied and each
value must be a in the range from 0.00 (0% concentration) to to
1.00 (100% concentration)</p>
<p>Because JavaScript treats fixed point numbers badly (rounds to
floating point nearest to binary representation) it is highly advised to
communicate the fractional numbers as String types, not JavaScript Number type.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>ch1</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<span class="param-type">String</span>
</td>
<td class="description last"><p>Color channel value</p></td>
</tr>
<tr>
<td class="name"><code>ch2</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<span class="param-type">String</span>
</td>
<td class="description last"><p>Color channel value</p></td>
</tr>
<tr>
<td class="name"><code>ch3</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<span class="param-type">String</span>
</td>
<td class="description last"><p>Color channel value</p></td>
</tr>
<tr>
<td class="name"><code>ch4</code></td>
<td class="type">
<span class="param-type">Number</span>
|
<span class="param-type">String</span>
</td>
<td class="description last"><p>Color channel value</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setFont"><span class="type-signature"></span>setFont<span class="signature">(fontName, fontStyle)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1847">line 1847</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Sets text font face, variant for upcoming text elements.
See output of jsPDF.getFontList() for possible font names, styles.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fontName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Font name or family. Example: &quot;times&quot;</p></td>
</tr>
<tr>
<td class="name"><code>fontStyle</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Font style or variant. Example: &quot;italic&quot;</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setFontSize"><span class="type-signature"></span>setFontSize<span class="signature">(size)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1833">line 1833</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Sets font size for upcoming text elements.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>size</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Font size in points.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setFontStyle"><span class="type-signature"></span>setFontStyle<span class="signature">(style)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1864">line 1864</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Switches font style or variant for upcoming text elements,
while keeping the font face or family same.
See output of jsPDF.getFontList() for possible font names, styles.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>style</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>Font style or variant. Example: &quot;italic&quot;</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setLineCap"><span class="type-signature"></span>setLineCap<span class="signature">(style)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line2134">line 2134</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Sets the line cap styles
See {jsPDF.CapJoinStyles} for variants</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>style</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Number</span>
</td>
<td class="description last"><p>A string or number identifying the type of line cap</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setLineJoin"><span class="type-signature"></span>setLineJoin<span class="signature">(style)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line2157">line 2157</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Sets the line join styles
See {jsPDF.CapJoinStyles} for variants</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>style</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Number</span>
</td>
<td class="description last"><p>A string or number identifying the type of line join</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setLineWidth"><span class="type-signature"></span>setLineWidth<span class="signature">(width)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1925">line 1925</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Sets line width for upcoming lines.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>width</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Line width (in units declared at inception of PDF document)</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setPage"><span class="type-signature"></span>setPage<span class="signature">(page)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1197">line 1197</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds (and transfers the focus to) new page to the PDF document.</p>
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>doc = jsPDF()
doc.addPage()
doc.addPage()
doc.text('I am on page 3', 10, 10)
doc.setPage(1)
doc.text('I am on page 1', 10, 10)</code></pre>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>page</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Switch the active page to the page number specified</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setProperties"><span class="type-signature"></span>setProperties<span class="signature">(A)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1813">line 1813</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds a properties to the PDF document</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>A</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>property_name-to-property_value object structure.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="setTextColor"><span class="type-signature"></span>setTextColor<span class="signature">(r, g, b)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line2079">line 2079</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Sets the text color for upcoming elements.
If only one, first argument is given,
treats the value as gray-scale color value.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>r</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Red channel color value in range 0-255 or {String} r color value in hexadecimal, example: '#FFFFFF'</p></td>
</tr>
<tr>
<td class="name"><code>g</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Green channel color value in range 0-255</p></td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Blue channel color value in range 0-255</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="text"><span class="type-signature"></span>text<span class="signature">(text, x, y, flags)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1293">line 1293</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds text to page. Supports adding multiline text when 'text' argument is an Array of Strings.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>text</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type">Array</span>
</td>
<td class="description last"><p>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.</p></td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against left edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against upper edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>flags</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>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.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
<h4 class="name" id="triangle"><span class="type-signature"></span>triangle<span class="signature">(x1, y1, x2, y2, x3, y3, style)</span><span class="type-signature"> &rarr; {<a href="jsPDF.html">jsPDF</a>}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="jspdf.js.html">jspdf.js</a>, <a href="jspdf.js.html#line1668">line 1668</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Adds a triangle to PDF</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>x1</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against left edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>y1</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against upper edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>x2</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against left edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>y2</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against upper edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>x3</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against left edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>y3</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>Coordinate (in units declared at inception of PDF document) against upper edge of the page</p></td>
</tr>
<tr>
<td class="name"><code>style</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last"><p>A string specifying the painting style or null. Valid styles include: 'S' [default] - stroke, 'F' - fill, and 'DF' (or 'FD') - fill then stroke. A null value postpones setting the style so that a shape may be composed using multiple method calls. The last drawing method call used to define the shape should not have a null style argument.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="jsPDF.html">jsPDF</a></span>
</dd>
</dl>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Sat Jul 29 2017 10:16:38 GMT+0100 (BST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>