Features
- Edge-Based PDF Generation: Trigger PDF creation directly from the edge
- PDForge Integration: Connect to PDForge.com’s PDF generation service
- Simple HTTP Interface: Easy-to-use endpoint for PDF generation
- WebAssembly Performance: Fast, secure execution in a sandboxed environment
- Configurable Endpoint: Set custom paths for your PDF generation endpoint
Getting Started
To integrate PDForge with your project:- Sign up for a PDForge account at pdforge.com
- Open the Edgee console and navigate to your project’s Components
- Select “Add a component” and choose
edgee/pdforge-generate-pdf
from the list of available edge functions - Configure the following settings:
- API Key: Your PDForge API key
- Template ID: The ID of your PDF template
- Path Configuration: Set the PDF generation endpoint path (e.g.,
/generate-pdf
)
- Click Save to activate the PDF generation endpoint
Configuration Options
Setup Requirements
- Active PDForge account at pdforge.com
- PDForge API credentials and template ID (will be configured through the console)
Usage
Once configured, you can trigger PDF generation by sending requests to your configured endpoint:Use Cases
- Invoice Generation: Create professional invoices
- Report Generation: Generate business reports
- Certificate Creation: Issue certificates and diplomas
- Document Automation: Automate document creation processes
- Edge-Based PDF Services: Provide PDF generation closer to users
Example Integration
Error Handling
The edge function provides comprehensive error handling:- 400 Bad Request: Invalid request format or missing required fields
- 401 Unauthorized: Invalid API key or authentication failure
- 404 Not Found: Template not found
- 422 Unprocessable Entity: Invalid template data or format
- 500 Internal Server Error: PDForge API error