Code Examples
Language Examples
PHP
This is an integration guide for a PHP cURL-based PHP class built to simplify the use the PDFlayer API in PHP. To get started as quickly as possible, please follow the steps below:
Installation:
Click here to download the compressed PHP class ("pdflayer.class.php.zip").
Upload the contained PHP class file ("pdflayer.class.php") to a web accessible location on your server (e.g. "public_html").
Configuration:
In the PHP class, set the variable
access_keyto your API access key and (optional; only if you are using a Secret Key) the variablesecret_keywordto your Secret Keyword.
Usage:
URL to PDF (Inline-Behaviour) URL to PDF (Attachment-Behaviour) HTML to PDF (Inline-Behaviour) URL to PDF with Header Text (Inline-Behaviour) URL to PDF and save to disk
Find below the most basic use of the PDFlayer PHP class. All available methods are listed in the table below.
Methods:
| Method | Description | Syntax |
|---|---|---|
display_pdf | Display the PDF (inline-behaviour) | display_pdf(); |
download_pdf | Download the PDF (attachment-behaviour) | download_pdf('file_name.pdf'); |
set_param | Specify any pdflayer API parameter | set_param(string key, string value); |
Help / Support
Any issues with API Integration? Be sure to take a look at our Frequently Asked Questions to see if your question has already been answered.
If you still need assistance, please don´t hesitate to contact us.