Finish patching the Pdf component, update tests