diff --git a/lib/features/insurance_auth/services/insurance_auth_pdf_service.dart b/lib/features/insurance_auth/services/insurance_auth_pdf_service.dart index 12c075e..2c40d25 100644 --- a/lib/features/insurance_auth/services/insurance_auth_pdf_service.dart +++ b/lib/features/insurance_auth/services/insurance_auth_pdf_service.dart @@ -6,8 +6,8 @@ import 'package:pdf/widgets.dart' as pw; import 'package:printing/printing.dart'; class InsuranceAuthPdfService { - /// Genera el documento PDF de Autorización de Seguro en formato Media Carta Horizontal - /// (8.5 x 5.5 pulgadas / 612 x 396 pt), idéntico a AlfaMedical. + /// Genera el documento PDF de Autorización de Seguro en formato Media Carta Vertical + /// (5.5 x 8.5 pulgadas / 396 x 612 pt). static Future buildInsuranceAuthPdf({ required String doctorName, required String specialty, @@ -28,16 +28,15 @@ class InsuranceAuthPdfService { final pdf = pw.Document(title: 'Autorización de seguro - $patientName'); final formattedDate = DateFormat('dd/MM/yyyy').format(date ?? DateTime.now()); - // Formato exacto e idéntico a AlfaMedical (ReportLab): - // pagesize = (8.5*inch, 5.5*inch) - // leftMargin = 72, rightMargin = 72, topMargin = 18, bottomMargin = 18. + // Formato Media Carta Vertical (5.5 x 8.5 pulgadas / 396 x 612 pt): + // Margen equilibrado de media pulgada (36 pt) a los lados y 20 pt vertical const pageFormat = PdfPageFormat( - 8.5 * PdfPageFormat.inch, 5.5 * PdfPageFormat.inch, - marginLeft: 72, - marginRight: 72, - marginTop: 18, - marginBottom: 18, + 8.5 * PdfPageFormat.inch, + marginLeft: 36, + marginRight: 36, + marginTop: 20, + marginBottom: 20, ); // Tipografías estándar con fallback a fuentes base PDF si no hay conexión a internet diff --git a/lib/features/prescription/services/prescription_pdf_service.dart b/lib/features/prescription/services/prescription_pdf_service.dart index 400b49e..7c262e0 100644 --- a/lib/features/prescription/services/prescription_pdf_service.dart +++ b/lib/features/prescription/services/prescription_pdf_service.dart @@ -6,8 +6,8 @@ import 'package:pdf/widgets.dart' as pw; import 'package:printing/printing.dart'; class PrescriptionPdfService { - /// Genera el documento PDF de la receta médica en formato Media Carta Horizontal - /// (8.5 x 5.5 pulgadas / 612 x 396 pt). + /// Genera el documento PDF de la receta médica en formato Media Carta Vertical + /// (5.5 x 8.5 pulgadas / 396 x 612 pt). static Future buildPrescriptionPdf({ required String doctorName, required String specialty, @@ -24,17 +24,15 @@ class PrescriptionPdfService { final pdf = pw.Document(title: 'Receta Médica - $patientName'); final formattedDate = DateFormat('dd/MM/yyyy').format(date ?? DateTime.now()); - // Formato exacto e idéntico a AlfaMedical: - // Media Carta Horizontal (8.5 x 5.5 pulgadas / 612 x 396 pt) - // Márgenes idénticos a AlfaMedical (ReportLab): - // leftMargin = 72, rightMargin = 72, topMargin = 18, bottomMargin = 18. + // Formato Media Carta Vertical (5.5 x 8.5 pulgadas / 396 x 612 pt): + // Margen equilibrado de media pulgada (36 pt) a los lados y 20 pt vertical const pageFormat = PdfPageFormat( - 8.5 * PdfPageFormat.inch, 5.5 * PdfPageFormat.inch, - marginLeft: 72, - marginRight: 72, - marginTop: 18, - marginBottom: 18, + 8.5 * PdfPageFormat.inch, + marginLeft: 36, + marginRight: 36, + marginTop: 20, + marginBottom: 20, ); // Tipografías estándar con fallback a fuentes base PDF si no hay conexión a internet diff --git a/lib/features/referrals/services/department_referral_pdf_service.dart b/lib/features/referrals/services/department_referral_pdf_service.dart index f9af8bd..9466851 100644 --- a/lib/features/referrals/services/department_referral_pdf_service.dart +++ b/lib/features/referrals/services/department_referral_pdf_service.dart @@ -6,8 +6,8 @@ import 'package:pdf/widgets.dart' as pw; import 'package:printing/printing.dart'; class DepartmentReferralPdfService { - /// Genera el documento PDF de Referimiento a Departamento en formato Media Carta Horizontal - /// (8.5 x 5.5 pulgadas / 612 x 396 pt), idéntico a AlfaMedical. + /// Genera el documento PDF de Referimiento a Departamento en formato Media Carta Vertical + /// (5.5 x 8.5 pulgadas / 396 x 612 pt). static Future buildDepartmentReferralPdf({ required String doctorName, required String specialty, @@ -23,16 +23,15 @@ class DepartmentReferralPdfService { final pdf = pw.Document(title: 'Referir a Departamento'); final formattedDate = DateFormat('dd/MM/yyyy').format(date ?? DateTime.now()); - // Formato exacto e idéntico a AlfaMedical (ReportLab): - // pagesize = (8.5*inch, 5.5*inch) - // leftMargin = 72, rightMargin = 72, topMargin = 18, bottomMargin = 18. + // Formato Media Carta Vertical (5.5 x 8.5 pulgadas / 396 x 612 pt): + // Margen equilibrado de media pulgada (36 pt) a los lados y 20 pt vertical const pageFormat = PdfPageFormat( - 8.5 * PdfPageFormat.inch, 5.5 * PdfPageFormat.inch, - marginLeft: 72, - marginRight: 72, - marginTop: 18, - marginBottom: 18, + 8.5 * PdfPageFormat.inch, + marginLeft: 36, + marginRight: 36, + marginTop: 20, + marginBottom: 20, ); // Tipografías estándar con fallback a fuentes base PDF si no hay conexión a internet diff --git a/lib/features/referrals/services/doctor_referral_pdf_service.dart b/lib/features/referrals/services/doctor_referral_pdf_service.dart index 89217f4..3f7d7cf 100644 --- a/lib/features/referrals/services/doctor_referral_pdf_service.dart +++ b/lib/features/referrals/services/doctor_referral_pdf_service.dart @@ -6,8 +6,8 @@ import 'package:pdf/widgets.dart' as pw; import 'package:printing/printing.dart'; class DoctorReferralPdfService { - /// Genera el documento PDF de Referimiento a Doctor (a) en formato Media Carta Horizontal - /// (8.5 x 5.5 pulgadas / 612 x 396 pt), idéntico a AlfaMedical. + /// Genera el documento PDF de Referimiento a Doctor (a) en formato Media Carta Vertical + /// (5.5 x 8.5 pulgadas / 396 x 612 pt). static Future buildDoctorReferralPdf({ required String doctorName, required String specialty, @@ -23,16 +23,15 @@ class DoctorReferralPdfService { final pdf = pw.Document(title: 'Referir a Doctor (a)'); final formattedDate = DateFormat('dd/MM/yyyy').format(date ?? DateTime.now()); - // Formato exacto e idéntico a AlfaMedical (ReportLab): - // pagesize = (8.5*inch, 5.5*inch) - // leftMargin = 72, rightMargin = 72, topMargin = 18, bottomMargin = 18. + // Formato Media Carta Vertical (5.5 x 8.5 pulgadas / 396 x 612 pt): + // Margen equilibrado de media pulgada (36 pt) a los lados y 20 pt vertical const pageFormat = PdfPageFormat( - 8.5 * PdfPageFormat.inch, 5.5 * PdfPageFormat.inch, - marginLeft: 72, - marginRight: 72, - marginTop: 18, - marginBottom: 18, + 8.5 * PdfPageFormat.inch, + marginLeft: 36, + marginRight: 36, + marginTop: 20, + marginBottom: 20, ); // Tipografías estándar con fallback a fuentes base PDF si no hay conexión a internet diff --git a/test/features/insurance_auth_test.dart b/test/features/insurance_auth_test.dart index 0436186..d836979 100644 --- a/test/features/insurance_auth_test.dart +++ b/test/features/insurance_auth_test.dart @@ -58,7 +58,7 @@ void main() { }); group('InsuranceAuthPdfService Tests', () { - test('builds insurance auth pdf bytes with 8.5x5.5 inch format', () async { + test('builds insurance auth pdf bytes with media carta vertical format', () async { final bytes = await InsuranceAuthPdfService.buildInsuranceAuthPdf( doctorName: 'Dr. Luis A. Castro Sosa', specialty: 'Cirujano Urólogo',