Herhangi bir web sayfasını PDF'e çevirin
PDF oluşturuluyor...
Powered by Puppeteer | GitHub
POST /api/pdf - PDF oluştur GET /view/:filename - PDF'i görüntüle GET /download/:filename - PDF'i indir
{
"url": "https://example.com",
"paper_size": "A4",
"margins": "none",
"scale": 100,
"background_graphics": true
}
{
"success": true,
"message": "PDF başarıyla oluşturuldu",
"filename": "pdf_1234567890_abc123.pdf",
"download_url": "/download/pdf_1234567890_abc123.pdf",
"view_url": "/view/pdf_1234567890_abc123.pdf",
"file_size": 1234567,
"duration": "3.45"
}
curl -X POST http://localhost:8000/api/pdf \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"paper_size": "A4",
"margins": "none",
"scale": 100,
"background_graphics": false
}'
fetch('http://localhost:8000/api/pdf', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://example.com',
paper_size: 'A4',
margins: 'none',
scale: 100,
background_graphics: false
})
})
.then(response => response.json())
.then(data => {
if (data.success) {
// PDF'i görüntüle
window.open(data.view_url, '_blank');
// Veya PDF'i indir
// window.open(data.download_url, '_blank');
}
});