I was able to calculate band energies in quantum espresso. How to convert them to values that are in terms of difference from vacuum energy?
First of all, you need to find where the vacuum energy level is. To that purpose, you need first calculate the planar average of the electrostatic potential like the following figure:
from which you can find the vacuum energy level. How to obtain this figure with Quantum Espresso?