Referencia
createConvertRouteHandler(config)
{ POST }, ready to re-export from route.ts. The handler accepts multipart/form-data with a file field (configurable, see fileField below) and returns the API response as is.
convertFormData(formData, options)
FormData (typically received as an argument to a Server Action) and calls convertFile of the underlying SDK. Intended to be used within a "use server" function.
convertUrlAction(url, options)
convertFromUrl of SDK, intended for Server Actions that receive a pre-signed URL instead of a file.
getServerClient(config)
MarkpdfClient (memoized by apiKey + baseUrl within the same process) for when you need direct access to the entire client — for example, to use pdfIndex, convertStream, or getJob within a custom Route Handler or Server Action.
app/api/index/route.ts
Tipos re-exportados
@markpdf/nextjs re-exports the @markpdf/sdk types so you don’t need to install it separately if you only use the high-level helpers:
