fix(pdf): letter page with content constrained strictly to top half (media carta vertical)
This commit is contained in:
@@ -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 {
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user