Skip to content

Commit 185551e

Browse files
committed
Update README.markdown
update styles for prince settings
1 parent 9454d3e commit 185551e

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

README.markdown

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,31 @@ $docRaptor = new DocRaptor\ApiWrapper("YOUR_API_KEY_HERE"); // Or omit the API k
2929
$docRaptor->setDocumentContent('<h1>Hello!</h1>')->setDocumentType('pdf')->setTest(true)->setName('output.pdf');
3030
$file = $docRaptor->fetchDocument();
3131
```
32-
fetchDocument() returns file contents by default. Optionally, the fetchDocument() method takes a file path as an argument. If you provide
33-
a path, the class will attempt to write the returned value to the path you provided.
3432

35-
###Setting Prince Specific Options
36-
The API wrapper has the ability to set "prince_options" that is noted in the API documentation. Available array keys can be found in the API documentation. Example of putting in prince options (version and PDF profile)
33+
`fetchDocument()` returns document contents by default. You can optionally provide a file path to the `fetchDocument()` method, and the wrapper will attempt to write the returned value to that file path.
34+
35+
###Advanced
36+
37+
####Setting Prince Specific Options
38+
The API wrapper has the ability to set `prince_options` that is noted in the [API documentation](https://docraptor.com/documentation#pdf_options), where available keys are listed.
39+
40+
Example of setting prince version and [PDF profile](https://en.wikipedia.org/wiki/PDF/A#PDF.2FA-1):
3741

3842
```php
39-
$options = array();
40-
$options['version'] = "10";
41-
$options['profile'] = "PDF/A-1b";
42-
$docRaptor = new DocRaptor\ApiWrapper("YOUR_API_KEY_HERE"); // Or omit the API key and pass it in via setter
43-
$docRaptor->setDocumentContent('<h1>Hello!</h1>')->setDocumentType('pdf')->setTest(true)->setName('output.pdf')->setDocumentPrinceOptions($options);
43+
$docRaptor = new DocRaptor\ApiWrapper("YOUR_API_KEY_HERE");
44+
$docRaptor
45+
->setDocumentContent('<h1>Hello!</h1>')
46+
->setDocumentType('pdf')
47+
->setTest(true)
48+
->setName('output.pdf')
49+
->setDocumentPrinceOptions(array(
50+
'version' => '10',
51+
'profile' => 'PDF/A-1b',
52+
));
4453
$file = $docRaptor->fetchDocument();
4554
```
4655

47-
###Advanced
56+
#### Alternate HTTP Implementation
4857
Since we're injecting a `HttpTransferInterface` interface into the `ApiWrapper` you can either inject the provided `HttpClient` or inject your own implementation of the interface.
4958

5059
```php

0 commit comments

Comments
 (0)