fix(pdf): change document page format to Media Carta Vertical (5.5x8.5 inches)
This commit is contained in:
@@ -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<Uint8List> 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
|
||||
|
||||
Reference in New Issue
Block a user