PHP Classes
elePHPant
Icontem

File: Examples/get_pdf.php

Recommend this page to a friend!
  Classes of Christian Vigh  >  ApiLayer API Encapsulation  >  Examples/get_pdf.php  >  Download  
File: Examples/get_pdf.php
Role: Example script
Content type: text/plain
Description: Example to demonstrate the PdfLayer api
Class: ApiLayer API Encapsulation
Send requests to APILayer REST APIs
Author: By
Last change:
Date: 3 years ago
Size: 443 bytes
 

 

Contents

Class file image Download
<?php
   
require ( '../Sources/PdfLayer.php' ) ;

   
$my_access_key = "YOUR_ACCESS_KEY" ;
   
$my_secret_key = "YOUR_SECRET_KEY" ; // Or null, if you defined no secret key in your dashboard
   
$use_https = false ;

   
$pdf = new PdfLayer ( $my_access_key, $my_secret_key, $use_https ) ;
   
$pdf -> AcceptLanguage = 'fr' ;
   
$pdf_data = $pdf -> ConvertPage ( "http://www.google.com" ) ;
   
file_put_contents ( 'google.pdf', $pdf_data ) ;