Class ConfirmationTicketGenerator

java.lang.Object
com.example.lottery.util.ConfirmationTicketGenerator

public final class ConfirmationTicketGenerator extends Object
Utility class responsible for generating styled confirmation ticket PDFs.

This class creates a polished confirmation ticket design with:

  • a colored header,
  • a rounded ticket body,
  • section labels and values,
  • wrapped text for long fields such as event IDs,
  • and a footer note.

The generated PDF is stored in the app's external documents directory.

  • Method Details

    • generateTicket

      public static File generateTicket(android.content.Context context, String eventTitle, String userName, String eventId) throws IOException
      Generates a styled confirmation ticket PDF.
      Parameters:
      context - application context used for locating the output directory
      eventTitle - title of the event
      userName - name of the entrant
      eventId - unique event identifier
      Returns:
      file pointing to the generated PDF
      Throws:
      IOException - if the PDF cannot be written to storage