XWX-AI commited on
Commit
5f5cfd9
·
1 Parent(s): b8fedae

Reduce PDF margins: L/R 5mm, T/B 15mm

Browse files
Files changed (1) hide show
  1. server.js +5 -5
server.js CHANGED
@@ -45,7 +45,7 @@ app.post('/api/generate_pdf', async (req, res) => {
45
  // Inject styles to ensure 100% width and print media simulation
46
  await page.addStyleTag({
47
  content: `
48
- @page { margin: 20mm; size: A4; }
49
  body { -webkit-print-color-adjust: exact; }
50
  `
51
  });
@@ -55,10 +55,10 @@ app.post('/api/generate_pdf', async (req, res) => {
55
  format: 'A4',
56
  printBackground: true,
57
  margin: {
58
- top: '20mm',
59
- bottom: '20mm',
60
- left: '10mm',
61
- right: '10mm'
62
  }
63
  });
64
 
 
45
  // Inject styles to ensure 100% width and print media simulation
46
  await page.addStyleTag({
47
  content: `
48
+ @page { margin: 0; size: A4; }
49
  body { -webkit-print-color-adjust: exact; }
50
  `
51
  });
 
55
  format: 'A4',
56
  printBackground: true,
57
  margin: {
58
+ top: '15mm',
59
+ bottom: '15mm',
60
+ left: '5mm',
61
+ right: '5mm'
62
  }
63
  });
64