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 2c40d25..c7e4c40 100644 --- a/lib/features/insurance_auth/services/insurance_auth_pdf_service.dart +++ b/lib/features/insurance_auth/services/insurance_auth_pdf_service.dart @@ -28,13 +28,14 @@ class InsuranceAuthPdfService { final pdf = pw.Document(title: 'Autorización de seguro - $patientName'); final formattedDate = DateFormat('dd/MM/yyyy').format(date ?? DateTime.now()); - // 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 + // Formato Carta Vertical (8.5 x 11.0 pulgadas / 612 x 792 pt): + // Todo el contenido abarca estrictamente la mitad superior de la hoja (5.5 pulgadas / 396 pt), + // dejando la mitad inferior libre para corte o papel pre-cortado. const pageFormat = PdfPageFormat( - 5.5 * PdfPageFormat.inch, 8.5 * PdfPageFormat.inch, - marginLeft: 36, - marginRight: 36, + 11.0 * PdfPageFormat.inch, + marginLeft: 54, + marginRight: 54, marginTop: 20, marginBottom: 20, ); @@ -72,8 +73,14 @@ class InsuranceAuthPdfService { return pw.Column( crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ - // 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med - pw.Stack( + // Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt) + pw.Container( + height: 5.5 * PdfPageFormat.inch - 36, + child: pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.stretch, + children: [ + // 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med + pw.Stack( children: [ // Nombre y especialidad del doctor centrado pw.Align( @@ -338,7 +345,10 @@ class InsuranceAuthPdfService { ), ), ], - ); + ), + ), + ], + ); }, ), ); diff --git a/lib/features/prescription/services/prescription_pdf_service.dart b/lib/features/prescription/services/prescription_pdf_service.dart index 7c262e0..cb1a3bf 100644 --- a/lib/features/prescription/services/prescription_pdf_service.dart +++ b/lib/features/prescription/services/prescription_pdf_service.dart @@ -24,13 +24,14 @@ class PrescriptionPdfService { final pdf = pw.Document(title: 'Receta Médica - $patientName'); final formattedDate = DateFormat('dd/MM/yyyy').format(date ?? DateTime.now()); - // 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 + // Formato Carta Vertical (8.5 x 11.0 pulgadas / 612 x 792 pt): + // Todo el contenido abarca estrictamente la mitad superior de la hoja (5.5 pulgadas / 396 pt), + // dejando la mitad inferior libre para corte o papel pre-cortado. const pageFormat = PdfPageFormat( - 5.5 * PdfPageFormat.inch, 8.5 * PdfPageFormat.inch, - marginLeft: 36, - marginRight: 36, + 11.0 * PdfPageFormat.inch, + marginLeft: 54, + marginRight: 54, marginTop: 20, marginBottom: 20, ); @@ -69,7 +70,13 @@ class PrescriptionPdfService { return pw.Column( crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ - // 1. Cabecera con Nombre del Doctor y Badge Superior de Hidalyx Med + // Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt) + pw.Container( + height: 5.5 * PdfPageFormat.inch - 36, + child: pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.stretch, + children: [ + // 1. Cabecera con Nombre del Doctor y Badge Superior de Hidalyx Med pw.Stack( children: [ // Nombre y especialidad del doctor centrado @@ -261,7 +268,10 @@ class PrescriptionPdfService { ), ), ], - ); + ), + ), + ], + ); }, ), ); diff --git a/lib/features/referrals/services/department_referral_pdf_service.dart b/lib/features/referrals/services/department_referral_pdf_service.dart index 9466851..ee155e8 100644 --- a/lib/features/referrals/services/department_referral_pdf_service.dart +++ b/lib/features/referrals/services/department_referral_pdf_service.dart @@ -23,13 +23,14 @@ class DepartmentReferralPdfService { final pdf = pw.Document(title: 'Referir a Departamento'); final formattedDate = DateFormat('dd/MM/yyyy').format(date ?? DateTime.now()); - // 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 + // Formato Carta Vertical (8.5 x 11.0 pulgadas / 612 x 792 pt): + // Todo el contenido abarca estrictamente la mitad superior de la hoja (5.5 pulgadas / 396 pt), + // dejando la mitad inferior libre para corte o papel pre-cortado. const pageFormat = PdfPageFormat( - 5.5 * PdfPageFormat.inch, 8.5 * PdfPageFormat.inch, - marginLeft: 36, - marginRight: 36, + 11.0 * PdfPageFormat.inch, + marginLeft: 54, + marginRight: 54, marginTop: 20, marginBottom: 20, ); @@ -67,8 +68,14 @@ class DepartmentReferralPdfService { return pw.Column( crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ - // 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med - pw.Stack( + // Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt) + pw.Container( + height: 5.5 * PdfPageFormat.inch - 36, + child: pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.stretch, + children: [ + // 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med + pw.Stack( children: [ pw.Align( alignment: pw.Alignment.center, @@ -210,7 +217,10 @@ class DepartmentReferralPdfService { ), ), ], - ); + ), + ), + ], + ); }, ), ); diff --git a/lib/features/referrals/services/doctor_referral_pdf_service.dart b/lib/features/referrals/services/doctor_referral_pdf_service.dart index 3f7d7cf..3c834a2 100644 --- a/lib/features/referrals/services/doctor_referral_pdf_service.dart +++ b/lib/features/referrals/services/doctor_referral_pdf_service.dart @@ -23,13 +23,14 @@ class DoctorReferralPdfService { final pdf = pw.Document(title: 'Referir a Doctor (a)'); final formattedDate = DateFormat('dd/MM/yyyy').format(date ?? DateTime.now()); - // 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 + // Formato Carta Vertical (8.5 x 11.0 pulgadas / 612 x 792 pt): + // Todo el contenido abarca estrictamente la mitad superior de la hoja (5.5 pulgadas / 396 pt), + // dejando la mitad inferior libre para corte o papel pre-cortado. const pageFormat = PdfPageFormat( - 5.5 * PdfPageFormat.inch, 8.5 * PdfPageFormat.inch, - marginLeft: 36, - marginRight: 36, + 11.0 * PdfPageFormat.inch, + marginLeft: 54, + marginRight: 54, marginTop: 20, marginBottom: 20, ); @@ -67,8 +68,14 @@ class DoctorReferralPdfService { return pw.Column( crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ - // 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med - pw.Stack( + // Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt) + pw.Container( + height: 5.5 * PdfPageFormat.inch - 36, + child: pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.stretch, + children: [ + // 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med + pw.Stack( children: [ pw.Align( alignment: pw.Alignment.center, @@ -210,7 +217,10 @@ class DoctorReferralPdfService { ), ), ], - ); + ), + ), + ], + ); }, ), );