NAME
SelectPdf::ApiClient - Base class for API clients. Do not use this directly.
METHODS
new
ApiClient Constructor. Do not use this directly.
setApiEndpoint( $apiEndpoint )
Set a custom SelectPdf API endpoint. Do not use this method unless advised by SelectPdf.
$client->setApiEndpoint($apiEndpoint);
Parameters:
- $apiEndpoint API endpoint.
setApiAsyncEndpoint( $apiAsyncEndpoint )
Set a custom SelectPdf API endpoint for async jobs. Do not use this method unless advised by SelectPdf.
$client->setApiAsyncEndpoint($apiAsyncEndpoint);
Parameters:
- $apiAsyncEndpoint API async jobs endpoint.
setApiWebElementsEndpoint( $apiWebElementsEndpoint )
Set a custom SelectPdf API endpoint for web elements. Do not use this method unless advised by SelectPdf.
$client->setApiWebElementsEndpoint($apiWebElementsEndpoint);
Parameters:
- $apiWebElementsEndpoint API web elements endpoint.
getNumberOfPages
Get the number of pages of the PDF document resulted from the API call.
$pages = $client->getNumberOfPages();
Returns:
- Number of pages of the PDF document.
getCreditsTotal
Get the subscription monthly conversion limit reported by the server (X-SelectPdf-Credits-Total response header).
$total = $client->getCreditsTotal();
Returns:
- Monthly conversion limit. -1 means unlimited (Dedicated tier). Undef when the most recent response did not include credit information (e.g. demo endpoint, error response).
getCreditsRemaining
Get the number of conversions remaining in the current month, as reported by the server (X-SelectPdf-Credits-Remaining response header).
$remaining = $client->getCreditsRemaining();
Returns:
- Conversions remaining this month. -1 means unlimited (Dedicated tier). Undef when the most recent response did not include credit information.
getMode
Get the endpoint mode of the most recent response (X-SelectPdf-Mode response header).
$mode = $client->getMode();
Returns:
- "production" or "demo". Empty string when the response did not include the header.
getExecutionMode
Get the server-side execution path of the most recent conversion (X-SelectPdf-Execution response header).
$executionMode = $client->getExecutionMode();
Returns:
- "in-process" or "worker". Empty string for endpoints that do not perform a conversion (e.g. usage, web elements) or when the header is absent.