Transform svg to pdf only when needed