openpencil/packages/docs/de/programmable/cli/exporting.md
2026-05-29 15:56:52 +03:00

60 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Exportieren
description: .fig-Dateien als PNG, JPG, WEBP, SVG oder JSX mit Tailwind-Klassen rendern.
---
# Exportieren
Designs vom Terminal aus exportieren — Rasterbilder, Vektoren oder JSX-Code.
## Bildexport
```sh
openpencil export design.fig # PNG (Standard)
openpencil export design.fig -f jpg -s 2 -q 90 # JPG in 2×, Qualität 90
openpencil export design.fig -f webp -s 3 # WEBP in 3×
openpencil export design.fig -f svg # SVG-Vektor
```
Optionen:
- `-f` — Format: `png`, `jpg`, `webp`, `svg`, `jsx`
- `-s` — Skalierung: `1``4`
- `-q` — Qualität: `0``100` (nur JPG/WEBP)
- `-o` — Ausgabepfad
- `--page` — Seitenname
- `--node` — bestimmte Knoten-ID
## JSX-Export
Als JSX mit Tailwind-Utility-Klassen exportieren:
```sh
openpencil export design.fig -f jsx --style tailwind
```
Ausgabe:
```html
<div className="flex flex-col gap-4 p-6 bg-white rounded-xl">
<p className="text-2xl font-bold text-[#1D1B20]">Card Title</p>
<p className="text-sm text-[#49454F]">Description text</p>
</div>
```
Unterstützt auch `--style openpencil` für das native JSX-Format (siehe [JSX-Renderer](../jsx-renderer)).
## Vorschaubilder
```sh
openpencil export design.fig --thumbnail --width 1920 --height 1080
```
## Live-App-Modus
Lass die Datei weg, um aus der laufenden App zu exportieren:
```sh
openpencil export -f png # Screenshot der aktuellen Zeichenfläche
```