QGIS – Changing Default DPI When Opening PDF

pdfqgis-3

Every time a PDF is opened using QGIS the resolution is quite poor. I believe this is because the standard gdal pdf driver behind QGIS uses a default value of 150 dpi. (see here https://gdal.org/drivers/raster/pdf.html)

But, when using gdal (e.g. gdal_translate) from the cmd window I am able to configure the desired dpi using the option -co GDAL_PDF_DPI 600.

Is it possible to change this option in QGIS?

Using Settings – Data source- GDAL – PDF only the create options can be changed.

Best Answer

You should be able to set GDAL_PDF_DPI as an environment variable.

Go to Settings / Options / System and add this environment variable with the desired value of 600 under Environment. Restart QGIS and see if it now works. This should also add it to the environment, so when you open the command window and run gdal_translate you should not need to add it to the command line.

For other variables you can set in this fashion for GDAL, see https://gdal.org/user/configoptions.html

Related Question