TextToPDF Assistant

TextToPDF Assistant · GPT アクション

TextToPDF API

API for converting text to PDF, extracting text from PDF, and OCR for scanned PDFs.

  • GET /healthCheck API status
  • POST /convert/text-to-pdfConvert plain text into PDF
  • POST /extract/pdf-to-textExtract text from a digital PDF
  • POST /ocr/scanned-pdf-to-textRun OCR on a scanned PDF
元の API スキーマ
{
  "openapi": "3.1.0",
  "info": {
    "title": "TextToPDF API",
    "description": "API for converting text to PDF, extracting text from PDF, and OCR for scanned PDFs.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://texttopdf.net/api"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "checkHealth",
        "summary": "Check API status",
        "responses": {
          "200": {
            "description": "API is running"
          }
        }
      }
    },
    "/convert/text-to-pdf": {
      "post": {
        "operationId": "convertTextToPdf",
        "summary": "Convert plain text into PDF",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "Plain text content to convert into PDF"
                  },
                  "file_name": {
                    "type": "string",
                    "description": "Optional output file name"
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PDF created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "pdf_url"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/extract/pdf-to-text": {
      "post": {
        "operationId": "extractPdfToText",
        "summary": "Extract text from a digital PDF",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pdf_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the PDF file"
                  }
                },
                "required": [
                  "pdf_url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Text extracted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "text"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/ocr/scanned-pdf-to-text": {
      "post": {
        "operationId": "ocrScannedPdfToText",
        "summary": "Run OCR on a scanned PDF",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pdf_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of the scanned PDF file"
                  }
                },
                "required": [
                  "pdf_url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OCR completed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "text"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}