mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
refactor: remove redundant variables and fix form copy logic
- Remove redundant variable declarations - Skip form copying/transformation for portrait orientation - Skip form copying/transformation when source has rotated pages
This commit is contained in:
parent
28f12acef8
commit
d7fa60d670
@ -87,8 +87,7 @@ public class MultiPageLayoutController {
|
||||
pagesPerSheet = cols * rows;
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException(
|
||||
"Mode must be CUSTOM or DEFAULT");
|
||||
throw new IllegalArgumentException("Mode must be CUSTOM or DEFAULT");
|
||||
}
|
||||
|
||||
MultipartFile file = request.getFileInput();
|
||||
@ -159,8 +158,8 @@ public class MultiPageLayoutController {
|
||||
int adjustedPageIndex =
|
||||
i % pagesPerSheet; // Close the current content stream and create a new
|
||||
// page and content stream
|
||||
int rowIndex = 0;
|
||||
int colIndex = 0;
|
||||
int rowIndex;
|
||||
int colIndex;
|
||||
|
||||
switch (pageOrder) {
|
||||
case "LR_TD": // Left→Right, then Top→Down
|
||||
@ -215,7 +214,7 @@ public class MultiPageLayoutController {
|
||||
|
||||
// If any source page is rotated, skip form copying/transformation entirely
|
||||
boolean hasRotation = FormUtils.hasAnyRotatedPage(sourceDocument);
|
||||
if (hasRotation) {
|
||||
if (hasRotation || "LANDSCAPE".equals(orientation)) {
|
||||
log.info("Source document has rotated pages; skipping form field copying.");
|
||||
} else {
|
||||
try {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user