Actualizar index2.html
This commit is contained in:
@@ -173,7 +173,7 @@
|
||||
<div id="toast" class="fixed bottom-24 left-1/2 -translate-x-1/2 bg-slate-900 text-white px-6 py-3 rounded-full shadow-2xl hidden z-[200] font-bold text-xs uppercase tracking-widest text-center transition-all whitespace-nowrap"></div>
|
||||
|
||||
<div id="pdf-wrapper" class="hidden">
|
||||
<div id="pdf-content" style="background-color: white; color: #1e293b; font-family: Arial, Helvetica, sans-serif; width: 800px; min-height: 1120px; position: relative; padding: 30px 40px; box-sizing: border-box;">
|
||||
<div id="pdf-content" style="background-color: white; color: #1e293b; font-family: Arial, Helvetica, sans-serif; width: 800px; min-height: 1122px; display: flex; flex-direction: column; padding: 30px 40px 40px 40px; box-sizing: border-box;">
|
||||
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #e2e8f0; padding-bottom: 15px; margin-bottom: 20px;">
|
||||
<div style="max-width: 250px; max-height: 80px;">
|
||||
@@ -236,7 +236,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="position: absolute; bottom: 30px; left: 40px; right: 40px;">
|
||||
<div style="margin-top: auto; padding-top: 20px;">
|
||||
<div id="pdf-bank-info" style="margin-bottom: 10px; padding: 12px 15px; background-color: #f0fdf4; border-left: 4px solid #22c55e; border-radius: 0 6px 6px 0; font-size: 11px; color: #166534; display: none;">
|
||||
<strong>INFORMACIÓN DE PAGO</strong><br>
|
||||
Para confirmar el presupuesto, por favor realice una transferencia a la siguiente cuenta:<br>
|
||||
@@ -579,13 +579,15 @@
|
||||
wrapper.classList.remove('hidden');
|
||||
wrapper.style.position = 'absolute';
|
||||
wrapper.style.left = '-9999px';
|
||||
wrapper.style.top = '0'; // 🛑 FIX: Evita que herede margen superior si el usuario hizo scroll
|
||||
|
||||
const element = document.getElementById('pdf-content');
|
||||
const opt = {
|
||||
margin: 0,
|
||||
filename: `Presupuesto_${budget.quote_ref || budget.id}.pdf`,
|
||||
image: { type: 'jpeg', quality: 1 },
|
||||
html2canvas: { scale: 2, useCORS: true, logging: false },
|
||||
// 🛑 FIX: Añadimos scrollY: 0 y windowY: 0 para que haga la "foto" clavada arriba
|
||||
html2canvas: { scale: 2, useCORS: true, logging: false, scrollY: 0, windowY: 0 },
|
||||
jsPDF: { unit: 'in', format: 'a4', orientation: 'portrait' }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user