Use case
Usalo per coprire dati personali, importi o note interne prima della condivisione. Lo strumento web è per revisione manuale; l’API è per automazioni ripetibili lato server.
PDF Tools API
Integra oscurare aree PDF nel backend, nei batch o nel prodotto senza mantenere un servizio PDF proprietario.
Credits
1 Credit / call
1 Credit per successful API request. Failed processing attempts are refunded automatically.
Pricing
1,000 Credits = $1
Every signed-in user receives 100 free API Credits each month.
Endpoint
/api/external/pdf-tools/pdf-redactionUse your API Key in the x-api-key header.
Usalo per coprire dati personali, importi o note interne prima della condivisione. Lo strumento web è per revisione manuale; l’API è per automazioni ripetibili lato server.
curl -X POST https://itextmaster.com/api/external/pdf-tools/pdf-redaction \
-H 'x-api-key: YOUR_API_KEY' \
-F 'file=@input.pdf;type=application/pdf' \
-F 'options={"areas":[{"page":1,"x":72,"y":120,"width":180,"height":36,"replacementText":"REDACTED"}],"color":{"r":0,"g":0,"b":0}}' \
--output redacted.pdfcurl -X POST https://itextmaster.com/api/external/pdf-tools/pdf-redaction \
-H 'x-api-key: YOUR_API_KEY' \
-F 'file=@input.pdf;type=application/pdf' \
-F 'options={"areas":[{"page":1,"x":72,"y":120,"width":180,"height":36,"replacementText":"REDACTED"}],"color":{"r":0,"g":0,"b":0}}' \
--output redacted.pdfcurl -X POST https://itextmaster.com/api/external/pdf-tools/pdf-redaction \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{
"file": { "name": "input.pdf", "dataBase64": "JVBERi0xLjcK..." },
"options": {"areas":[{"page":1,"x":72,"y":120,"width":180,"height":36,"replacementText":"REDACTED"}],"color":{"r":0,"g":0,"b":0}}
}' \
--output redacted.pdfimport { writeFile } from 'node:fs/promises';
const response = await fetch('https://itextmaster.com/api/external/pdf-tools/pdf-redaction', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.ITEXTMASTER_API_KEY
},
body: JSON.stringify({
file: { name: 'input.pdf', dataBase64: 'JVBERi0xLjcK...' },
options: {"areas":[{"page":1,"x":72,"y":120,"width":180,"height":36,"replacementText":"REDACTED"}],"color":{"r":0,"g":0,"b":0}}
})
});
if (!response.ok) {
throw new Error(await response.text());
}
await writeFile('redacted.pdf', Buffer.from(await response.arrayBuffer()));import os
import requests
response = requests.post(
'https://itextmaster.com/api/external/pdf-tools/pdf-redaction',
headers={
'Content-Type': 'application/json',
'x-api-key': os.environ['ITEXTMASTER_API_KEY'],
},
json={
'file': {'name': 'input.pdf', 'dataBase64': 'JVBERi0xLjcK...'},
'options': {'areas': [{'page': 1, 'x': 72, 'y': 120, 'width': 180, 'height': 36, 'replacementText': 'REDACTED'}], 'color': {'r': 0, 'g': 0, 'b': 0}}
},
)
response.raise_for_status()
with open('redacted.pdf', 'wb') as f:
f.write(response.content)invalid_api_keyL’header x-api-key manca, non è valido o è stato ruotato.
insufficient_creditsL’account non ha API Credits sufficienti.
pdf_tool_processing_failedFile, opzioni o struttura PDF non sono stati elaborati. I Credits vengono restituiti automaticamente in caso di errore.
redacted.pdf con header che indicano Credits usati e saldo rimanente.
Content-TypeContent-DispositionX-Credits-ChargedX-Credit-BalanceLe richieste riuscite usano API Credits; gli errori di elaborazione vengono rimborsati automaticamente. Ogni utente con accesso riceve 100 free API Credits al mese, e 1,000 Credits = $1.
No. Gli strumenti che lavorano nel browser non consumano API Credits. Contano solo le chiamate con API Key.
Non è consigliato. Tieni la API Key nel backend, in una coda o in un job lato server.
Create an API Key, test API oscuramento PDF, and buy more Credits only when automation volume grows.