Create a PDF File from Input HTML
LAST UPDATED: FEB 27, 2024
Convert HTML Text to PDF
Implementation | System |
Command Category | System Utility |
Tags | FILE |
Inputs
Parameter Name | Required/Optional | Description | Sample Data |
---|---|---|---|
HTML Text | Required | The HTML text to be rendered and subsequently converted into a PDF file |
CODE
|
File Name | Optional | The file name of the output PDF file. If it is not filled, a name with the date will be automatically generated. |
|
Output
Remote Command API
The D3 command API allows you to send requests to D3 SOAR to execute this utility command via REST API.
Request
POST
https:/{base_url}/{api_namespace}/api/Command/convertHTMLtoPDF
Headers
Please refer to the page Webhook Configuration Guide - Authentication Method: API Keys for more details.
Request Body
{
"Username": <Username here>,
"Site": <Site here>,
"CommandParams": {
"HTML Text": <HTML Text here>,
"File Name": <File Name here>
}
}
Body Parameters
Parameter Name | Type | Required/Optional | Description |
---|---|---|---|
Username |
| Required | The username of your D3 SOAR account. |
Site |
| Required | The D3 SOAR site to run the remote command. |
HTML Text |
| Required | The HTML text to be rendered and subsequently converted into a PDF file |
File Name |
| Optional | The file name of the output PDF file. If it is not filled, a name with the date will be automatically generated. |
Sample Request
SAMPLE DATA
{
"Username": "Admin",
"Site": "Security Operations",
"CommandParams": {
"HTML Text": "\r\n\r\n\r\n\r\n\r\n\r\n
Hello, this is a test HTML document
\r\n
This HTML text will be converted to a PDF file.
\r\n\r\n",
"File Name": "testPDF.pdf"
}
}
Response
Response Fields
Field Name | Type | Description |
---|---|---|
error |
| The error message if the API request has failed. |
returnData |
| The return data from the API request. |
Sample Response
{
"error": "",
"returnData": {
"Status": "Successful",
"fileId": "136",
"fileName": "testPDF.pdf",
"md5": "452e8116c30b345284bb7669bd0fe886",
"sha1": "029603b0dc784b0c0b3c86d989a043b1e7cd636b",
"sha256": "fff299d9b36c1b4bee32eddefee6e3bd0b3f5b036dab0e5ae39c9cb2ecb01f6f"
}
}