Use case
서버에서 보고서, 영수증, 명세서, 내부 화면을 PDF로 만드는 경우에 적합합니다. 수동 검토는 웹 도구, 반복되는 서버 작업은 API로 나눠 운영할 수 있습니다.
PDF Tools API
백엔드, 배치 작업, 제품 워크플로에 HTML을 PDF로 변환을 넣고 별도 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/html-to-pdf/pdfUse your API Key in the x-api-key header.
서버에서 보고서, 영수증, 명세서, 내부 화면을 PDF로 만드는 경우에 적합합니다. 수동 검토는 웹 도구, 반복되는 서버 작업은 API로 나눠 운영할 수 있습니다.
curl -X POST https://itextmaster.com/api/external/html-to-pdf/pdf \
-H 'x-api-key: YOUR_API_KEY' \
-F 'html=@index.html;type=text/html' \
-F 'pageSize=A4' \
-F 'printBackground=true' \
--output html-to-pdf.pdfcurl -X POST https://itextmaster.com/api/external/html-to-pdf/pdf \
-H 'x-api-key: YOUR_API_KEY' \
-F 'html=@index.html;type=text/html' \
-F 'pageSize=A4' \
-F 'printBackground=true' \
--output html-to-pdf.pdfcurl -X POST https://itextmaster.com/api/external/html-to-pdf/pdf \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{
"html": "<!doctype html><html><body><h1>Report</h1></body></html>",
"pageSize": "A4",
"printBackground": true
}' \
--output html-to-pdf.pdfimport { writeFile } from 'node:fs/promises';
const response = await fetch('https://itextmaster.com/api/external/html-to-pdf/pdf', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.ITEXTMASTER_API_KEY
},
body: JSON.stringify({
html: '<!doctype html><html><body><h1>Report</h1></body></html>',
pageSize: 'A4',
printBackground: true
})
});
if (!response.ok) {
throw new Error(await response.text());
}
await writeFile('html-to-pdf.pdf', Buffer.from(await response.arrayBuffer()));import os
import requests
response = requests.post(
'https://itextmaster.com/api/external/html-to-pdf/pdf',
headers={
'Content-Type': 'application/json',
'x-api-key': os.environ['ITEXTMASTER_API_KEY'],
},
json={
'html': '<!doctype html><html><body><h1>Report</h1></body></html>',
'pageSize': 'A4',
'printBackground': True,
},
)
response.raise_for_status()
with open('html-to-pdf.pdf', 'wb') as f:
f.write(response.content)invalid_payloadJSON 또는 multipart 요청에 필요한 HTML, URL 또는 파일 입력이 없습니다.
invalid_api_keyx-api-key가 없거나 유효하지 않거나 교체되었습니다.
insufficient_credits계정의 API Credits가 부족합니다.
conversion_failed서버 렌더링이 변환을 완료하지 못했습니다. 실패한 처리는 Credits가 자동 환불됩니다.
html-to-pdf.pdf와 함께 사용 Credits 및 잔여 Credits 응답 헤더가 반환됩니다.
Content-TypeContent-DispositionX-Credits-ChargedX-Credit-Balance성공한 HTML PDF 변환 API 요청은 API Credits를 사용합니다. 실패한 처리는 자동 환불됩니다. 로그인 사용자는 매월 100 free API Credits를 받고, 1,000 Credits = $1입니다.
브라우저에서 처리되는 웹 도구는 API Credits를 쓰지 않습니다. API Key로 호출하는 자동화 요청만 과금됩니다.
권장하지 않습니다. API Key는 백엔드, 큐 작업, 서버 자동화에 보관하세요.
Create an API Key, test HTML PDF 변환 API, and buy more Credits only when automation volume grows.