Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

216
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!