Function

captureSingleRemoteDocument

Capture a RemoteCompose document by rendering the specified content Composable in a virtual display and returning the resulting bytes.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

captureSingleRemoteDocument

Android
public suspend fun captureSingleRemoteDocument(
    context: Context,
    creationDisplayInfo: CreationDisplayInfo =
        createCreationDisplayInfo(context).toCreationDisplayInfo(),
    profile: Profile = RcPlatformProfiles.ANDROIDX,
    content: @Composable @RemoteComposable () -> Unit,
): CapturedDocument

Capture a RemoteCompose document by rendering the specified content Composable in a virtual display and returning the resulting bytes.

This can be used for testing, or for generating documents on the fly to be sent to a remote client.

This API is experimental and is likely to change in the future before becoming API stable.

Parameters

context the Android Context to use for the capture.
creationDisplayInfo details about the virtual display to create.
profile the Profile to use for the capture, determining which operations are supported.
content the Composable content to render and capture.

Returns

a ByteArray containing the RemoteCompose document.