package Ġuk . ac . war wick . cam cat . controllers Ċ Ċ import Ġorg . springframework . http . HttpHeaders . CONTENT _ DIS POSITION Ċ import Ġorg . springframework . http . MediaType Ċ import Ġorg . springframework . stereotype . Controller Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . RequestMapping Ċ import Ġuk . ac . war wick . cam cat . services . Pdf Service Ċ import Ġjavax . servlet . http . HttpServletResponse Ċ Ċ @ Controller Ċ @ RequestMapping ("/ pdf ") Ċ class ĠPdf Controller ( ĊĠ Ġprivate Ġval Ġpdf Service : ĠPdf Service Ċ ) Ġ{ ĊĠ Ġ@ GetMapping ("/ test . pdf ", Ġproduces Ġ= Ġ[ MediaType . APPLICATION _ PDF _ VALUE ]) ĊĠ Ġfun Ġget ( response : ĠHttpServletResponse ) Ġ{ ĊĠĠĠ Ġresponse . setHeader ( CONTENT _ DIS POSITION , Ġ" attachment ; Ġfilename = test . pdf ") ĊĊĠĠĠ Ġpdf Service . render (" pdf / test ", Ġmap Of (" name " Ġto Ġ" Course Ġand ĠModule ĠCatalog ue "), Ġresponse . output Stream ) ĊĠ Ġ} Ċ } Ċ