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:

  1. Click here to download the compressed PHP class ("pdflayer.class.php.zip").

  2. Upload the contained PHP class file ("pdflayer.class.php") to a web accessible location on your server (e.g. "public_html").

    Configuration:

  3. In the PHP class, set the variable access_key to your API access key and (optional; only if you are using a Secret Key) the variable secret_keyword to 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:

MethodDescriptionSyntax
display_pdfDisplay the PDF (inline-behaviour)display_pdf();
download_pdfDownload the PDF (attachment-behaviour)download_pdf('file_name.pdf');
set_paramSpecify any pdflayer API parameterset_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

 

Questions? Contact Sales .
Need help? Contact Support .
© 2025 APILayer. All rights reserved.