mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
4.0 KiB
4.0 KiB
description, i18n_source_hash, i18n_provenance, i18n_output_hash
| description | i18n_source_hash | i18n_provenance | i18n_output_hash |
|---|---|---|---|
| Bir veya daha fazla görseli sayfa boyutu, yönlendirme ve hedef dosya boyutu seçenekleriyle bir PDF belgesinde birleştirin. | f659c7e7f56b | human | 449b1e21adb2 |
Görselden PDF'e
Bir veya daha fazla görseli bir PDF belgesinde birleştirin. Birden fazla sayfa boyutunu, yönlendirmeyi, kenar boşluklarını ve kalite ayarı yoluyla isteğe bağlı dosya boyutu hedeflemeyi destekler.
API Uç Noktası
POST /api/v1/tools/image/image-to-pdf
Bir veya daha fazla görsel dosyası ve bir JSON settings alanı içeren multipart form verisini kabul eder.
Parametreler
| Parametre | Tür | Zorunlu | Varsayılan | Açıklama |
|---|---|---|---|---|
| pageSize | string | Hayır | "A4" |
Sayfa boyutu: A4, Letter, A3, A5 |
| orientation | string | Hayır | "portrait" |
Sayfa yönlendirmesi: portrait veya landscape |
| margin | number | Hayır | 20 |
Punto cinsinden sayfa kenar boşluğu (0-500) |
| targetSize | object | Hayır | - | Hedef dosya boyutu kısıtlaması (aşağıya bakın) |
| collate | boolean | Hayır | true |
Tüm görselleri tek bir PDF'te birleştir. false ise görsel başına bir PDF oluşturur. |
Hedef Boyut Nesnesi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
| value | number | Evet | Hedef boyut değeri |
| unit | string | Evet | Birim: KB veya MB |
Minimum hedef boyut 50 KB'dir.
Örnek İstek
Temel çok görselli PDF:
curl -X POST http://localhost:1349/api/v1/tools/image/image-to-pdf \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@page1.jpg" \
-F "file=@page2.jpg" \
-F "file=@page3.jpg" \
-F 'settings={"pageSize": "A4", "orientation": "portrait", "margin": 20}'
Dosya boyutu hedefiyle:
curl -X POST http://localhost:1349/api/v1/tools/image/image-to-pdf \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@scan1.jpg" \
-F "file=@scan2.jpg" \
-F 'settings={"pageSize": "Letter", "targetSize": {"value": 2, "unit": "MB"}}'
Görsel başına bir PDF:
curl -X POST http://localhost:1349/api/v1/tools/image/image-to-pdf \
-H "Authorization: Bearer si_your-api-key" \
-F "file=@photo1.jpg" \
-F "file=@photo2.jpg" \
-F 'settings={"collate": false}'
Örnek Yanıt (Harmanlanmış)
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/images.pdf",
"originalSize": 5000000,
"processedSize": 1200000,
"pages": 3
}
Örnek Yanıt (Harmanlanmamış)
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/images.zip",
"originalSize": 5000000,
"processedSize": 2400000,
"pages": 2,
"collated": false
}
Örnek Yanıt (Hedef Boyutla)
{
"jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/images.pdf",
"originalSize": 10000000,
"processedSize": 2000000,
"pages": 5,
"compression": {
"targetRequested": 2097152,
"targetMet": true,
"jpegQuality": 72
}
}
Notlar
- Görseller sayfada ortalanır ve en boy oranı korunurken kenar boşluklarına sığacak şekilde ölçeklendirilir. Görseller asla büyütülmez.
collatedeğerifalseolduğunda, her görsel ayrı bir PDF dosyası olur ve indirme, tüm PDF'leri içeren bir ZIP arşividir.- Hedef boyut özelliği, bütçeye sığan en iyi kaliteyi bulmak için JPEG kalite düzeyleri (10-95) üzerinde yinelemeli ikili arama kullanır.
- Saydam görseller, PDF'e gömülmeden önce beyaza düzleştirilir.
- Desteklenen giriş biçimleri: JPEG, PNG, WebP, AVIF, TIFF, GIF, HEIC, RAW, PSD, SVG ve daha fazlası.
- EXIF yönlendirmesi gömülmeden önce otomatik olarak uygulanır.