Skip to content

Commit

Permalink
updated readme for drawLine. converted tabs to spaces. updated client…
Browse files Browse the repository at this point in the history
… demo
  • Loading branch information
Marak committed Oct 22, 2010
1 parent eb5bcf2 commit cb4c348
Show file tree
Hide file tree
Showing 6 changed files with 443 additions and 427 deletions.
Binary file added .DS_Store
Binary file not shown.
30 changes: 20 additions & 10 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

/* Optional - set properties on the document */
doc.setProperties({
title: 'A sample document created by pdf.js',
subject: 'PDFs are kinda cool, i guess',
author: 'Marak Squires',
keywords: 'pdf.js, javascript, Marak, Marak Squires',
creator: 'pdf.js'
title: 'A sample document created by pdf.js',
subject: 'PDFs are kinda cool, i guess',
author: 'Marak Squires',
keywords: 'pdf.js, javascript, Marak, Marak Squires',
creator: 'pdf.js'
});
doc.addPage();

Expand All @@ -31,6 +31,11 @@
doc.setFontSize(16);
doc.text(20, 30, 'This is some normal sized text underneath.');

doc.drawLine(100, 100, 100, 120, 1.0, 'dashed');
doc.drawLine(100, 100, 120, 100, 1.2, 'dotted');
doc.drawLine(120, 120, 100, 120, 1.4, 'dashed');
doc.drawLine(120, 120, 120, 100, 1.6, 'solid');

var fileName = "testFile"+new Date().getSeconds()+".pdf";
var pdfAsDataURI = doc.output('datauri', {"fileName":fileName});

Expand Down Expand Up @@ -67,11 +72,11 @@

/* optional - set properties on the document */
doc.setProperties({
title: 'A sample document created by pdf.js',
subject: 'PDFs are kinda cool, i guess',
author: 'Marak Squires',
keywords: 'pdf.js, javascript, Marak, Marak Squires',
creator: 'pdf.js'
title: 'A sample document created by pdf.js',
subject: 'PDFs are kinda cool, i guess',
author: 'Marak Squires',
keywords: 'pdf.js, javascript, Marak, Marak Squires',
creator: 'pdf.js'
});
doc.addPage();

Expand All @@ -81,6 +86,11 @@
doc.setFontSize(16);
doc.text(20, 30, 'This is some normal sized text underneath.');

doc.drawLine(100, 100, 100, 120, 1.0, 'dashed');
doc.drawLine(100, 100, 120, 100, 1.2, 'dotted');
doc.drawLine(120, 120, 100, 120, 1.4, 'dashed');
doc.drawLine(120, 120, 120, 100, 1.6, 'solid');

var fileName = "testFile"+new Date().getSeconds()+".pdf";

fs.writeFile(fileName, doc.output(), function(err, data){
Expand Down
68 changes: 37 additions & 31 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@

<html>
<head>
<title>pdf.js - create basic pdf files in the browser and node.js</title>
<style type="text/css">
* { padding: 0; margin: 0; }
body {
padding: 30px;
font-family: Arial, Helvetica, sans-serif;
}
h1 {
margin-bottom: 1em;
border-bottom: 1px solid #ccc;
}
h2 {
margin-bottom: 1em;
border-bottom: 1px solid #ccc;
}
pre {
border: 1px dotted #ccc;
background: #f7f7f7;
padding: 10px;
margin-bottom: 1em;
}
<title>pdf.js - create basic pdf files in the browser and node.js</title>
<style type="text/css">
* { padding: 0; margin: 0; }
body {
padding: 30px;
font-family: Arial, Helvetica, sans-serif;
}
h1 {
margin-bottom: 1em;
border-bottom: 1px solid #ccc;
}
h2 {
margin-bottom: 1em;
border-bottom: 1px solid #ccc;
}
pre {
border: 1px dotted #ccc;
background: #f7f7f7;
padding: 10px;
margin-bottom: 1em;
}

h1 {
margin-bottom: 0.7em;
Expand All @@ -35,10 +35,10 @@
.box{ width:100%; height:500px;}
#theCode{}
#theFrame{ display:none;}
</style>
<script type="text/javascript" src="./lib/pdf.js"></script>
</style>
<script type="text/javascript" src="./lib/pdf.js"></script>
<!-- jquery not required, just use this this demo page -->
<script type="text/javascript" src="./vendor/jquery.js"></script>
<script type="text/javascript" src="./vendor/jquery.js"></script>


<script type="text/javascript">
Expand Down Expand Up @@ -79,11 +79,11 @@ <h3>demo -

/* optional - set properties on the document */
doc.setProperties({
title: 'A sample document created by pdf.js',
subject: 'PDFs are kinda cool, i guess',
author: 'Marak Squires',
keywords: 'pdf.js, javascript, Marak, Marak Squires',
creator: 'pdf.js'
title: 'A sample document created by pdf.js',
subject: 'PDFs are kinda cool, i guess',
author: 'Marak Squires',
keywords: 'pdf.js, javascript, Marak, Marak Squires',
creator: 'pdf.js'
});
doc.addPage();

Expand All @@ -92,6 +92,12 @@ <h3>demo -

doc.setFontSize(16);
doc.text(20, 30, 'This is some normal sized text underneath.');

doc.drawLine(100, 100, 100, 120, 1.0, 'dashed');
doc.drawLine(100, 100, 120, 100, 1.2, 'dotted');
doc.drawLine(120, 120, 100, 120, 1.4, 'dashed');
doc.drawLine(120, 120, 120, 100, 1.6, 'solid');


var fileName = "testFile"+new Date().getSeconds()+".pdf";
var pdfAsDataURI = doc.output('datauri', {"fileName":fileName});
Expand Down
Loading

0 comments on commit cb4c348

Please sign in to comment.