Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

View extension for Kohana that renders a PDF using DOMPDF

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 classes
Octocat-spinner-32 config
Octocat-spinner-32 dev
Octocat-spinner-32 tests
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 .travis.yml

PDF View

Extension for Kohana's View class that renders as a PDF instead of HTML. Uses DOMPDF to render normal HTML views as PDF Files.

Please report all bugs related to PDF rendering to the DOMPDF issue tracker.


If your application is a Git repository:

git submodule add git:// modules/pdfview
git submodule update --init

Or clone the the module separately:

cd modules
git clone git:// pdfview


Now install DOMPDF using the submodule:

cd modules/pdfview
git submodule update --init

This will install DOMPDF to vendor/dompdf/dompdf from the DOMPDF Git mirror. For DOMPDF to work properly, the fonts directory must be writable:

# Replace "http" with your web server user and group!
chown http:http vendor/dompdf/dompdf/lib/fonts
# An insecure alternative:
# chmod 0777 vendor/dompdf/dompdf/lib/fonts


Edit application/bootstrap.php and add a the module:

    'pdfview' => 'modules/pdfview',


Placed in a controller action:

// Load a view using the PDF extension
$pdf = View_PDF::factory('pdf/example');

// Use the PDF as the request response
$this->request->response = $pdf;

// Display the PDF in the browser as "my_pdf.pdf"
// Remove "inline = TRUE" to force the PDF to be downloaded
$this->request->send_file(TRUE, 'my_pdf.pdf', array('inline' => TRUE));
Something went wrong with that request. Please try again.