Skip to main content

Referencia

markpdf::Client

std::string
required
Your API key. If omitted, the constructor reads MARKPDF_API_KEY from the environment; throws std::runtime_error under construction if neither exists.
std::string
default:"https://api.markpdf.tech"
URL base of API.
long
default:"300000"
Timeout per request in milliseconds (CURLOPT_TIMEOUT_MS).
int
default:"2"
Automatic retries with exponential backoff in 429 and 5xx.
markpdf::Client is not copyable but it is movable. It is safe to share an instance between threads for read-only calls (getJob, pdfIndex); for concurrent conversions, each thread reuses its own curl easy handle internally via a pool.

ConvertOptions

Struct shared by convertFile, convertFromUrl and convertStream, with the same 1:1 mapping to the query params of API:
The enums (InputFormat, Mode, Engine, ResponseFormat, OutputEncoding) are serialized to the same string values ​​as documented by API — see Parameters.

Methods

convertFile

Upload a local file to POST /convert/raw.
bool
default:"true"
If the server responds 202, the client blocks the current thread and polls from GET /jobs/{id} to completed/failed. With autoPoll = false, convertFile returns an error of type JobQueued with jobId for manual poll. See Streaming and async.

convertFromUrl

Llama a POST /convert/from-url.

convertStream

Invokes onChunk synchronously for each fragment received from POST /convert/stream (or /convert/stream-from-url). There is no return value: the callback is executed in the same thread that calls convertStream, while the HTTP request is still in progress. See Streaming and async.

pdfIndex

Llama a POST /pdf/index.

getJob

Consulta manualmente GET /jobs/{id}.

Return Types

ConversionResult

PdfSpine

JobStatus

Result<T, E>

markpdf::Result<T, E> is a lightweight wrapper like std::expected (C++17 compatible):
See Error Handling for the details of MarkpdfError.