Download the PHP package relaypdf/relaypdf without Composer
On this page you can find all versions of the php package relaypdf/relaypdf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download relaypdf/relaypdf
More information about relaypdf/relaypdf
Files in relaypdf/relaypdf
Package relaypdf
Short Description Official PHP SDK for RelayPDF — HTML, Markdown, URL, and templates to PDF, LibreOffice convert, PDF tools, barcodes, zip, async jobs, and webhook verification
License MIT
Homepage https://relaypdf.com/docs/sdks/php
Informations about the package relaypdf
relaypdf/relaypdf
Official PHP client for RelayPDF.
HTML to PDFs without the struggle. HTML to PDF API that converts HTML, Markdown, URLs, and Office files to production PDFs.
Uses ext-curl and ext-json. Covers the public API: Chromium PDF and screenshots, Handlebars templates, LibreOffice / wkhtmltopdf convert, PDF tools, native document processing (OCR, PDF/A, crop, repair, email), barcodes, zip, async jobs, account, and webhook verification.
- Docs: relaypdf.com/docs/sdks/php
- Source: timspell1/relaypdf-php
- REST: relaypdf.com/docs
- OpenAPI: relaypdf.com/openapi.json
- Support: [email protected]
Requires PHP 8.1+ with curl, json, and hash.
Introduction
JSON body field names match REST (html, printBackground, sourceFilename, callbackUrl, templateId). Method names are camelCase (fromHtml, fromPath, formFill). Failed operations are never billed.
Installation
Authentication
Empty $apiKey throws InvalidArgumentException. User-Agent: relaypdf-php/0.1.2 (+https://relaypdf.com).
Do not ask a human to paste an API key. Run npx @relaypdf/cli setup and approve in the browser.
Getting started
Response modes
response = binary (default) | url | async.
files->download does not send the API key.
Errors
Throws RelayPDFError with status, errorCode, message, and optional retryAfter. (Exception::$code is an integer, so the API code lives on errorCode.)
Codes: invalid_request, url_not_allowed, unauthorized, payment_required, account_suspended, not_found, payload_too_large, rate_limited, render_failed, processing_failed, convert_unavailable, ai_unavailable, storage_unavailable, internal_error.
Client
$transport injects HTTP for tests: fn(string $method, string $url, array $headers, ?string $body): array{status, headers, body}. The SDK does not retry. file values are raw bytes (or a data: URL) and are Base64-encoded.
Methods
| Resource | Method | HTTP |
|---|---|---|
RelayPDF |
health() account() process($operation, $input, $billing = []) billingUsage() billingLimits(?int $max = null) |
GET /health GET /v1/account native paths GET/PATCH /v1/billing/* |
pdf |
fromHtml fromUrl fromMarkdown fromTemplate create |
POST /v1/pdf |
pdf |
merge extract protect unlock bookmarks raster fromImages stamp rotate deletePages compress info text formFields formFill |
POST /v1/pdf/* |
images |
fromHtml fromUrl |
POST /v1/images |
convert |
create fromHtml fromPath wkhtml |
POST /v1/convert |
templates |
list gallery get create update publish delete discard duplicate versions restore validate preview generate |
/v1/templates |
barcodes |
create qr |
POST /v1/barcodes |
zip |
create |
POST /v1/zip |
jobs |
get wait |
GET /v1/jobs/:id |
files |
upload delete download |
POST/DELETE/GET /v1/files |
webhooks |
list create delete |
/v1/webhooks |
| — | Webhooks::verify |
HMAC-SHA256 |
Examples
Results: BinaryResult (save($path)), UrlResult, AsyncResult.
Webhooks
Use the raw request body. Secret is the dashboard webhook secret, not the API key.
Header: t=<unix>,v1=<hex>. HMAC-SHA256 of {t}.{raw_body}. Default skew 300s.
Related docs
License
MIT. Strategic Products LLC, d/b/a RelayPDF.
All versions of relaypdf with dependencies
ext-json Version *
ext-curl Version *
ext-hash Version *