Dmitriy Malayev
07/17/2023, 8:55 PMIconButton {
PictureAsPdf()
onClick = {
mainScope.launch {
val pdfReport = getSingleReportForView(report.reportFileName)
if (pdfReport != null) {
val blob = Blob(arrayOf(pdfReport), BlobPropertyBag("application/pdf"))
val url = URL.createObjectURL(blob)
// Create an iframe element
val iframe = document.createElement("iframe") as HTMLIFrameElement
iframe.src = url
iframe.style.width = "100%"
iframe.style.height = "500px" // Set the desired height for the iframe
// Append the iframe to the DOM (e.g., inside a specific container)
val container = document.getElementById("pdfcontainer") // Replace "pdfContainer" with the ID of the container element
container?.appendChild(iframe)
}
}
}
}
Big Chungus
07/17/2023, 10:59 PMDmitriy Malayev
07/18/2023, 1:09 AMBig Chungus
07/18/2023, 8:18 AMDmitriy Malayev
07/18/2023, 3:11 PM