Title: DOMPDF doesn&#039;t work
Last modified: August 24, 2016

---

# DOMPDF doesn't work

 *  [v1rtual1st](https://wordpress.org/support/users/v1rtual1st/)
 * (@v1rtual1st)
 * [11 years ago](https://wordpress.org/support/topic/dompdf-doesnt-work/)
 * I cannot get DOMPDF to generate PDF.
 * I have put DOMPDF files into ‘themedir/dompdf/’
 *     ```
       require_once(echo get_template_directory_uri()."/dompdf/dompdf_config.inc.php");
   
       $html =
         '<html><body>'.
         '<p>Put your html here, or generate it with your favourite '.
         'templating system.</p>'.
         '</body></html>';
   
       $dompdf = new DOMPDF();
       $dompdf->load_html($html);
       $dompdf->render();
       $dompdf->stream("sample.pdf");
       ```
   
 * Any ideas? Thanks

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [rollingWolf](https://wordpress.org/support/users/rollingwolf/)
 * (@rollingwolf)
 * [11 years ago](https://wordpress.org/support/topic/dompdf-doesnt-work/#post-6164285)
 * Ive worked with DOMPDF in the past and we concluded that switching over to TCPDF
   was the best for the project. [http://tcpdf.org](http://tcpdf.org)
 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [11 years ago](https://wordpress.org/support/topic/dompdf-doesnt-work/#post-6164287)
 * [@v1rtual1st](https://wordpress.org/support/users/v1rtual1st/),
 * What is “DOMPDF”?
 * [@rollingwolf](https://wordpress.org/support/users/rollingwolf/),
 * Can you list a solution within the WP repository and if not please describe the
   link you provided in detail?
 *  Thread Starter [v1rtual1st](https://wordpress.org/support/users/v1rtual1st/)
 * (@v1rtual1st)
 * [11 years ago](https://wordpress.org/support/topic/dompdf-doesnt-work/#post-6164289)
 * DOMPDF: [https://github.com/dompdf/dompdf](https://github.com/dompdf/dompdf)
 * Creates PDF files with HTML makrup.
 *  [rollingWolf](https://wordpress.org/support/users/rollingwolf/)
 * (@rollingwolf)
 * [11 years ago](https://wordpress.org/support/topic/dompdf-doesnt-work/#post-6164324)
 * [@pioneer](https://wordpress.org/support/users/pioneer/) valley web design
 * TCPDF is a PHP library for creating PDF files. While not with “native” support
   for creating pdfs from html content it does have a plugin for doing so. In our
   project we saw a considerable improvment in speed over DOMPDF.
 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [11 years ago](https://wordpress.org/support/topic/dompdf-doesnt-work/#post-6164361)
 * This forum supports Core Wordress, and Plugins/Themes found here at the .org 
   repositories. Please consult the non-.org provider(s) for help with the code 
   they have provided.
 * But, just a quick question. Where have you added your proper version of the code
   example shown above? In a Page Template?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘DOMPDF doesn't work’ is closed to new replies.

## Tags

 * [pdf](https://wordpress.org/support/topic-tag/pdf/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 5 replies
 * 3 participants
 * Last reply from: [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/dompdf-doesnt-work/#post-6164361)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
