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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

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.

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

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
ext-curl Version *
ext-hash Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package relaypdf/relaypdf contains the following files

Loading the files please wait ...