diff --git a/public/brand/zenquality-logo-dark.png b/public/brand/zenquality-logo-dark.png new file mode 100644 index 00000000..9161f607 Binary files /dev/null and b/public/brand/zenquality-logo-dark.png differ diff --git a/public/brand/zenquality-logo.svg b/public/brand/zenquality-logo.svg deleted file mode 100644 index b408241e..00000000 --- a/public/brand/zenquality-logo.svg +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/pdf/export.ts b/src/pdf/export.ts index 3f546dbf..fe201543 100644 --- a/src/pdf/export.ts +++ b/src/pdf/export.ts @@ -112,7 +112,7 @@ export async function exportReportToPdf( console.warn('Faunosteo logo embed failed:', err) } try { - const zqPngBytes = await loadZenqualityLogo(300) + const zqPngBytes = await loadZenqualityLogo() zqLogoPdfImage = await pdfDoc.embedPng(zqPngBytes) } catch (err) { console.warn('ZenQuality logo embed failed:', err) diff --git a/src/pdf/render/footer.ts b/src/pdf/render/footer.ts index a140f805..d31588e4 100644 --- a/src/pdf/render/footer.ts +++ b/src/pdf/render/footer.ts @@ -6,7 +6,6 @@ import { addLinkAnnotation } from './linkAnnotation' const MARGIN_X = 36 const FOOTER_BASE_Y = 20 -const LINE_HEIGHT = 12 const FONT_SIZE = 8 export interface FooterAssets { @@ -29,8 +28,8 @@ export function drawFooter( const logoW = 60 const logoH = 23 - const topRowY = FOOTER_BASE_Y + LINE_HEIGHT + 2 - const separatorY = topRowY + logoH + 6 + const rowY = FOOTER_BASE_Y + 14 + const separatorY = rowY + logoH + 6 page.drawLine({ start: { x: MARGIN_X, y: separatorY }, @@ -42,35 +41,18 @@ export function drawFooter( if (assets.logoPng) { page.drawImage(assets.logoPng, { x: MARGIN_X, - y: topRowY, + y: rowY, width: logoW, height: logoH, }) addLinkAnnotation(page, { x: MARGIN_X, - y: topRowY, + y: rowY, width: logoW, height: logoH, url: 'https://faunosteo.com', }) } - const siteUrl = 'faunosteo.com' - const siteUrlX = MARGIN_X + (assets.logoPng ? logoW + 4 : 0) - const siteUrlW = fonts.bodyRegular.widthOfTextAtSize(siteUrl, FONT_SIZE) - page.drawText(siteUrl, { - x: siteUrlX, - y: topRowY + 6, - size: FONT_SIZE, - font: fonts.bodyRegular, - color: accent, - }) - addLinkAnnotation(page, { - x: siteUrlX, - y: topRowY + 4, - width: siteUrlW, - height: FONT_SIZE + 4, - url: 'https://faunosteo.com', - }) const poweredLabel = `${dict['footer.powered_by']} ` const poweredLabelW = fonts.bodyRegular.widthOfTextAtSize(poweredLabel, FONT_SIZE) @@ -82,10 +64,11 @@ export function drawFooter( ? poweredLabelW + zqLogoW : poweredLabelW + zqFallbackW const poweredX = (width - poweredBlockW) / 2 + const textBaseY = rowY + 6 page.drawText(poweredLabel, { x: poweredX, - y: topRowY + 6, + y: textBaseY, size: FONT_SIZE, font: fonts.bodyRegular, color: muted, @@ -94,13 +77,13 @@ export function drawFooter( if (assets.zqLogoPng) { page.drawImage(assets.zqLogoPng, { x: zqX, - y: topRowY + 2, + y: rowY + 2, width: zqLogoW, height: zqLogoH, }) addLinkAnnotation(page, { x: zqX, - y: topRowY + 2, + y: rowY + 2, width: zqLogoW, height: zqLogoH, url: 'https://zenquality.fr', @@ -108,43 +91,33 @@ export function drawFooter( } else { page.drawText(zqFallback, { x: zqX, - y: topRowY + 6, + y: textBaseY, size: FONT_SIZE, font: fonts.bodyRegular, color: accent, }) addLinkAnnotation(page, { x: zqX, - y: topRowY + 4, + y: textBaseY - 2, width: zqFallbackW, height: FONT_SIZE + 4, url: 'https://zenquality.fr', }) } - const partnerText = `${dict['footer.in_partnership']} Paws iin Harmony` - const partnerW = fonts.bodyRegular.widthOfTextAtSize(partnerText, FONT_SIZE) - page.drawText(partnerText, { - x: width - MARGIN_X - partnerW, - y: topRowY + 6, - size: FONT_SIZE, - font: fonts.bodyRegular, - color: muted, - }) - - const instagramHandle = '@paws.iin.harmony' - const handleW = fonts.bodyRegular.widthOfTextAtSize(instagramHandle, FONT_SIZE) + const handle = '@paws.iin.harmony' + const handleW = fonts.bodyRegular.widthOfTextAtSize(handle, FONT_SIZE) const handleX = width - MARGIN_X - handleW - page.drawText(instagramHandle, { + page.drawText(handle, { x: handleX, - y: FOOTER_BASE_Y + 2, + y: textBaseY, size: FONT_SIZE, font: fonts.bodyRegular, color: accent, }) addLinkAnnotation(page, { x: handleX, - y: FOOTER_BASE_Y, + y: textBaseY - 2, width: handleW, height: FONT_SIZE + 4, url: 'https://www.instagram.com/paws.iin.harmony', diff --git a/src/pdf/render/logo.ts b/src/pdf/render/logo.ts index 22e4b6c4..94cce72c 100644 --- a/src/pdf/render/logo.ts +++ b/src/pdf/render/logo.ts @@ -1,5 +1,5 @@ const FAUNOSTEO_LOGO = '/logo-horizontal.svg' -const ZENQUALITY_LOGO = '/brand/zenquality-logo.svg' +const ZENQUALITY_LOGO = '/brand/zenquality-logo-dark.png' async function rasterizeSvgToCanvas( svgString: string, @@ -75,6 +75,8 @@ export async function loadFaunosteoLogo(widthPx: number): Promise { return loadSvgLogoPng(FAUNOSTEO_LOGO, widthPx, '0 0 1070 410') } -export async function loadZenqualityLogo(widthPx: number): Promise { - return loadSvgLogoPng(ZENQUALITY_LOGO, widthPx, '0 0 400 100') +export async function loadZenqualityLogo(): Promise { + const resp = await fetch(ZENQUALITY_LOGO) + if (!resp.ok) throw new Error(`ZQ logo fetch failed: HTTP ${resp.status}`) + return new Uint8Array(await resp.arrayBuffer()) }