I have a number of shapefile layers loaded with 0% opacity so they cannot be seen on the map canvas, only 1 layer is visible with 100% opacity. But when I export this as a pdf from the layout, it shows all layers as being visible.

Is there a setting somewhere to fix this? I'm using QGIS 3.16.

  • There are two options to adjust the opacity of a layer: The first one is shown in the symbology overview tab, the other one by adjusting a color (rgb and opacity). Did you try to adjust both the options? I seem to remember that I had a similar problem and it did work with one of the options. Hard to describe without pictures, I hope you get, what I mean
    – gHupf
    Nov 23, 2020 at 12:20
  • @gHupf, yes I think I understand what you mean. There is setting the layer's opacity and then there's setting the opacity of the layer's symbology. I'm using layer.setOpacity(0) for the 'invisible' layers which I hoped it would be enough. Haven't tested it with the symbols yet, I'll try that out thanks!
    – user35594
    Nov 23, 2020 at 12:52
  • @gHupf, your suggestion of changing the opacity of the symbology works. Another solution I found was to enable the Print as raster option which just takes a snapshot of the canvas. If you post this as an answer, I'll accept it thanks.
    – user35594
    Nov 23, 2020 at 13:17

1 Answer 1


QGIS offers two options to adjust the opacity of a layer:

  1. Adjusting the opacity for the whole symbology/layer: layer opacity adjustment
  1. Adjusting the opacity for the colors, the layer uses:color opacity adjustment

If either one of the options does not work, the other does the job for you.

Note: I cannot tell why this happens. This could be a possible improvement to the answer.

  • I came up to this as I get the same problem. An important hint: This problem came up with QGIS 3.16, within 3.10 everything works fine! Vector layers with an adjusted opacity for the layer and not the symbol are printed as they are shown within the print dialog. So anone know if this is a bug or is there a reason for it?
    – danceb
    Jan 22, 2021 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.