Get started :: PHP to PDF generation steps

  1. Sign up to access our API    
    FREE!
  2. Download and include phpToPDF.php
  3. Call functions to generate PDFs

 

Sample Code :: PHP to PDF Generaton [ More Examples ]

Here is the phptopdf_url() function for creating a PDF using a URL

<?php
    
include_once('phpToPDF.php') ;
    
//Code to generate PDF file from specified URL
    
phptopdf_url('http://google.com','/my_directory/''my_pdf_filename.pdf');
?>

Alternatively, you can use the phptopdf_html() function to pass a varible that holds html code for your report.

<?php
    
include_once('phpToPDF.php');
    
$html '<html><head></head><body>contents of a report.....</body></html>'
    
//Code to generate PDF file from HTML content stored in a variable
    
phptopdf_html($html,'/my_directory/','my_pdf_filename.pdf');
?>

No Installation Needed

No packages or command line access needed. No heavy resources required. We do the heavy lifting.

Works on ANY server running PHP

The simplest and most reliable PHP to PDF generation.
Just include a single php file.