How to convert html to Pdf using Dompdf in PHP

3

- Advertisement -

DOMPDF is convert HTML to PDF. You can download the latest version of Dompdf from GitHub.
Step 1: Reference the namespace of Dompdf

Step 2: include Dompdf library

Step 3: Initiate the Dompdf class

Basic Parameters

Load HTML content

loadhtml() use to generate PDF and render on browser.
Set the paper size. This is optional.

setPaper()–
$size(string)— ‘legal’,’letter’,’A4′
$orientation(string) — ‘portrait’ or ‘landscape’.
Render to HTML to PDF

For view the PDF

For download the PDF

Download Source Code(How to convert html to Pdf using Dompdf in PHP)
Size: 3.66 MB
Version: V 1.0

- Advertisement -

Leave A Reply

Your email address will not be published.

3 Comments
  1. Santhosh Nair says

    Thanks a lot…

  2. Avinash PB says

    Dompdf not working on live server.

    1. Anuj Kumar says

      Regarding this talk to hosting provider.

Leave A Reply

Your email address will not be published.