New version of makepdf with functions.