fix pdf layout
All checks were successful
Build and Deploy / build (push) Successful in 1m43s

This commit is contained in:
Joakim Repomaa
2026-02-19 22:21:44 +02:00
parent 96171576c7
commit f604e50172
3 changed files with 6 additions and 9 deletions

View File

@@ -18,9 +18,7 @@
let { profile, experience, education, skills, ownProjects, contributions }: Props = $props();
</script>
<div
class="font-sans max-w-[210mm] mx-auto px-[20mm] py-[18mm] bg-pdf-bg text-pdf-fg leading-relaxed text-sm"
>
<div class="font-sans max-w-[210mm] mx-auto bg-pdf-bg text-pdf-fg leading-relaxed text-sm">
<!-- Header -->
<header class="mb-6 pb-4 border-b-2 border-pdf-fg">
<div class="flex items-start justify-between gap-4">

View File

@@ -9,6 +9,5 @@
<style>
@page {
size: A4;
margin: 15mm;
}
</style>

View File

@@ -1,5 +1,5 @@
import type { RequestHandler } from './$types.js';
import type { LaunchOptions } from 'puppeteer';
import type { LaunchOptions, PDFOptions } from 'puppeteer';
import { dev } from '$app/environment';
import puppeteer from 'puppeteer';
import * as cheerio from 'cheerio';
@@ -12,14 +12,14 @@ export const prerender = true;
const cwd = process.cwd();
// PDF generation configuration
const PDF_CONFIG = {
format: 'A4' as const,
const PDF_CONFIG: PDFOptions = {
format: 'A4',
printBackground: true,
preferCSSPageSize: true,
margin: {
top: '20mm',
top: '15mm',
right: '20mm',
bottom: '20mm',
bottom: '15mm',
left: '20mm',
},
};