scaled changes

This commit is contained in:
Anthony Stirling
2023-05-31 21:33:45 +01:00
parent 5e01946981
commit 15d39413f3
5 changed files with 8 additions and 9 deletions

View File

@@ -165,7 +165,7 @@ public class EndpointConfiguration {
addEndpointToGroup("Java", "change-metadata");
addEndpointToGroup("Java", "cert-sign");
addEndpointToGroup("Java", "multi-page-layout");
addEndpointToGroup("Java", "scale-pages");
//Javascript

View File

@@ -1,4 +1,4 @@
package stirling.software.SPDF.controller.api.other;
package stirling.software.SPDF.controller.api;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

View File

@@ -1,4 +1,4 @@
package stirling.software.SPDF.controller.api.other;
package stirling.software.SPDF.controller.api;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -25,6 +25,7 @@ import com.itextpdf.kernel.pdf.xobject.PdfFormXObject;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import stirling.software.SPDF.utils.WebResponseUtils;
@RestController
public class ScalePagesController {
@@ -81,8 +82,6 @@ public class ScalePagesController {
outputPdf.close();
byte[] pdfContent = baos.toByteArray();
pdfDoc.close();
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getOriginalFilename().replaceFirst("[.][^.]+$", "") + "_modified.pdf\"")
.body(pdfContent);
return WebResponseUtils.bytesToWebResponse(pdfContent, file.getOriginalFilename().replaceFirst("[.][^.]+$", "") + "_scaled.pdf");
}
}