generateAndOpenPdf method
Generate and save PDF with automatic opening
Implementation
Future<bool> generateAndOpenPdf({
required LokotroPayOnResponse paymentResponse,
String? merchantName,
String? merchantAddress,
String? customerName,
String? customerEmail,
Map<String, dynamic>? additionalInfo,
String? fileName,
}) async {
try {
final pdfBytes = await generatePaymentReceipt(
paymentResponse: paymentResponse,
merchantName: merchantName,
merchantAddress: merchantAddress,
customerName: customerName,
customerEmail: customerEmail,
additionalInfo: additionalInfo,
);
return await savePdfAndOpen(pdfBytes, fileName: fileName);
} catch (e) {
return false;
}
}