Package-level declarations

Properties

Link copied to clipboard

Default post-decoding response-body ceiling for remote documents (128 MiB). KitePDF holds the download and parsed document in memory at once, so an unbounded body can otherwise terminate a mobile or browser host process.

Functions

Link copied to clipboard
suspend fun KiteDoc.downloadBytes(url: String, client: HttpClient, configure: HttpRequestBuilder.() -> Unit = {}): ByteArray

Downloads url and returns the raw bytes, without opening anything.

suspend fun KiteDoc.downloadBytes(url: String, client: HttpClient, maxBytes: Int, configure: HttpRequestBuilder.() -> Unit = {}): ByteArray

downloadBytes with an explicit response-body maxBytes ceiling.

Link copied to clipboard
suspend fun KiteDoc.openUrl(url: String, client: HttpClient, password: String = "", epubSettings: EpubSettings = EpubSettings(), configure: HttpRequestBuilder.() -> Unit = {}): KiteDocument

Downloads url and opens it as whichever format it turns out to be.

suspend fun KiteDoc.openUrl(url: String, client: HttpClient, maxBytes: Int, password: String = "", epubSettings: EpubSettings = EpubSettings(), configure: HttpRequestBuilder.() -> Unit = {}): KiteDocument

openUrl with an explicit maxBytes ceiling. Raise the default only when the caller has an independent trust boundary and enough process memory.

Link copied to clipboard
suspend fun KiteDoc.openUrlOrNull(url: String, client: HttpClient, password: String = "", epubSettings: EpubSettings = EpubSettings(), configure: HttpRequestBuilder.() -> Unit = {}): KiteDocument?

openUrl, but null instead of an exception on any failure, network included.

suspend fun KiteDoc.openUrlOrNull(url: String, client: HttpClient, maxBytes: Int, password: String = "", epubSettings: EpubSettings = EpubSettings(), configure: HttpRequestBuilder.() -> Unit = {}): KiteDocument?

openUrlOrNull with an explicit response-body maxBytes ceiling.