Updated to only rebuild pdf on change in content