Doldurun PDF Biçim
PDF4me PDF Formunu Doldurun AcroForm alanlarını doldurur. PDF değerleri içeren bir şablon JSON tek bir nesnede REST Çağrı. Şablonu şu şekilde gönderin: Base64 veya halka açık URLAlan değerlerini stringleştirilmiş olarak gönderin. veri dizisive doldurulmuş olanı teslim alın. PDF ikili baytlar (200) olarak veya bir Konum başlığı sorgulaması yoluyla URL (202). Geçiş KeepPdfEditable Yeniden düzenlenebilir bir form veya düzleştirilmiş statik bir kayıt sunmak.
Kimliğinizi Doğrulama API Rica etmek
Her PDF4me REST Çağrınızda mutlaka sizin de bulunmanız gerekiyor. API anahtara Authorization Başlıkta Temel kimlik doğrulama (Basic auth) belirtilmiştir. Anahtarınızı geliştirici kontrol panelinden alın veya değiştirin.
Uç nokta
/api/v2/FillPdfFormhttps://api.pdf4me.com/api/v2/FillPdfFormKaçırmamanız Gereken Önemli Bilgiler
veri dizisi Bu bir nesne değil, bir dizedir.JSON.stringify({...}) Göndermeden önce. İç içe geçmiş bir nesne göndermek, seri hale getirme hatasına neden olur.IsAsync: true o API 202 yanıtı ve bir Location başlığı içerebilir. GET O URL (aynı yetkilendirme) 200 yanıtı verene kadar PDF ikili. Standart PDF4me asenkron desen (pdf4meAsyncRequest).HTTP kurmak
Yöntem: POSTALAMAK
URL: https://api.pdf4me.com/api/v2/FillPdfForm
İçerik Türü: uygulama/json
Yetkilendirme: Temel <sizin PDF4me API anahtar>
Göndermek IsAsync: true Vücutta. 200 doldurulmuş olanı geri gönderir. PDF ikili baytlar olarak. 202 bir döndürür Konum anket içeren başlık URL; GET O URL Aynı Yetkilendirme başlığıyla, 200 yanıtı verene kadar devam eder. PDF ikili (aynı kurala göre) pdf4meAsyncRequest).
Varyant matrisi (Postman ile ilgili)
Üç giriş varyantı, her Postman / curl / SDK çağrısını kapsar. İhtiyaçlarınıza uygun olan varyantı seçin. PDF Şablon ve form verileri canlı olarak görüntülenir.
| Varyant | PDF şablonu (şablonBelgeİçeriği) | Form alanları | Gerekli API alanları |
|---|---|---|---|
| A | Base64 PDF | JSON object → stringify → dataArray | All rows in the JSON-form table below. |
| B | Public PDF URL | JSON object → stringify → dataArray | Same as A; templateDocContent is the URL string. |
| C | Base64 PDF | Base64-encoded JSON file → decode → stringify into dataArray | Same as A; build dataArray from the decoded JSON. |
API vücut alanları
Her zaman gönderildi
| Alan | Gerekli | Tip | Varsayılan / notlar |
|---|---|---|---|
templateDocName | Yes* | string | Filename of the template, e.g. template.pdf. Derived from the source URL filename or defaulted to template.pdf. Used for downstream output naming. |
templateDocContent | Yes | string | Base64-encoded PDF (no data: prefix) OR a publicly reachable https URL to the PDF. |
KeepPdfEditable | No | boolean | Default false. Set true to keep AcroForm fields editable in the output PDF; false flattens the form into static text. |
IsAsync | Yes | boolean | Default true. Toggles the 200 / 202 + Location async pattern. |
*şablonBelgeAdı İstekte her zaman belirtilmelidir; çıktı dosya adlarının daha sonraki aşamalarda temiz olması için mantıklı bir dosya adı seçin.
Form girişi yapıldığında JSON
| Alan | Gerekli | Tip | Notlar |
|---|---|---|---|
dataArray | Yes | string | JSON.stringify({ ... }). Keys = AcroForm field names; values = strings to fill. |
inputDataType | Yes | string | Always "json" for this path. |
outputType | Yes | string | Always "pdf". |
Form veri kuralları (JSON yol)
| Kural | Detay |
|---|---|
| Shape | Single object: {"fieldName": "value", ...}. |
| Not allowed | Empty array, or an array of multiple objects. |
| Base64 form input | Decode the UTF-8 JSON file, then JSON.stringify into dataArray. In Postman: put the decoded-then-stringified result directly into dataArray. |
| Data URL | Strip the data:...;base64, prefix if present (applies to the PDF Base64 in templateDocContent). |
Örnek yükler
Varyant A. PDF Base64 + form JSON
{
"templateDocName": "application-form.pdf",
"templateDocContent": "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZw...",
"inputDataType": "json",
"outputType": "pdf",
"KeepPdfEditable": false,
"IsAsync": true
}
veri dizisi Bir dize olmalı, iç içe geçmiş bir yapı olmamalı. JSON nesne:
"dataArray": "{"firstname":"John","lastname":"Doe"}"
Varyant B. PDF URL'si + form JSON'u
{
"templateDocName": "application-form.pdf",
"templateDocContent": "https://example.com/forms/application-form.pdf",
"inputDataType": "json",
"outputType": "pdf",
"KeepPdfEditable": false,
"IsAsync": true
}
Varyant C. PDF Base64 + Base64 JSON'dan form
Depodaki yer tutucu: eyJmaXJzdG5hbWUiOiJKb2huIn0= → {"firstname":"John"}.
Eş değer API vücut formu çözdükten sonra JSON:
{
"templateDocName": "application-form.pdf",
"templateDocContent": "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZw...",
"dataArray": "{\"firstname\": \"John\"}",
"inputDataType": "json",
"outputType": "pdf",
"KeepPdfEditable": false,
"IsAsync": true
}
İsteğe bağlı. Formu düzenlenebilir tutun.
{
"templateDocName": "application-form.pdf",
"templateDocContent": "https://example.com/forms/application-form.pdf",
"dataArray": "{\"firstname\": \"John\", \"lastname\": \"Doe\"}",
"inputDataType": "json",
"outputType": "pdf",
"KeepPdfEditable": true,
"IsAsync": true
}
Postacı tahsilat ipuçları
curl örneği
curl -X POST https://api.pdf4me.com/api/v2/FillPdfForm \
-H "Content-Type: application/json" \
-H "Authorization: Basic YOUR_API_KEY" \
-d '{
"templateDocName": "application-form.pdf",
"templateDocContent": "https://example.com/forms/application-form.pdf",
"dataArray": "{\"firstname\":\"John\",\"lastname\":\"Doe\"}",
"inputDataType": "json",
"outputType": "pdf",
"KeepPdfEditable": false,
"IsAsync": true
}' \
--output filled-form.pdf
Hızlı referans: Gerekli ve isteğe bağlı (Postacı)
| Alan | A (PDF b64) | B (PDF URL) | C (b64 biçiminde → JSON) |
|---|---|---|---|
templateDocName | Required | Required | Required |
templateDocContent | Required (b64) | Required (URL) | Required (b64) |
dataArray | Required | Required | Required (from decoded JSON) |
inputDataType | Required (json) | Required (json) | Required (json) |
outputType | Required (pdf) | Required (pdf) | Required (pdf) |
IsAsync | Required (true) | Required (true) | Required (true) |
KeepPdfEditable | Optional | Optional | Optional |