Compare commits
6 Commits
v2.3.18-rc
...
77181fc983
| Author | SHA1 | Date | |
|---|---|---|---|
| 77181fc983 | |||
| 32b56696a6 | |||
| 9b28dd20d9 | |||
| 1970ae310f | |||
| 7bc8811a60 | |||
| 530503fa09 |
@@ -4,11 +4,28 @@ import configPromise from '@payload-config';
|
|||||||
import { renderToStream } from '@react-pdf/renderer';
|
import { renderToStream } from '@react-pdf/renderer';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { PDFPage } from '@/lib/pdf-page';
|
import { PDFPage } from '@/lib/pdf-page';
|
||||||
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
export async function GET(req: NextRequest, { params }: { params: Promise<{ slug: string }> }) {
|
export async function GET(req: NextRequest, { params }: { params: Promise<{ slug: string }> }) {
|
||||||
try {
|
try {
|
||||||
const { slug } = await params;
|
const { slug } = await params;
|
||||||
|
|
||||||
|
// Hardcoded bypass for AGBs to use the original uploaded PDF.
|
||||||
|
if (slug === 'agbs') {
|
||||||
|
const filePath = path.join(process.cwd(), 'public', 'AVB-KLZ-4-2026.pdf');
|
||||||
|
if (fs.existsSync(filePath)) {
|
||||||
|
const fileBuffer = fs.readFileSync(filePath);
|
||||||
|
return new NextResponse(fileBuffer, {
|
||||||
|
status: 200,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/pdf',
|
||||||
|
'Content-Disposition': `attachment; filename="AVB-KLZ-4-2026.pdf"`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get Payload App
|
// Get Payload App
|
||||||
const payload = await getPayload({ config: configPromise });
|
const payload = await getPayload({ config: configPromise });
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const styles = StyleSheet.create({
|
|||||||
color: C.gray900,
|
color: C.gray900,
|
||||||
lineHeight: 1.6,
|
lineHeight: 1.6,
|
||||||
backgroundColor: C.white,
|
backgroundColor: C.white,
|
||||||
paddingTop: 0,
|
paddingTop: 50,
|
||||||
paddingBottom: 80,
|
paddingBottom: 80,
|
||||||
fontFamily: 'Helvetica',
|
fontFamily: 'Helvetica',
|
||||||
},
|
},
|
||||||
@@ -35,10 +35,11 @@ const styles = StyleSheet.create({
|
|||||||
// Premium Header Layout
|
// Premium Header Layout
|
||||||
hero: {
|
hero: {
|
||||||
backgroundColor: C.offWhite,
|
backgroundColor: C.offWhite,
|
||||||
paddingTop: 40,
|
paddingTop: 24,
|
||||||
paddingBottom: 32,
|
paddingBottom: 24,
|
||||||
paddingHorizontal: MARGIN,
|
paddingHorizontal: MARGIN,
|
||||||
marginBottom: 40,
|
marginBottom: 40,
|
||||||
|
marginTop: -50, // Counters the page padding to achieve full-bleed top
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: C.gray200,
|
borderBottomColor: C.gray200,
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
@@ -71,12 +72,12 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
|
|
||||||
pageTitle: {
|
pageTitle: {
|
||||||
fontSize: 28,
|
fontSize: 16,
|
||||||
fontWeight: 700,
|
fontWeight: 700,
|
||||||
color: C.navyDeep,
|
color: C.navyDeep,
|
||||||
marginBottom: 4,
|
marginBottom: 4,
|
||||||
textTransform: 'uppercase',
|
textTransform: 'uppercase',
|
||||||
letterSpacing: -0.5,
|
letterSpacing: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
accentBar: {
|
accentBar: {
|
||||||
@@ -366,7 +367,7 @@ export const PDFPage: React.FC<PDFPageProps> = ({ page, locale = 'de' }) => {
|
|||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* Industrial footer with page numbers */}
|
{/* Industrial footer with page numbers */}
|
||||||
<View style={{ ...styles.footer, position: 'absolute', bottom: 30, height: 40 }} fixed>
|
<View style={{ ...styles.footer, position: 'absolute', bottom: 40, height: 40 }} fixed>
|
||||||
<View style={styles.footerInfo}>
|
<View style={styles.footerInfo}>
|
||||||
<Text style={styles.footerBrand}>KLZ VERTRIEBS GMBH</Text>
|
<Text style={styles.footerBrand}>KLZ VERTRIEBS GMBH</Text>
|
||||||
<Text style={styles.footerText}>
|
<Text style={styles.footerText}>
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
"prepare": "husky",
|
"prepare": "husky",
|
||||||
"preinstall": "npx only-allow pnpm"
|
"preinstall": "npx only-allow pnpm"
|
||||||
},
|
},
|
||||||
"version": "2.3.18-rc.7",
|
"version": "2.3.20",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"@parcel/watcher",
|
"@parcel/watcher",
|
||||||
|
|||||||
BIN
public/AVB-KLZ-4-2026.docx
Normal file
BIN
public/AVB-KLZ-4-2026.docx
Normal file
Binary file not shown.
BIN
public/AVB-KLZ-4-2026.pdf
Normal file
BIN
public/AVB-KLZ-4-2026.pdf
Normal file
Binary file not shown.
BIN
test-render.pdf
BIN
test-render.pdf
Binary file not shown.
Reference in New Issue
Block a user