Use case
Use para capturar páginas públicas, exports de clientes ou provas online agendadas. A ferramenta web serve para revisão manual; a API serve para automação repetível no servidor.
PDF Tools API
Coloque converter páginas web para PDF no backend, em lotes ou no seu produto sem manter infraestrutura própria de PDF.
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/webpage-to-pdf/pdfUse your API Key in the x-api-key header.
Use para capturar páginas públicas, exports de clientes ou provas online agendadas. A ferramenta web serve para revisão manual; a API serve para automação repetível no servidor.
curl -X POST https://itextmaster.com/api/external/webpage-to-pdf/pdf \
-H 'x-api-key: YOUR_API_KEY' \
-F 'url=https://example.com/report' \
-F 'pageSize=A4' \
-F 'waitDelay=2' \
--output webpage.pdfcurl -X POST https://itextmaster.com/api/external/webpage-to-pdf/pdf \
-H 'x-api-key: YOUR_API_KEY' \
-F 'url=https://example.com/report' \
-F 'pageSize=A4' \
-F 'waitDelay=2' \
--output webpage.pdfcurl -X POST https://itextmaster.com/api/external/webpage-to-pdf/pdf \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{
"url": "https://example.com/report",
"pageSize": "A4",
"waitDelay": 2
}' \
--output webpage.pdfimport { writeFile } from 'node:fs/promises';
const response = await fetch('https://itextmaster.com/api/external/webpage-to-pdf/pdf', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.ITEXTMASTER_API_KEY
},
body: JSON.stringify({
url: 'https://example.com/report',
pageSize: 'A4',
waitDelay: 2
})
});
if (!response.ok) {
throw new Error(await response.text());
}
await writeFile('webpage.pdf', Buffer.from(await response.arrayBuffer()));import os
import requests
response = requests.post(
'https://itextmaster.com/api/external/webpage-to-pdf/pdf',
headers={
'Content-Type': 'application/json',
'x-api-key': os.environ['ITEXTMASTER_API_KEY'],
},
json={
'url': 'https://example.com/report',
'pageSize': 'A4',
'waitDelay': 2,
},
)
response.raise_for_status()
with open('webpage.pdf', 'wb') as f:
f.write(response.content)invalid_payloadO JSON ou multipart não contém HTML, URL ou arquivo obrigatório.
invalid_api_keyO x-api-key está ausente, inválido ou foi rotacionado.
insufficient_creditsA conta não tem API Credits suficientes.
conversion_failedA renderização no servidor não concluiu a conversão. Credits são devolvidos automaticamente quando falha.
webpage.pdf com cabeçalhos de Credits consumidos e saldo restante.
Content-TypeContent-DispositionX-Credits-ChargedX-Credit-BalanceSolicitações bem-sucedidas usam API Credits; falhas de processamento são devolvidas automaticamente. Usuários logados recebem 100 free API Credits por mês, e 1,000 Credits = $1.
Não. Ferramentas que rodam no navegador não consomem API Credits. Só chamadas com API Key entram na cobrança.
Não é recomendado. Guarde a API Key no backend, fila ou automação do servidor.
Create an API Key, test Página web para PDF API, and buy more Credits only when automation volume grows.