You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
34
32
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):
37
41
38
42
```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
$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
+
));
44
53
$file = $docRaptor->fetchDocument();
45
54
```
46
55
47
-
###Advanced
56
+
#### Alternate HTTP Implementation
48
57
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.
0 commit comments