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

# Export to PDF

> Converts one or more base64-encoded DOCX files to PDF via LibreOffice and returns the results as base64-encoded PDF strings.

Each item in `data` must include a `documentId` (for permission checks) and the base64 `docx` content.

Returns an array of `{ documentId, pdf }` objects.



## OpenAPI

````yaml post /export/doc-to-pdf
openapi: 3.1.0
info:
  title: HERO API
  version: current
  description: |-
    The HERO REST API.

    See https://developers.myhero.so for the rendered docs.
servers:
  - url: https://app.myhero.so
security: []
paths:
  /export/doc-to-pdf:
    post:
      tags:
        - Export
      summary: Export to PDF
      description: >-
        Converts one or more base64-encoded DOCX files to PDF via LibreOffice
        and returns the results as base64-encoded PDF strings.


        Each item in `data` must include a `documentId` (for permission checks)
        and the base64 `docx` content.


        Returns an array of `{ documentId, pdf }` objects.
      operationId: convertDocToPdf
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      documentId:
                        type: string
                        minLength: 1
                      docx:
                        type: string
                        minLength: 1
                    required:
                      - documentId
                      - docx
                  minItems: 1
              required:
                - data
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  pdfDocuments:
                    type: array
                    items:
                      type: object
                      properties:
                        documentId:
                          type: string
                        pdf:
                          type: string
                      required:
                        - documentId
                        - pdf
                required:
                  - pdfDocuments
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '403':
          description: 403 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '500':
          description: 500 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: HERO personal access token

````