Download the PHP package selectpdf/selectpdf-api-client without Composer

On this page you can find all versions of the php package selectpdf/selectpdf-api-client. 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 selectpdf-api-client

SelectPdf Online REST API - PHP Client

SelectPdf Online REST API is a professional solution for managing PDF documents online. It now has a dedicated, easy to use, PHP client library that can be setup in minutes.

Try without an API key (demo mode)

Demo mode limitations

Demo mode is intended for evaluating the API. To keep the public endpoint stable and prevent abuse, several limits and restrictions apply that don't exist on a paid endpoint.

Output:

Not available in demo mode (the client throws DemoUnsupportedException before the request is sent):

Method Behavior in demo mode
setUserPassword(...) / setOwnerPassword(...) Throws DemoUnsupportedException (field user_password / owner_password).
convert*Async(...) Throws DemoUnsupportedException (field async). The demo endpoint is synchronous only.
getWebElements() Throws DemoUnsupportedException (field pdf_web_elements_selectors).

Clamped parameters: setNavigationTimeout(...) (max_load_time) is capped to 15 seconds and setConversionDelay(...) (min_load_time) to 5 seconds. The capped field names are listed by getClampedFields().

Silently dropped fields: auth_username / auth_password, cookies_string (setCookies(...)), pdf_name and pdf_web_elements_selectors are accepted but never honored by the demo endpoint. Any value you set is reported back by wasAnyFieldDropped() / getDroppedFields(). Clamped means the value was modified, dropped means it was thrown away.

URLs: the demo endpoint accepts only publicly reachable http:// / https:// URLs. Requests targeting non-public destinations are rejected with DemoSafetyException (HTTP 400).

Rate limits: per-IP, daily global and concurrency limits apply. A request over a limit is rejected with DemoRateLimitException; getReason() is per_ip, daily_cap or concurrency, and getRetryAfter() carries the Retry-After header value in seconds.

Request size: the request body is capped at 1 MB (HTTP 413) - typically only an issue if you inline a very large HTML string.

Response: no credit headers (the demo endpoint is keyless, so there is no billing account): getCreditsTotal() and getCreditsRemaining() return null. getMode() returns "demo" (helper: isDemoResponse()).

Catching demo-mode errors

The client has three typed exceptions for demo-specific failures, all derived from ApiException; everything else surfaces as a regular ApiException:

Every demo exception also exposes getStatusCode() and getResponseBody() (the raw JSON error body returned by the server).

For unwatermarked production output without these limits, pass a real API key - same client class, same setters:

isDemoMode() is set at construction time and stays the same for the client's lifetime, so a client created with a real key never falls back to demo behavior.

Installation

Download selectpdf-api-php-client-1.6.0.zip, unzip it and require SelectPdf.Api.php in your code.

OR

Install SelectPdf PHP Client for Online API from Packagist: SelectPdf API on Packagist.

OR

Clone selectpdf-api-php-client from Github and require SelectPdf.Api.php in your code.

HTML To PDF API - PHP Client

SelectPdf HTML To PDF Online REST API is a professional solution that lets you create PDF from web pages and raw HTML code in your applications. The API is easy to use and the integration takes only a few lines of code.

Features

Sign up for for free to get instant API access to SelectPdf HTML to PDF API.

Sample Code

More conversion options

Asynchronous conversions

Use the *Async methods for long-running conversions. The client starts the job and polls /api2/asyncjob/ every AsyncCallsPingInterval seconds, up to AsyncCallsMaxPings times.

Web elements

Get the location in the generated PDF of the HTML elements that match a set of CSS selectors.

Response telemetry

Every client reports what the server returned with the most recent call:

Method Value
getNumberOfPages() Number of pages of the resulted PDF (X-SelectPdf-Pages).
getCreditsTotal() Monthly conversion limit of the subscription (X-SelectPdf-Credits-Total). -1 = unlimited. Null if absent (demo endpoint, error response).
getCreditsRemaining() Conversions remaining this month (X-SelectPdf-Credits-Remaining). -1 = unlimited. Null if absent.
getMode() "production" or "demo" (X-SelectPdf-Mode). Empty if absent.
getExecutionMode() "in-process" or "worker" (X-SelectPdf-Execution). Empty for endpoints that do not convert.

HtmlToPdfClient also has isDemoMode(), isDemoResponse(), getClampedFields() / wasClamped() and getDroppedFields() / wasAnyFieldDropped() (see demo mode above).

Accessible PDF and PDF Standards

Produce a tagged, accessible PDF and target a PDF conformance level, using the same HtmlToPdfClient you already use for conversions.

Features

Tagged output requires the Blink or Chromium rendering engine - the WebKit engines cannot build a structure tree. If you do not set an engine, the API promotes the conversion to Chromium and reports the engine it used in the X-SelectPdf-Engine response header. Asking for tagged output together with an explicit WebKit engine is rejected rather than silently producing an untagged PDF.

Note this produces tagged PDF/A output; it is not a conformance certification.

Sample Code - Accessible PDF

Electronic Invoicing API - ZUGFeRD / Factur-X

Turn an HTML invoice into a hybrid electronic invoice: one PDF/A-3 file carrying both the invoice a human reads and the XML a recipient's accounting system reads, embedded as an associated file with the metadata invoice software looks for.

Features

The invoice XML can only be embedded into a document created as PDF/A-3, so there is no variant that attaches it to an existing PDF you already have. An API key is required - the keyless demo endpoint does not produce electronic invoices, and InvoiceClient refuses a missing or "demo" key.

Use the createFrom* methods: createFromUrl, createFromHtmlString, createFromHtmlStringWithBaseUrl, each with ToStream / ToFile variants and Async variants (for example createFromHtmlStringToFileAsync).

Sample Code - Electronic Invoice

Pdf Merge API

SelectPdf Pdf Merge REST API is an online solution that lets you merge local or remote PDFs into a final PDF document.

Features

See PDF Merge API page for full list of parameters.

Sample Code

Pdf To Text API

SelectPdf Pdf To Text REST API is an online solution that lets you extract text from your PDF documents or search your PDF document for certain words.

Features

See Pdf To Text API page for full list of parameters.

Sample Code - Pdf To Text

Sample Code - Search Pdf

Changelog

1.6.0

Includes the 1.5.0 changes listed below (there was no separate 1.5.0 release of the PHP client).

1.5.0 (included in 1.6.0)


All versions of selectpdf-api-client with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
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 selectpdf/selectpdf-api-client contains the following files

Loading the files please wait ...