Why duplicating code? All these headers are already set in appendToResponse. Additionally this extra code is only run for ERPDFWrapper as the subclass ERFOPWrapper overrides this method.