Skip to content

Richie-Yang/pdf-txt2img-app

Repository files navigation

pdf-convert


1. - API 目錄

Root 路由

GET /test

POST /convert



2. - API 資訊

Root 路由

GET /test

測試路由

ResponseBody:

{
  "status": 200,
  "message": "ok"
}

POST /convert

將上傳 text-based PDF 轉換成 image-based PDF,並根據需求回傳 Buffer 或下載檔案

note: 目前 responseType 只支援 buffer 或 file

RequestBody:

{
  "responseType": "buffer",
  "quality": 3,
  "file": {UPLOAD_PDF_FILE}
}

ResponseBody if response type is buffer:

{
  "status": 200,
  "data": {
    "message": "convert PDF to image success!",
    "buffer": {
      "type": "Buffer",
      "data": [PDF_FILE_BUFFER]
    }
  }
}

ResponseHeader if response type is file:

{
  "Content-Type": "application/pdf",
  "Content-Disposition": "attachment; filename=xxx_converted.pdf"
}

ResponseBody if response type is file:

{DOWNLOAD_PDF_FILE}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published