betterbearmetalcode / Scouting-App

2 stars 1 forks source link

CDR Changes #22

Closed BentonDodge closed 3 months ago

BentonDodge commented 4 months ago

I tried to get the previous match data to display but for some reason it wants me to die and doesn't show except for on the comments and even then, it will only show after it's been popped. I'm confuzzled and I need to work on it more.

BentonDodge commented 4 months ago

package composables

import androidx.compose.foundation.Image import androidx.compose.foundation.layout. import androidx.compose.material. import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.graphics.toComposeImageBitmap import com.lowagie.text.Document import com.lowagie.text.Paragraph import com.lowagie.text.pdf.PdfWriter import org.jetbrains.compose.resources.painterResource import org.jetbrains.skia.Image import java.awt.image.BufferedImage import java.beans.Beans.getInstanceOf import java.io.File import java.io.FileOutputStream import javax.imageio.ImageIO

@OptIn(ExperimentalMaterialApi::class) @Composable fun Profile( photoArray: ArrayList, teamName: String, teamNumber: String, driveType: String, intakePref: String, robotWidth: String, robotLength: String, ampStrength: Boolean, speakerStrength: Boolean, climbStrength: Boolean, trapStrength: Boolean, concerns: String, scout: String ){ val file = File("PrimaryPhoto.png") // 1) Create a FileOutputStream object with the path and name of the file val pdfOutputFile = FileOutputStream("./sample1.pdf")

//2) Instance a object from the class com.lowagie.text.Document
val myPDFDoc = Document()

//3) Now we get a file writer instance from the class com.lowagie.text.pdf.PdfWriter
val pdfWriter = PdfWriter.getInstance(myPDFDoc, pdfOutputFile)

//4) Once the Filewritter is set up we can open
//   the document and start adding content
myPDFDoc.apply {
    open() // Open the Document
    // Add a text within a Paragraph
    // (we can add objects from classes
    // implementing the interface com.lowagie.text.Element )
    add(Paragraph("I am $robotWidth by $robotLength, I like to intake using $intakePref. I enjoy long, luxurious walks on the beach with my intense $driveType drive. As you'll find out I am very efficient in multiple ways;\n Amp: $ampStrength \n Speaker: $speakerStrength \n Climb: $climbStrength \n Trap: $trapStrength \n You should generally be concerned about my $concerns."))

    fun onEndPage(writer:PdfWriter, doc: Document) {
        add(Paragraph("Scout Name: $scout"))
    }
    close() // Close the Document
}
pdfWriter.close() // close the File writer

} Stuff I want to save for Pits Profile for desktop but I want to update my branch

BentonDodge commented 3 months ago

I think we've deviated enough from CDR to close issue. NOT BRANCH