PDF rendering for page 2 is fixed

This commit is contained in:
2026-01-03 23:29:02 +01:00
parent a4f3f8125f
commit c6f6fe1e13
7 changed files with 140 additions and 86 deletions
+69
View File
@@ -0,0 +1,69 @@
#!/bin/bash
# check_chrome.sh - Verify Chrome/Chromium is available for PDF export
echo "=== Chrome/Chromium Availability Check ==="
echo ""
# Check for Chrome in common locations
CHROME_PATHS=(
"/usr/bin/google-chrome"
"/usr/bin/google-chrome-stable"
"/usr/bin/chromium"
"/usr/bin/chromium-browser"
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
"/snap/bin/chromium"
)
FOUND=false
for path in "${CHROME_PATHS[@]}"; do
if [ -x "$path" ]; then
echo "✓ Found Chrome at: $path"
VERSION=$("$path" --version 2>/dev/null || echo "Unknown")
echo " Version: $VERSION"
FOUND=true
# Suggest setting CHROME_BIN if not already set
if [ -z "$CHROME_BIN" ]; then
echo " Suggestion: export CHROME_BIN=\"$path\""
fi
echo ""
fi
done
# Check PATH
echo "Checking PATH for chrome/chromium..."
if command -v google-chrome &> /dev/null; then
echo "✓ 'google-chrome' found in PATH"
google-chrome --version
FOUND=true
elif command -v chromium-browser &> /dev/null; then
echo "✓ 'chromium-browser' found in PATH"
chromium-browser --version
FOUND=true
elif command -v chromium &> /dev/null; then
echo "✓ 'chromium' found in PATH"
chromium --version
FOUND=true
else
echo "✗ No chrome/chromium found in PATH"
fi
echo ""
echo "Current CHROME_BIN: ${CHROME_BIN:-not set}"
echo ""
if [ "$FOUND" = true ]; then
echo "✓ Chrome/Chromium is available - PDF export should work"
exit 0
else
echo "✗ Chrome/Chromium NOT found - PDF export will FAIL"
echo ""
echo "Please install Chrome or Chromium:"
echo " Debian/Ubuntu: sudo apt-get install chromium-browser"
echo " Alpine: apk add chromium"
echo " macOS: brew install --cask google-chrome"
echo ""
echo "Or set CHROME_BIN to point to your Chrome installation"
exit 1
fi
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
# Test PDF export via running server
echo "Testing PDF export with go run..."
echo ""
# Start the server in background
cd /data/dev/bamort/backend
/usr/local/go/bin/go run ./cmd/main.go &
SERVER_PID=$!
echo "Server started with PID: $SERVER_PID"
echo "Waiting for server to start..."
sleep 5
# Check if server is running
if ! kill -0 $SERVER_PID 2>/dev/null; then
echo "✗ Server failed to start"
exit 1
fi
echo "Server is running, testing PDF export..."
# Get auth token (you'll need to implement this based on your auth)
# For now, just try to access the endpoint
curl -s "http://localhost:8180/api/pdf/templates" || echo "Server not responding yet..."
echo ""
echo "Press Ctrl+C to stop the server (PID: $SERVER_PID)"
echo "Then manually test: curl -H 'Authorization: Bearer YOUR_TOKEN' 'http://localhost:8180/api/pdf/export/18?template=Default_A4_Quer'"
# Wait for user interrupt
wait $SERVER_PID