function download($resumeId) { $this->_check_auth(); if (!$this->_is_paid_for()) { redirect('checkout', 'refresh'); } $markup = $this->input->post('markup'); $html = file_get_contents("http://www.google.com"); $pdf = new WKPDF(); //$pdf->set_html($html); $pdf->set_url(site_url('resumes/pdf/' . $resumeId)); $pdf->render(); $pdf->output(WKPDF::$PDF_EMBEDDED, 'resume.pdf'); }
/** * !! SECURITY WARNING !! * This file may be used maliciously on your server. * REMOVE THIS FILE FROM YOUR PRODUCTION SERVER. */ // load class file require_once 'wkhtmltopdf.php'; if (isset($_REQUEST['URL'])) { // if URL is set... // generate PDF given URL and force embed try { $urls = explode(';', $_REQUEST['URL']); if (count($urls) <= 1) { $pdf = new WKPDF(); $pdf->set_url($urls[0]); $pdf->render(); $pdf->output(WKPDF::$PDF_EMBEDDED, 'converted.pdf'); } else { $pdf = new WKPDF_MULTI(); foreach ($urls as $url) { $pdf->add_url($url); } $pdf->render(); $pdf->output(WKPDF::$PDF_EMBEDDED, 'converted.pdf'); } } catch (Exception $e) { die('Exception (line ' . $e->getLine() . '): ' . $e->getMessage()); } } else { // otherwise, output page code