Convert a web page or raw HTML to PDF

// convert a web page
require 'pdfcrowd.php'
$client = new Pdfcrowd("your-username", "your-apikey");
$client->convertURI('http://www.example.com/', fopen('example.pdf', 'wb'))
 
// convert an HTML string
$html = "<html><body>In-memory html.</body></html>";
$client->convertHtml($html, fopen('html.pdf', 'wb'));
 
// convert an HTML file
$client->convertFile('/path/to/local/file', fopen('file.pdf', 'wb'));

Source : http://www.phpbuilder.com/snippet/detail.php?type=snippet&id=1485

Processing your request, Please wait....

No Responses to “Convert a web page or raw HTML to PDF”

Comments (Your Comments)

Leave a Reply

You must be logged in to post a comment.