---
agentTools:
  projectIndex: https://docs.agilite.io/llms.txt
---

# /generatePDF

Returns the information of a generated PDF based on the passed PDFMake JSON Schema

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Agilit-e Utils",
    "version": "7"
  },
  "servers": [
    {
      "url": "https://api.agilite.io/utils"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "api-key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/generatePDF": {
      "post": {
        "summary": "/generatePDF",
        "description": "Returns the information of a generated PDF based on the passed PDFMake JSON Schema",
        "operationId": "generatepdf",
        "parameters": [
          {
            "name": "log-profile-key",
            "in": "header",
            "description": "Profile Key of the Batch Logging Profile configured for logging",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"__v\": 0,\n    \"updatedAt\": \"2017-10-27T06:26:31.606Z\",\n      \"createdAt\": \"2017-10-27T06:26:31.606Z\",\n        \"createdBy\": \"Agilit E Docs\",\n          \"modifiedBy\": \"Agilit E Docs\",\n            \"_id\": \"001\",\n              \"data\": {\n                \"fileName\": \"PDF Template\",\n                  \"contentType\": \"application/octet-stream\"\n              }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "__v": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "updatedAt": {
                      "type": "string",
                      "example": "2017-10-27T06:26:31.606Z"
                    },
                    "createdAt": {
                      "type": "string",
                      "example": "2017-10-27T06:26:31.606Z"
                    },
                    "createdBy": {
                      "type": "string",
                      "example": "Agilit E Docs"
                    },
                    "modifiedBy": {
                      "type": "string",
                      "example": "Agilit E Docs"
                    },
                    "_id": {
                      "type": "string",
                      "example": "001"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "fileName": {
                          "type": "string",
                          "example": "PDF Template"
                        },
                        "contentType": {
                          "type": "string",
                          "example": "application/octet-stream"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"statusCode\": 400,\n    \"errorMessage\": \"An Error Occurred\",\n    \"additionalMessages\": [\"An Error Occured\"]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "An Error Occurred"
                    },
                    "additionalMessages": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "An Error Occured"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {},
              "examples": {
                "Request Example": {
                  "value": {
                    "pageOrientation": "landscape",
                    "content": [
                      {
                        "pageBreak": "after",
                        "columns": [
                          [
                            {
                              "columns": [
                                {
                                  "text": "Test PDF",
                                  "style": "header"
                                }
                              ]
                            },
                            {
                              "columns": [
                                {
                                  "text": "October 2017",
                                  "style": "subHeader"
                                }
                              ]
                            }
                          ]
                        ]
                      },
                      {
                        "columns": [
                          [
                            {
                              "marginTop": 100,
                              "columns": []
                            },
                            {
                              "toc": {
                                "title": {
                                  "text": "Table of Contents",
                                  "style": "tocMain"
                                }
                              }
                            }
                          ]
                        ]
                      },
                      {
                        "text": "Line Entry 1",
                        "style": "tocHeader",
                        "tocItem": true,
                        "pageBreak": "before"
                      },
                      {
                        "text": "Line Entry 2",
                        "style": "tocHeader",
                        "tocItem": true,
                        "pageBreak": "before"
                      },
                      {
                        "text": "Line Entry 3",
                        "style": "tocHeader",
                        "tocItem": true,
                        "pageBreak": "before"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "5fc0c5ba525f16005dcefb98:5fc0c5ba525f16005dcefba6"
}
```