PDF Generator

Convert HTML templates or Markdown content to high-quality PDF documents. Perfect for generating reports, invoices, or any document from web content.

API Endpoint

POST
https://pdf.bizkithub.com/generator

Request Format

HeaderValue
Content-Typetext/html or text/markdown
Acceptapplication/pdf

Examples

HTML to PDF

curl -X POST "https://pdf.bizkithub.com/generator" \
  -H "Content-Type: text/html" \
  -H "Accept: application/pdf" \
  -d '<!DOCTYPE html>
<html>
<head>
  <title>My Document</title>
  <style>
    body { font-family: Arial, sans-serif; }
    h1 { color: #ec6c50; }
  </style>
</head>
<body>
  <h1>Hello World</h1>
  <p>This is a PDF generated from HTML.</p>
</body>
</html>' \
  --output document.pdf

Markdown to PDF

curl -X POST "https://pdf.bizkithub.com/generator" \
  -H "Content-Type: text/markdown" \
  -H "Accept: application/pdf" \
  -d '# My Document

This is a **bold** text and this is *italic*.

## Features
- Easy to use
- High quality output
- Fast processing

[Visit BizKitHub](https://bizkithub.com)' \
  --output document.pdf

JavaScript Integration

// Generate PDF from HTML
async function generatePDF(htmlContent) {
  const response = await fetch('https://pdf.bizkithub.com/generator', {
    method: 'POST',
    headers: {
      'Content-Type': 'text/html',
      'Accept': 'application/pdf'
    },
    body: htmlContent
  });
  
  if (response.ok) {
    const blob = await response.blob();
    const url = URL.createObjectURL(blob);
    
    // Download the PDF
    const a = document.createElement('a');
    a.href = url;
    a.download = 'document.pdf';
    a.click();
    
    URL.revokeObjectURL(url);
  }
}

// Generate PDF from Markdown
async function generatePDFFromMarkdown(markdownContent) {
  const response = await fetch('https://pdf.bizkithub.com/generator', {
    method: 'POST',
    headers: {
      'Content-Type': 'text/markdown',
      'Accept': 'application/pdf'
    },
    body: markdownContent
  });
  
  return await response.blob();
}

// Usage
const html = `<!DOCTYPE html>
<html><body><h1>Hello PDF!</h1></body></html>`;

generatePDF(html);

Supported Features

HTML Features

  • CSS styling (inline and external)
  • Images (base64 or URLs)
  • Tables and layouts
  • Custom fonts

Markdown Features

  • Headers and text formatting
  • Lists and tables
  • Links and images
  • Code blocks

Response

Success Response

Returns a PDF file with appropriate headers for download or display.

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="document.pdf"
Content-Length: [size in bytes]

[PDF binary data]

Rate Limits & Restrictions

⚠️ Usage Limits

  • 100 requests per hour per IP address
  • Maximum content size: 1MB
  • Processing timeout: 30 seconds
  • Maximum pages: 50 pages per document

Error Handling

400Bad Request

Invalid content type or malformed HTML/Markdown

413Content Too Large

Content exceeds maximum size limit

429Too Many Requests

Rate limit exceeded, try again later