fix(pdf): change document page format to Media Carta Vertical (5.5x8.5 inches)

This commit is contained in:
=
2026-09-21 17:21:00 -04:00
parent f92ac1b06c
commit 7791fe9bc3
5 changed files with 37 additions and 42 deletions
@@ -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<Uint8List> 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