Skip to main content

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

See Modes and Formats.

Methods (all suspend)

convertFile

Upload the file via multipart to POST /convert.

convertBytes

Send data as raw body to POST /convert/raw.

convertFromUrl

Llama a POST /convert/from-url.

pdfIndex

Call POST /pdf/index. Returns a kotlinx.serialization.json.JsonObject with the spine — pageCount, sections, fontModel, etc.

getJob

Consulta manualmente GET /jobs/{id}.

waitForJob

Polls from 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:

JsonResult

Job