Package-level declarations

Types

Link copied to clipboard
data class ApiStatus(val success: Boolean, val code: Int?, val message: String?, val version: String?)

Mirrors GET /status.

Link copied to clipboard
data class AsyncRenderAccepted(val message: String?)

Response to an accepted asynchronous render request.

Link copied to clipboard
data class BatchOptions(val splitBy: String, val output: BatchOutput = BatchOutput.ZIP, val reportName: String? = null)

batchSplitBy / batchOutput / batchReportName.

Link copied to clipboard

batchOutput.

Link copied to clipboard

ColorMode formatOption.

Link copied to clipboard
data class CsvOptions(val fieldSeparator: String? = null, val textDelimiter: String? = null, val characterSet: String? = null)

CSV formatOptions. characterSet is a LibreOffice charset code, e.g. "76" for UTF-8.

Link copied to clipboard
data class CurrencyConversion(val source: String, val target: String, val rates: Map<String, Double> = emptyMap())

currencySource / currencyTarget / currencyRates.

Link copied to clipboard
data class ImageOptions(val pixelWidth: Int? = null, val pixelHeight: Int? = null, val colorMode: ColorMode? = null, val quality: Int? = null, val compression: Int? = null, val interlaced: Boolean? = null, val translucent: Boolean? = null)

JPG / PNG formatOptions.

Link copied to clipboard

MaxImageResolution, in DPI.

Link copied to clipboard
data class ListTemplatesQuery(val id: TemplateId? = null, val versionId: TemplateId? = null, val category: String? = null, val origin: TemplateOrigin? = null, val includeVersions: Boolean = false, val search: String? = null, val limit: Int = MAX_LIMIT, val cursor: String? = null)

Filters and pagination for GET /templates.

Link copied to clipboard
sealed interface OutputFormat

The convertTo field: a plain format name or a format with typed options.

Link copied to clipboard
data class Page<T>(val items: List<T>, val hasMore: Boolean, val nextCursor: String?)

One page of a paginated Carbone listing.

Link copied to clipboard

Changes permission level, from no changes allowed to any change except page extraction.

Link copied to clipboard

converter: the engine used to produce PDF output. LIBRE_OFFICE is the server default.

Link copied to clipboard
data class PdfOptions(val version: PdfVersion? = null, val encryptFile: Boolean? = null, val documentOpenPassword: String? = null, val permissionPassword: String? = null, val restrictPermissions: Boolean? = null, val printing: PdfPrinting? = null, val changes: PdfChanges? = null, val watermark: String? = null, val watermarks: List<Watermark> = emptyList(), val pdfUaCompliance: Boolean? = null, val useTaggedPdf: Boolean? = null, val pageRange: String? = null, val useLosslessCompression: Boolean? = null, val reduceImageResolution: Boolean? = null, val maxImageResolution: ImageResolution? = null, val exportFormFields: Boolean? = null, val exportNotes: Boolean? = null)

PDF formatOptions. null leaves the Carbone default.

Link copied to clipboard

Printing permission level.

Link copied to clipboard

SelectPdfVersion; PDF_1_6_DEFAULT (0) is the server default.

Link copied to clipboard
sealed interface RenderData

The data field of a render request.

Link copied to clipboard
class RenderedDocument(val content: ByteArray, val fileName: String?, val contentType: String?)

A generated document.

Link copied to clipboard
value class RenderId(val value: String)

Identifies a generated document, returned by POST /render/{templateId} when download=false.

Link copied to clipboard
data class RenderOptions(val convertTo: OutputFormat? = null, val converter: PdfConverter? = null, val timezone: String? = null, val lang: String? = null, val complement: JsonElement? = null, val variableStr: String? = null, val reportName: String? = null, val enum: JsonObject? = null, val translations: JsonObject? = null, val currency: CurrencyConversion? = null, val hardRefresh: Boolean = false, val batch: BatchOptions? = null, val preReleaseFeatureIn: Int? = null, val headers: Map<String, String> = emptyMap())

Everything in a render body except data and template, plus extra request headers.

Link copied to clipboard
class TemplateFile(val content: ByteArray, val fileName: String?, val contentType: String?)

A downloaded template document.

Link copied to clipboard
value class TemplateId(val value: String)

Identifies a template: legacy SHA-256 id, versioned template id, or a version id. Carbone accepts all three in the same path segment.

Link copied to clipboard
data class TemplateInfo(val id: TemplateId, val versionId: TemplateId?, val name: String?, val category: String?, val comment: String?, val tags: List<String>, val type: String?, val size: Long?, val origin: TemplateOrigin?, val createdAt: Instant?, val deployedAt: Instant?, val expireAt: Instant?)

One entry of GET /templates.

Link copied to clipboard

How a template was created; mirrors GET /templates origin.

Link copied to clipboard
data class TemplatePatch(val id: TemplateId? = null, val name: String? = null, val comment: String? = null, val category: String? = null, val tags: List<String>? = null, val expireAt: Instant? = null, val deployedAt: Instant? = null)

Fields accepted by PATCH /template/{id}. null means "leave unchanged".

Link copied to clipboard
data class TemplateSample(val data: JsonElement? = null, val complement: JsonElement? = null, val translations: JsonElement? = null, val enum: JsonElement? = null)

Sample data stored with a template for Studio previews.

Link copied to clipboard
sealed interface TemplateSource

Where a template comes from: local content (hashable, uploadable) or a template already known to Carbone.

Link copied to clipboard
sealed interface UploadedTemplate

Result of POST /template. Shape depends on whether versioning was requested.

Link copied to clipboard
data class UploadOptions(val id: TemplateId? = null, val versioning: Boolean = false, val name: String? = null, val comment: String? = null, val category: String? = null, val tags: List<String> = emptyList(), val expireAt: Instant? = null, val deployedAt: Instant? = null, val sample: TemplateSample? = null)

Metadata sent with POST /template. All optional; versioning-related fields are ignored by Community edition.

Link copied to clipboard
data class Watermark(val text: String, val anchor: WatermarkAnchor? = null, val offsetX: Double? = null, val offsetY: Double? = null, val rotation: Double? = null, val color: String? = null, val size: Double? = null, val opacity: Double? = null, val font: String? = null, val fromPage: Int? = null, val toPage: Int? = null)

One entry of Watermarks. text supports {#PAGE_NUMBER} and {#PAGE_TOTAL}.

Link copied to clipboard

Watermark.anchor wire value.

Link copied to clipboard
data class Webhook(val url: String, val headers: Map<String, String> = emptyMap())

Asynchronous rendering target. Headers become carbone-webhook-header-<name>.