numbers name

This commit is contained in:
Anthony Stirling 2023-07-25 00:01:20 +01:00
parent 9e655631b4
commit 29dab5e47d

View file

@ -165,10 +165,8 @@ public class PageNumbersController {
pdfDoc.close(); pdfDoc.close();
byte[] resultBytes = baos.toByteArray(); byte[] resultBytes = baos.toByteArray();
return ResponseEntity.ok() return WebResponseUtils.bytesToWebResponse(resultBytes, URLEncoder.encode(file.getOriginalFilename().replaceFirst("[.][^.]+$", "") + "_numbersAdded.pdf", "UTF-8"), MediaType.APPLICATION_PDF);
.header("Content-Type", "application/pdf; charset=UTF-8")
.header("Content-Disposition", "inline; filename=" + URLEncoder.encode(file.getOriginalFilename().replaceFirst("[.][^.]+$", "") + "_numbersAdded.pdf", "UTF-8"))
.body(resultBytes);
} }