cleanups formatting

This commit is contained in:
Anthony Stirling 2024-02-10 14:52:59 +00:00
parent 0fabfea56d
commit 26af6b5636
3 changed files with 14 additions and 14 deletions

View File

@ -88,8 +88,6 @@ public class StampController {
// Load the input PDF // Load the input PDF
PDDocument document = Loader.loadPDF(pdfFile.getBytes()); PDDocument document = Loader.loadPDF(pdfFile.getBytes());
List<Integer> pageNumbers = request.getPageNumbersList(document, false); List<Integer> pageNumbers = request.getPageNumbersList(document, false);
for (int pageIndex : pageNumbers) { for (int pageIndex : pageNumbers) {

View File

@ -24,7 +24,6 @@ public class PDFWithPageNums extends PDFFile {
"The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')\"") "The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')\"")
private String pageNumbers; private String pageNumbers;
@Hidden @Hidden
public List<Integer> getPageNumbersList(boolean zeroCount) { public List<Integer> getPageNumbersList(boolean zeroCount) {
int pageCount = 0; int pageCount = 0;

View File

@ -118,7 +118,9 @@ public class GeneralUtils {
public static List<Integer> parsePageString(String pageOrder, int totalPages) { public static List<Integer> parsePageString(String pageOrder, int totalPages) {
return parsePageString(pageOrder, totalPages, false); return parsePageString(pageOrder, totalPages, false);
} }
public static List<Integer> parsePageString(String pageOrder, int totalPages, boolean isOneBased) {
public static List<Integer> parsePageString(
String pageOrder, int totalPages, boolean isOneBased) {
if (pageOrder == null || pageOrder.isEmpty()) { if (pageOrder == null || pageOrder.isEmpty()) {
return Collections.singletonList(1); return Collections.singletonList(1);
} }
@ -128,12 +130,13 @@ public class GeneralUtils {
} }
return parsePageList(pageOrder.split(","), totalPages, isOneBased); return parsePageList(pageOrder.split(","), totalPages, isOneBased);
} }
public static List<Integer> parsePageList(String[] pageOrderArr, int totalPages) { public static List<Integer> parsePageList(String[] pageOrderArr, int totalPages) {
return parsePageList(pageOrderArr, totalPages, false); return parsePageList(pageOrderArr, totalPages, false);
} }
public static List<Integer> parsePageList(
public static List<Integer> parsePageList(String[] pageOrderArr, int totalPages, boolean isOneBased) { String[] pageOrderArr, int totalPages, boolean isOneBased) {
List<Integer> newPageOrder = new ArrayList<>(); List<Integer> newPageOrder = new ArrayList<>();
int adjustmentFactor = isOneBased ? 1 : 0; int adjustmentFactor = isOneBased ? 1 : 0;