> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daytalog.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate PDF

> Generates PDF and returns it's data



## OpenAPI

````yaml post /generate-pdf
openapi: 3.0.0
info:
  title: Daytalog API
  version: 0.1.0
servers:
  - url: http://localhost:5252
security:
  - ApiKeyAuth: []
paths:
  /generate-pdf:
    post:
      summary: Generate PDF
      description: Generates PDF and returns it's data
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeneratePdfRequest'
      responses:
        '200':
          description: PDF data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneratePdfResponse'
        '400':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizeResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceNotFoundResponse'
        '500':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    GeneratePdfRequest:
      type: object
      required:
        - presetId
        - logId
      properties:
        presetId:
          type: string
          description: PDF Preset ID
        logId:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          description: Log ID or IDs
    GeneratePdfResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
        data:
          type: object
          required:
            - filename
            - mimeType
            - base64
          properties:
            filename:
              type: string
              example: output.pdf
            mimeType:
              type: string
              example: application/pdf
            base64:
              type: string
          additionalProperties: false
      additionalProperties: false
    ValidationErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: Validation Error
        details:
          type: array
          items:
            type: object
            properties:
              prop:
                type: string
              message:
                type: string
    UnauthorizeResponse:
      type: object
      properties:
        error:
          type: string
          example: Unauthorized
    ResourceNotFoundResponse:
      type: object
      properties:
        error:
          type: string
          example: <Resource> not found
    ErrorResponse:
      type: object
      properties:
        error:
          oneOf:
            - type: string
            - type: array
              items:
                type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-token

````