Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.pixcraft.es/llms.txt

Use this file to discover all available pages before exploring further.

Generate Pattern PDF

POST /api/v1/generate/pdf
Same as /generate but returns a binary PDF file instead of JSON. The PDF includes a materials list and complete assembly guide. If your API key has a custom_logo_url configured, it will be used in the PDF header instead of the PixCraft logo.

Request body

Same parameters as POST /generate.

Example request

curl -X POST https://www.pixcraft.es/api/v1/generate/pdf \
  -H "Authorization: Bearer px_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://example.com/sunset.jpg",
    "niche": "curtains",
    "width_cm": 200,
    "height_cm": 250,
    "max_colors": 8
  }' \
  --output pattern.pdf

Response

The response is a binary PDF file:
  • Content-Type: application/pdf
  • Content-Disposition: attachment; filename="pixcraft-curtains-133x125.pdf"
The PDF contains:
  1. Configuration summary — dimensions, grid size, unit size
  2. Materials list — color swatches with names, quantities, and percentages
  3. Assembly guide — step-by-step instructions with color runs (direction adapts per niche)
  4. Color summary — positions grouped by color (crossstitch and embroidery only)

Custom logos (Business & Enterprise)

If your API key has a custom_logo_url set, the PDF header will use your brand name instead of “PixCraft”. Configure this in your API Keys dashboard.

Common errors

Same as POST /generate.