Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated readme

  • Loading branch information...
commit 19bf30c7db5e43c4040095bf7a257ccfc8e5265a 1 parent 8d3d212
@pdfcrowd authored
Showing with 23 additions and 8 deletions.
  1. +23 −8 README.md
View
31 README.md
@@ -25,7 +25,7 @@ The following code converts raw HTML code to PDF and sends it as a
var pdf = require('./lib/pdfcrowd');
var myPdfcrowd = new pdf.Pdfcrowd('your-username', 'your-api-key');
- myPdfcrowd.convertHtml('<html>...</html>', pdf.sendHttpResponse(res));
+ myPdfcrowd.convertHtml('<html>...</html>', pdf.sendHttpResponse(response));
You can convert also a web page and save it to a file:
@@ -59,20 +59,35 @@ Creates a Pdfcrowd instance.
### Methods
-The following methods generate PDF. The optional *options* argument
-lets you customize the created PDF. You can find the list of all
-options
-[here](http://pdfcrowd.com/html-to-pdf-api/#api-ref-conversion-common-par).
+The following methods generate PDF.
- Pdfcrowd.convertHtml(html [,options]);
+* The *callbacks* argument is an object that should define the following methods
+
+ pdf(readableStream)
+ Called when the PDF [stream](http://nodejs.org/docs/latest/api/streams.html#readable_Stream) becomes available.
+
+ end()
+ Called when all PDF data has been read.
+
+ error(errorMessage, statusCode)
+ Called when an error occurs. *errorMessage* is a string containing the error message and *statusCode* is a HTTP status code.
+
+* The optional *options* argument lets you customize the created
+ PDF. You can find the list of all options
+ [here](http://pdfcrowd.com/html-to-pdf-api/#api-ref-conversion-common-par).
+
+
+-
+
+ Pdfcrowd.convertHtml(html, callbacks [,options]);
Convert raw HTML code to PDF.
- Pdfcrowd.convertURI(url [,options]);
+ Pdfcrowd.convertURI(url, callbacks [,options]);
Convert a web page to PDF. The *url* argument must start with http:// or https://.
- Pdfcrowd.convertFile(fname [,options]);
+ Pdfcrowd.convertFile(fname, callbacks [,options]);
Convert a local HTML file to PDF.
Please sign in to comment.
Something went wrong with that request. Please try again.