error handling, excel, bug fixes, name fixes (#57)

This commit is contained in:
Anthony Stirling
2023-02-24 22:47:26 +00:00
committed by GitHub
parent 6135d08154
commit 67345d083e
27 changed files with 558 additions and 45 deletions

View File

@@ -34,7 +34,7 @@ public class OverlayImageController {
byte[] imageBytes = imageFile.getBytes();
byte[] result = PdfUtils.overlayImage(pdfBytes, imageBytes, x, y);
return PdfUtils.bytesToWebResponse(result, pdfFile.getName() + "_overlayed.pdf");
return PdfUtils.bytesToWebResponse(result, pdfFile.getOriginalFilename().replaceFirst("[.][^.]+$", "") + "_overlayed.pdf");
} catch (IOException e) {
logger.error("Failed to add image to PDF", e);
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);