Package com.example.lottery.util
Class ConfirmationTicketGenerator
java.lang.Object
com.example.lottery.util.ConfirmationTicketGenerator
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 Summary
Modifier and TypeMethodDescriptionstatic FilegenerateTicket(android.content.Context context, String eventTitle, String userName, String eventId) Generates a styled confirmation ticket PDF.
-
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 directoryeventTitle- title of the eventuserName- name of the entranteventId- unique event identifier- Returns:
- file pointing to the generated PDF
- Throws:
IOException- if the PDF cannot be written to storage
-