Title: Change default DPI with code snippet?
Last modified: April 3, 2017

---

# Change default DPI with code snippet?

 *  Resolved [bt_dev](https://wordpress.org/support/users/biotrace/)
 * (@biotrace)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/change-default-dpi-with-code-snippet/)
 * 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](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/change-default-dpi-with-code-snippet/#post-8990172)
 * 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](https://wordpress.org/support/users/biotrace/)
 * (@biotrace)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/change-default-dpi-with-code-snippet/#post-8990310)
 * 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.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [bt_dev](https://wordpress.org/support/users/biotrace/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/change-default-dpi-with-code-snippet/#post-8990310)
 * Status: resolved