added pdf function also check some env variables for paths