I write on Spring java. The controller already has a method that creates and returns a ModelAndView in the correct format of a PDF file, beautifully formatted with all sorts of embellishments that you don’t want to do again. Can I use this method to create a PDF file? What is needed for that?
For example, is it possible to call this controller method from another method, get the created model and write it just byte-by-byte into a file? Will anything good come out of this?
Or do I just get the HTML code in this case?