Advertisement
Guest User

Converting a HTML page to a PDF file using wemakepdf.com

a guest
May 30th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. // Parameters
  2. $token = '123yourtokenabc'; // Replace this with your API token
  3. $url = 'https://wemakepdf.com/html/invoice.html'; // Full URL starting with http
  4.  
  5. // Convert the HTML string to a PDF using those parameters
  6. $result = file_get_contents('https://wemakepdf.com/api/v1/convert?token=' . $token . '&url=' . urlencode($url));
  7.  
  8. // Save to root folder in website/application
  9. file_put_contents('example.pdf', $result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement