PdfShareAction

fun interface PdfShareAction

Action that hands a PDF off to the host platform's native share sheet.

The viewer captures one of these via rememberPdfShareAction and wires it to the optional share button. Each invocation writes bytes to a platform-appropriate scratch location, then surfaces the system share UI — Intent.ACTION_SEND via FileProvider on Android, UIActivityViewController on iOS.

Parameters

bytes

encoded PDF payload to share. The bytes are copied to the scratch file every time so callers can keep mutating their own buffer without affecting the share.

fileName

user-visible filename (must include the .pdf extension). Surfaces in the share sheet, in "Save to Files", and in the email-attachment / messaging-app filename field.

Functions

Link copied to clipboard
abstract operator fun invoke(bytes: ByteArray, fileName: String)