pdfshift@1.0.0
This adaptor exports the following from common:
- as()
- assert()
- combine()
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- group()
- lastReferenceValue()
- map()
- merge()
- scrubEmojis()
- sourceValue()
- util
Functions
request
request(method, path, body, options) ⇒ Operation
Make a general HTTP request to PDFShift
Param | Type | Description |
---|---|---|
method | string | HTTP method to use |
path | string | Path to resource |
body | BodyOptions | Object which will be attached to the POST body |
options | RequestOptions | Optional request options |
This operation writes the following keys to state:
State Key | Description |
---|---|
data | the parsed response body |
response | the response from the HTTP server, including headers, statusCode, body, etc |
references | an array of all previous data objects used in the Job |
Example: Make a request to convert a HTML string to PDF
request(
'POST',
'/convert/pdf',
{ source: $.html }
);
Interfaces
BodyOptions
PDF Body Options object. See PDFShift documentation for more details.
Properties
Name | Type | Description |
---|---|---|
source | string | The HTML string or url to convert to PDF. |
sandbox | boolean | Generates PDF documents in dev mode that doesn't count in the credits. |
encode | boolean | Return the generated PDF in Base64 encoded format, instead of raw. Defaults to true |
HttpState
State object
Properties
Name | Description |
---|---|
data | the parsed response body |
response | the response from the HTTP server, including headers, statusCode, body, etc |
references | an array of all previous data objects used in the Job |