rewrote pdf-url function to be easier to extend with additional functions stored in a variable