Skip to content

Commit

Permalink
scaled changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Frooodle committed May 31, 2023
1 parent 5e01946 commit 15d3941
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void init() {
addEndpointToGroup("Java", "change-metadata");
addEndpointToGroup("Java", "cert-sign");
addEndpointToGroup("Java", "multi-page-layout");

addEndpointToGroup("Java", "scale-pages");


//Javascript
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -25,6 +25,7 @@
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 {
Expand Down Expand Up @@ -81,8 +82,6 @@ public ResponseEntity<byte[]> mergeMultiplePagesIntoOne(
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");
}
}
4 changes: 2 additions & 2 deletions src/main/resources/static/images/scale-pages.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/resources/templates/other/scale-pages.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html th:lang="${#locale.toString()}" th:lang-direction="#{language.direction}" xmlns:th="http://www.thymeleaf.org">


<th:block th:insert="~{fragments/common :: head(title=#{pageLayout.title})}"></th:block>
<th:block th:insert="~{fragments/common :: head(title=#{scalePages.title})}"></th:block>


<body>
Expand Down

0 comments on commit 15d3941

Please sign in to comment.