Skip to content

Commit 96c78ad

Browse files
committed
Issue #307 Update README
1 parent c09a20d commit 96c78ad

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,23 @@ $pdf = new Pdf(array(
188188
));
189189
```
190190

191+
### Passing strings
192+
193+
Some options like `header-html` usually expect a URL or a filename. With our
194+
library you can also pass a string. The class will try to detect if the
195+
argument is a URL, a filename or some HTML or XML content. To make detection
196+
easier you can surround your content in `<html>` tag.
197+
198+
If this doesn't work correctly you can also pass an instance of our `File`
199+
helper as a last resort:
200+
201+
```php
202+
use mikehaertl\tmp\File;
203+
$options = [
204+
'header-html' => new File('Complex content', '.html'),
205+
];
206+
```
207+
191208
## Error handling
192209

193210
`send()`, `saveAs()` and `toString()` will return `false` on error. In this case the detailed error message is

0 commit comments

Comments
 (0)