# Gedenkportal REST - PDF Convert API

This Laravel service accepts a PDF upload and returns a JPEG or WEBP image of the first page.

## Requirements

- PHP 8.2+
- Composer
- Imagick extension with PDF support (Ghostscript installed)
- Fileinfo extension

## Setup

Run these commands from the app directory:

```sh
cd app
composer install
copy .env.example .env
php artisan key:generate
php artisan serve
```

## Endpoint

`POST /api/convert`

Multipart form fields:

- `file` (required): PDF file
- `format` (optional): `jpeg` or `webp` (default `jpeg`)

Response:

- `200 OK` with image bytes

Example:

```sh
curl -X POST http://127.0.0.1:8000/api/convert \
	-F "file=@sample.pdf" \
	-F "format=webp" \
	--output page1.webp
```

## Frontend

Open the form at:

`GET /`

## Limits

- Max upload size: 20 MB
