Referencia
MarkpdfClient
string
required
Your API key. If you don’t pass it, the client reads
Bun.env.MARKPDF_API_KEY.string
default:"https://api.markpdf.tech"
URL base of API.
number
default:"300000"
Timeout per request in milliseconds.
number
default:"2"
Automatic retries with exponential backoff in
429 and 5xx.boolean
default:"true"
If the server responds
202 (backends saturated), it automatically polls GET /jobs/{id}. It can be overwritten by call.Methods
They all accept the same options as the query params of API, in camelCase.convertFile
path with Bun.file(path) and passes it as body of POST /convert/raw — Bun streams the file directly to the socket, without going through an intermediate Buffer. The filename is inferred from the base name of path.
convertBytes
convertFile, but for data already loaded into memory (for example, the body of an incoming Request).
convertFromUrl
POST /convert/from-url.
convertStream
POST /convert/stream, reading the file with Bun.file(path). See Streaming and async.
pdfIndex
POST /pdf/index. Returns the typed spine.
getJob
GET /jobs/{id}.
waitForJob
GET /jobs/{id} until the status is completed or failed, or until timeoutMs is exhausted. Used internally by autoPoll: true.
Tipos
ConversionResult
PdfSpine
JobStatus
@markpdf/bun:
