• v1rtual1st

    (@v1rtual1st)


    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

    (@rollingwolf)

    Ive worked with DOMPDF in the past and we concluded that switching over to TCPDF was the best for the project. http://tcpdf.org

    Pioneer Web Design

    (@swansonphotos)

    @v1rtual1st,

    What is “DOMPDF”?

    @rollingwolf,

    Can you list a solution within the WP repository and if not please describe the link you provided in detail?

    Thread Starter v1rtual1st

    (@v1rtual1st)

    DOMPDF: https://github.com/dompdf/dompdf

    Creates PDF files with HTML makrup.

    rollingWolf

    (@rollingwolf)

    @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

    (@swansonphotos)

    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.