Service: PDF Rendering Service - EyevinnOSC/community GitHub Wiki
PDF Rendering Service
PDF Rendering Service (serviceId restorecommerce-pdf-rendering-srv) converts a publicly accessible URL into a downloadable PDF. In Eyevinn Open Source Cloud (OSC) it is a long-running service instance. License: MIT.
What it can do
- Render any publicly accessible URL to a PDF, returned as a binary stream.
- Generate invoices, reports or archives of web content without running headless browser infrastructure yourself.
Creating an instance
Create the instance with create-service-instance using serviceId: "restorecommerce-pdf-rendering-srv". The name must be alphanumeric and at most 20 characters. The service has no dependencies and no other options.
{ "name": "mypdfsvc" }
Wait with wait-for-service-ready, then use describe-service-instance to read the service URL. OSC CLI form: npx @osaas/cli create restorecommerce-pdf-rendering-srv my-pdf-svc.
Options
| Option | Required | Type | Meaning |
|---|---|---|---|
| name | Yes | string | Name of the instance. Letters, digits and underscore only, at most 20 characters. |
The service has no other options.
Using the instance
Send a POST request with the target URL in the request body; the response is the rendered PDF as a binary stream.
curl -X POST https://<your-instance-url>/pdf \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
--output report.pdf
OSC puts an authentication gate in front of instance URLs other than /, so calls from outside may need a service access token.