Referencia
MarkpdfClient
String
required
Tu API key.
String
default:"https://api.markpdf.tech"
URL base of API.
OkHttpClient
default:"OkHttpClient()"
OkHttp instance to reuse. Useful for sharing the connection pool with the rest of your app, injecting interceptors (logging, proxy) or adjusting timeouts.
MarkpdfClient is thread-safe and is intended to be instantiated once and reused throughout the life of the app.
ConvertOptions
Data class with defaults — pass only what you want to change.
Enums
Methods (all suspend)
convertFile
POST /convert.
convertBytes
data as raw body to POST /convert/raw.
convertFromUrl
POST /convert/from-url.
pdfIndex
POST /pdf/index. Returns a kotlinx.serialization.json.JsonObject with the spine — pageCount, sections, fontModel, etc.
getJob
GET /jobs/{id}.
waitForJob
GET /jobs/{id} (using kotlinx.coroutines.delay, without blocking the thread) until completed/failed or until timeout is exhausted. Duration is kotlin.time.Duration.
ConvertResult
Sealed class with three subtypes — uses when exhaustive:
