• Resolved bt_dev

    (@biotrace)


    Hello – We have been editing the ‘dompdf_config.inc.php’ file on line 241: def(“DOMPDF_DPI”, 96); changing it to 300 for better image quality.

    Is there a function we can add to the plugin code snippets to replace this code by default so it is more compatible with updates?

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! the def() method is there precisely to let you override this (in functions.php or Code Snippets).

    
    define("DOMPDF_DPI", 72);
    

    However, changing this will not do anything for the image quality, it will simply make dimensionless images smaller in size (mm/inches). DOMPDF doesn’t do any resampling but just uses the DPI to calculate the size for images if it only knows pixels. If you enter a size in mm/inches in your css, you can simply increase the DPI by making the picture larger (more pixels).

    Hope that helps!
    Ewout

    Thread Starter bt_dev

    (@biotrace)

    Hi Ewout – That worked perfectly! Thanks again for an excellent plugin.

    Best regards

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

The topic ‘Change default DPI with code snippet?’ is closed to new replies.