Return generated pdf using spring MVC

You were on the right track with response.getOutputStream(), but you’re not using its output anywhere in your code. Essentially what you need to do is to stream the PDF file’s bytes directly to the output stream and flush the response. In Spring you can do it like this: @RequestMapping(value=”/getpdf”, method=RequestMethod.POST) public ResponseEntity<byte[]> getPDF(@RequestBody String json) … Read more

ITextSharp insert text to an existing pdf

I found a way to do it (dont know if it is the best but it works) string oldFile = “oldFile.pdf”; string newFile = “newFile.pdf”; // open the reader PdfReader reader = new PdfReader(oldFile); Rectangle size = reader.GetPageSizeWithRotation(1); Document document = new Document(size); // open the writer FileStream fs = new FileStream(newFile, FileMode.Create, FileAccess.Write); PdfWriter … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)