creating pdf on the fly