Replaced generic and deprecated code in PrintingComponent.