PDF security features (#26)

- Support for adding and removing passwords
- Support for watermarks
- Dedicated page remover
- Support for PDF permissions
- Removed endpoint /home and replaced with /
- Code cleanups
- Fixed page titles
This commit is contained in:
Anthony Stirling
2023-02-03 20:26:35 +00:00
committed by GitHub
parent 1937a83531
commit 5275866f09
34 changed files with 1253 additions and 604 deletions

View File

@@ -53,21 +53,7 @@ public class RotationController {
page.setRotation(Integer.valueOf(angle));
}
// Save the rearranged PDF to a ByteArrayOutputStream
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
document.save(outputStream);
// Close the document
document.close();
// Prepare the response headers
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_PDF);
headers.setContentDispositionFormData("attachment", "output.pdf");
headers.setContentLength(outputStream.size());
// Return the response with the PDF data and headers
return new ResponseEntity<>(outputStream.toByteArray(), headers, HttpStatus.OK);
return PdfUtils.pdfDocToWebResponse(document, pdfFile.getName() + "_rotated.pdf");
}