Forum Moderators: coopster

Message Too Old, No Replies

web page into pdf

converting a webpage into pdf

         

Silent Miracle

3:03 pm on Jul 14, 2011 (gmt 0)

10+ Year Member



hey ! i tried to convert my php-html webpage containing mysql comands in to pdf. I tried it with dompdf but couldnot do so.. it was able to generate a pdf file but couldnot generate the correct text in it. Couldnot anyone guide me which class should i use?

henry0

10:06 pm on Jul 14, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



FPDF

[fpdf.org ]

Silent Miracle

6:35 am on Jul 15, 2011 (gmt 0)

10+ Year Member



i tried using API pdfcrowd... but i am getting an error... dnt knw..why ... error is "couldnot connect to host" ..here is my code...
<?php
require 'pdfcrowd.php';

try
{
// create an API client instance
$client = new Pdfcrowd("fareeha", "869342ec80e1ff7c3abf6a246ac0888f");

// convert a web page and store the generated PDF into a $pdf variable
$pdf = $client->convertURI('C:/wamp/www/1310705943.html');

// set HTTP response headers
header("Content-Type: application/pdf");
header("Cache-Control: no-cache");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=\"google_com.pdf\"");

// send the generated PDF
echo $pdf;
}
catch(PdfcrowdException $e)
{
echo "Pdfcrowd Error: " . $e->getMessage();
}
?>