Skip to content

Commit bc817ec

Browse files
committed
added landscape example
1 parent 157e3e4 commit bc817ec

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

examples/basic.htm

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h1>jsPDF Demos</h1>
4444

4545
<p>Examples for using jsPDF with Data URIs below. Go <a href="https://github.com/MrRio/jsPDF">back to project homepage</a>.</p>
4646

47-
<h2>Simple Two-page Text Document</h2>
47+
<h2>Simple two-page text document</h2>
4848
<pre>var doc = new jsPDF();
4949
doc.text(20, 20, 'Hello world!');
5050
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
@@ -55,6 +55,14 @@ <h2>Simple Two-page Text Document</h2>
5555
doc.output('datauri');</pre>
5656
<a href="javascript:demoTwoPageDocument()">Run Code</a>
5757

58+
<h2>Landscape document</h2>
59+
<pre>var doc = new jsPDF('landscape');
60+
doc.text(20, 20, 'Hello landscape world!');
61+
62+
// Output as Data URI
63+
doc.output('datauri');</pre>
64+
<a href="javascript:demoLandscape()">Run Code</a>
65+
5866
<h2>Different font sizes</h2>
5967
<pre>var doc = new jsPDF();
6068
doc.setFontSize(22);
@@ -244,6 +252,14 @@ <h2>Draw circles and ellipses: lines</h2>
244252
doc.output('datauri');
245253
}
246254

255+
function demoLandscape() {
256+
var doc = new jsPDF('landscape');
257+
doc.text(20, 20, 'Hello landscape world!');
258+
259+
// Output as Data URI
260+
doc.output('datauri');
261+
}
262+
247263
function demoFontSizes() {
248264
var doc = new jsPDF();
249265
doc.setFontSize(22);

0 commit comments

Comments
 (0)