i18n B2B e-commerce platform for waterless urinal products across 32 European countries with automated VAT handling, PDF invoicing, and CRM integration.
On-demand PDF sales presentation in 28 languages – one codebase, one URL pattern. Rendered per request by a Next.js route handler, nothing stored.
Key Results

The pi-pi.ee sales team sells waterless urinal systems across Europe. Reaching distributors and facility managers means communicating in their language – and that communication starts with a product presentation.
The existing workflow: a single PowerPoint file, maintained manually, in one language. When the sales team needed to send a deck to a prospect in Poland or Estonia, someone had to translate it, reformat it, and export it to PDF. Each iteration of the product – new prices, updated specs, different material grades – required the same process all over again. With 28 languages to cover, the problem was structurally unsolvable with manual tooling.
The core requirements:
pi-pi.ee/en/presentation.pdf, pi-pi.ee/et/presentation.pdf, pi-pi.ee/de/presentation.pdf opens directly in the browser; no login, no form, no download pageI built a Next.js App Router route handler at /[locale]/presentation.pdf that generates the PDF on demand and returns it in the HTTP response. The key architectural decision: the presentation reads the site’s own message files – a small dedicated presentation namespace for the slide copy, plus the product, material and about texts that the website already uses – so there is no separate CMS and no per-deck translation work.
The PDF is assembled with @react-pdf/renderer – React components describe the layout declaratively, and the whole document is rendered to an in-memory buffer on the server. No file is saved to disk, and nothing is uploaded to a storage bucket: the PDF exists only for the duration of the request. The response carries Cache-Control: public, max-age=86400, so a repeat open of the same link can be served from cache for up to a day.
The presentation is four A4 pages, each with a distinct purpose:
Slide 1 – Cover. Company logo, tagline, a short subtitle, company details (name, VAT ID, website, email), and two product photos.
Slide 2 – Range overview. Every active urinal and sink from the product data, each with a photo, name, and summary taken from the site’s product texts, followed by the available colours with their RAL codes.
Slide 3 – LLDPE Material. Four stat cards (mounting, temperature range, wall thickness, product weight), followed by a comparison table of LLDPE versus polypropylene.
Slide 4 – Manufacturer. Six cards on why buyers choose Pi-Pi as their manufacturer: logistics, history, batch quality control, minimum order, custom colour, and sample cost. Three of them take their text from the site’s about messages.
The presentation is live at pi-pi.ee/[locale]/presentation.pdf for all 28 locales. B2B managers now share a single URL in their outreach emails. The recipient gets a formatted presentation in their language – with product texts and material data that come from the live site – without any manual preparation or translator involvement.
| Metric | Value |
|---|---|
| Locales | 28 |
| Storage required | None – generated on demand |
| Translators involved | Zero – reads the site’s message files |
| Content sync | Automatic on each deploy |
| Deployment | Self-hosted Next.js (Coolify, standalone build) |
For the technically curious, here is how the core pieces are built.
The route reads the locale from the URL, returns 404 for a locale the site does not support, loads the message files for that locale, renders the PresentationDocument component tree into a buffer, and returns the bytes in the response:
// src/app/[locale]/presentation.pdf/route.ts
const { locale } = await params;
if (!isSupportedLocale(locale)) {
return new NextResponse(null, { status: 404 });
}
const buffer = await generatePresentationPDF(locale);
return new NextResponse(new Uint8Array(buffer), {
headers: {
"Content-Type": "application/pdf",
"Content-Disposition": `inline; filename="pi-pi-presentation-${locale}.pdf"`,
"Cache-Control": "public, max-age=86400",
"X-Robots-Tag": "noindex, nofollow",
},
});
// src/lib/pdf/generate-presentation.ts
const pdfBuffer = await renderToBuffer(
PresentationDocument({ messages, overviewProducts, lldpeSlide, aboutTexts /* … */ })
);No PDF is saved to disk and none is uploaded to a storage bucket. The X-Robots-Tag header keeps the generated files out of search results.
The generator reads the same src/messages tree the site uses. Slide copy comes from a dedicated presentation namespace, and the product names, summaries, LLDPE data and about texts come from the main locale files, so there is no separate content system for the deck:
// src/lib/pdf/messages.ts
const filePath = join(process.cwd(), "src", "messages", subdir, `${locale}.json`);
// src/lib/pdf/generate-presentation.ts
const presentationRaw = getPresentationMessages(locale); // messages/presentation/{locale}.json
const mainMessages = getMessages(locale); // messages/{locale}.jsonWhen the site’s product texts or material data change, the next deploy carries them into the PDF for every locale; there is no separate deck to edit.
@react-pdf/renderer uses its own text rendering engine and does not inherit system fonts or browser fonts. Without explicit font registration, any character outside the Latin-1 range renders as an empty rectangle. The fix is to register a full Unicode font with an explicit CDN URL before the document renders:
// src/lib/pdf/theme.tsx
Font.register({
family: "Roboto",
fonts: [
{ src: "https://fonts.gstatic.com/.../Roboto-Regular.ttf", fontWeight: 400 },
{ src: "https://fonts.gstatic.com/.../Roboto-Bold.ttf", fontWeight: 700 },
],
});
// Disable automatic hyphenation globally.
// The built-in algorithm is English-only — applied to non-Latin locales
// it produces incorrect line breaks mid-word.
Font.registerHyphenationCallback((word) => [word]);The hyphenation callback is the less obvious one: @react-pdf/renderer runs a hyphenation pass on every text node by default. For non-English locales this produces broken line breaks. Returning [word] as a single-element array tells the engine to never split the word, which gives correct results for all 28 locales at once.
Because the presentation reads from the same i18n JSON files as the rest of the site, hot-reload should work automatically – edit a message, refresh the PDF URL, see the change. In practice, the PDF route kept parsed message objects in a module-level Map. The cache survived Next.js hot-reload, so edits to JSON files had no effect until a full server restart.
The fix is a single environment check:
// src/lib/pdf/messages.ts
const IS_DEV = process.env.NODE_ENV === "development";
const messagesCache = new Map<string, Record<string, unknown>>();
const cached = messagesCache.get(cacheKey);
if (!IS_DEV && cached) {
return cached;
}
// … read and parse the JSON file from disk …
if (!IS_DEV) {
messagesCache.set(cacheKey, messages);
}In development, the cache is bypassed entirely – every request re-reads the JSON from disk. In production the cache lives for the lifetime of the server process, which is the desired behaviour: repeated requests avoid redundant file reads.
AvailableNeed something similar?
I build custom solutions – from APIs to full products. Let’s talk about your project.
i18n B2B e-commerce platform for waterless urinal products across 32 European countries with automated VAT handling, PDF invoicing, and CRM integration.
Internal sales portal that turns a wholesale deal into its full trade paperwork from one form: pro forma, contract, commercial invoice, packing list, CMR.
Databases
Batch PDF generation in Node.js without OOM: concurrency limits, back-pressure, releasing renderers between docs, and why Promise.all(map) fails at scale.
Stack
Production transactional emails with React Email and Resend: PDF invoices via react-pdf, Vercel Blob temporary storage, and BullMQ Stripe webhooks.