move pdf handling into its own module