Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

225
Vistas
Is there any way to convert Composables into Pdf file?

I want to allow users to download the ticket from the app in PDF format and store it locally. I want to have exactly similar view in PDF format, that's why I am searching for way to convert composables to PDF. It will be cool to directly convert compose view into Pdf format. Is this possible to achieve?

1.) KotOrderTicket.kt

@Composable
fun KotOrderTicket(modifier: Modifier = Modifier) {
    var totalQuantity: Int = 0

    val rowModifier = Modifier
        .fillMaxWidth()

    val textCenterModifier = Modifier
        .fillMaxWidth()
        .wrapContentWidth(align = Alignment.CenterHorizontally)

    LazyColumn(
        modifier = modifier
            .fillMaxWidth(),
    ){
        item {
            KotDashedDivider()
            Text("Kitchen Order Ticket - Dinning", modifier = textCenterModifier)
            KotDashedDivider()
            Text("Running", modifier = textCenterModifier)
            KotDashedDivider()

            Row(
                modifier = rowModifier,
                horizontalArrangement = Arrangement.SpaceBetween,
            ){
                Text("Kot# 22")
                Text("Table T7")
            }
            Text("Date 2022-04-3 10: 23: 22")
            Text("Ready Till 2022-04-3 10: 23: 22")
            KotDashedDivider()

            Row(
                modifier = rowModifier,
                horizontalArrangement = Arrangement.SpaceBetween,
            ){
                Text("SN")
                Text("Item's Name")
                Text("Qty")
            }
            KotDashedDivider()
        }

        itemsIndexed(summaryItems) { index, item ->
            totalQuantity += (item.qty?.toInt() ?: 0)
            KotItemSummary(sn = index.toString(), name = item.productId.toString(), qty = item.qty.toString(), comment = "\"Nun kam rakhnu hai\"")
        }

        item {
            KotDashedDivider()
            Row(
                modifier = rowModifier,
                horizontalArrangement = Arrangement.SpaceBetween,
            ){
                Text("")
                Text("Total Qty: ")
                Text(totalQuantity.toString())
            }
            KotSpacer()
            Text("Remarks: ")
            Text("\"Please cook fast, i am so hungry\"")
        }
    }
}

2.) This view will look like this.

How to convert composeables into pdf format and save it.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda