Skip to content

Commit 273d22b

Browse files
committed
Add workflow information to the readme
1 parent 4a5f92e commit 273d22b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ This worker has methods that can be chained sequentially, as each Promise resolv
4848
var worker = html2pdf().from(element).save();
4949
```
5050

51+
#### Workflow
52+
53+
The basic workflow of html2pdf tasks (enforced by the prereq system) is:
54+
55+
```
56+
.from() -> .toContainer() -> .toCanvas() -> .toImg() -> .toPdf() -> .save()
57+
```
58+
5159
#### Worker API
5260

5361
| Method | Arguments | Description |
@@ -56,7 +64,7 @@ var worker = html2pdf().from(element).save();
5664
| to | target | Converts the source to the specified target (`'container'`, `'canvas'`, `'img'`, or `'pdf'`). Each target also has its own `toX` method that can be called directly: `toContainer()`, `toCanvas()`, `toImg()`, and `toPdf()`. |
5765
| output | type, options, src | Routes to the appropriate `outputPdf` or `outputImg` method based on specified `src` (`'pdf'` (default) or `'img'`). |
5866
| outputPdf | type, options | Sends `type` and `options` to the jsPDF object's `output` method, and returns the result as a Promise (use `.then` to access). See the [jsPDF source code](https://rawgit.com/MrRio/jsPDF/master/docs/jspdf.js.html#line992) for more info. |
59-
| outputImg | type, options | Returns the specified data type for the image as a Promise (use `.then` to access). Supported types: `'img'`, `'datauristring/dataurlstring'`, and `'datauri/dataurl'`. |
67+
| outputImg | type, options | Returns the specified data type for the image as a Promise (use `.then` to access). Supported types: `'img'`, `'datauristring'`/`'dataurlstring'`, and `'datauri'`/`'dataurl'`. |
6068
| save | filename | Saves the PDF object with the optional filename (creates user download prompt). |
6169
| set | opt | Sets the specified properties. See [Options](#options) below for more details. |
6270
| get | key, cbk | Returns the property specified in `key`, either as a Promise (use `.then` to access), or by calling `cbk` if provided. |

0 commit comments

Comments
 (0)