Skip to main content

Referencia

MarkpdfClient

Internally use a single reusable java.net.http.HttpClient — don’t create a MarkpdfClient per request; instantiate it once and reuse it (it’s thread-safe).

ConvertOptions

Immutable class built with builder. All fields are optional and use the same defaults as API.

Enums

See Modes and Formats.

Methods

convertFile

Upload the file via multipart to POST /convert. Blocking.

convertBytes

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

convertBytesAsync

Same as convertBytes but non-blocking, using HttpClient.sendAsync internally. The CompletableFuture is exceptionally completed with MarkpdfException (wrapped if applicable) in case of error. See Async and jobs.

convertFromUrl

Llama a POST /convert/from-url.

pdfIndex

Call POST /pdf/index. Returns the spine as Map<String, Object> deserialized with Jackson (ObjectMapper.readValue(..., Map.class)), preserving the original JSON structure: pageCount, sections, fontModel, etc.

getJob

Consulta manualmente GET /jobs/{id}.

waitForJob

Blocking: polls GET /jobs/{id} with interval pollInterval until completed/failed or until timeout is exhausted. timeout can be null to wait indefinitely.

ConvertResult

Sealed interface with three records — uses pattern matching:

JsonResult

Job