formatting

This commit is contained in:
Anthony Stirling
2023-12-30 19:11:27 +00:00
parent 7b43fca6fc
commit 5f771b7851
155 changed files with 5539 additions and 4767 deletions
@@ -1,15 +1,18 @@
package stirling.software.SPDF.model.api.misc;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import stirling.software.SPDF.model.api.PDFWithPageNums;
@Data
@EqualsAndHashCode(callSuper=true)
@EqualsAndHashCode(callSuper = true)
public class AddPageNumbersRequest extends PDFWithPageNums {
@Schema(description = "Custom margin: small/medium/large", allowableValues = {"small", "medium", "large"})
@Schema(
description = "Custom margin: small/medium/large",
allowableValues = {"small", "medium", "large"})
private String customMargin;
@Schema(description = "Position: 1 of 9 positions", minimum = "1", maximum = "9")
@@ -21,6 +24,8 @@ public class AddPageNumbersRequest extends PDFWithPageNums {
@Schema(description = "Which pages to number, default all")
private String pagesToNumber;
@Schema(description = "Custom text: defaults to just number but can have things like \"Page {n} of {p}\"")
@Schema(
description =
"Custom text: defaults to just number but can have things like \"Page {n} of {p}\"")
private String customText;
}
@@ -1,14 +1,19 @@
package stirling.software.SPDF.model.api.misc;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import stirling.software.SPDF.model.api.PDFFile;
@Data
@EqualsAndHashCode(callSuper=true)
@EqualsAndHashCode(callSuper = true)
public class AutoSplitPdfRequest extends PDFFile {
@Schema(description = "Flag indicating if the duplex mode is active, where the page after the divider also gets removed.", required = false, defaultValue = "false")
@Schema(
description =
"Flag indicating if the duplex mode is active, where the page after the divider also gets removed.",
required = false,
defaultValue = "false")
private boolean duplexMode;
}
@@ -1,14 +1,19 @@
package stirling.software.SPDF.model.api.misc;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import stirling.software.SPDF.model.api.PDFFile;
@Data
@EqualsAndHashCode(callSuper=true)
@EqualsAndHashCode(callSuper = true)
public class ExtractHeaderRequest extends PDFFile {
@Schema(description = "Flag indicating whether to use the first text as a fallback if no suitable title is found. Defaults to false.", required = false, defaultValue = "false")
@Schema(
description =
"Flag indicating whether to use the first text as a fallback if no suitable title is found. Defaults to false.",
required = false,
defaultValue = "false")
private boolean useFirstTextAsFallback;
}
@@ -3,6 +3,7 @@ package stirling.software.SPDF.model.api.misc;
import org.springframework.web.multipart.MultipartFile;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -12,18 +13,33 @@ public class ExtractImageScansRequest {
@Schema(description = "The input file containing image scans", required = true)
private MultipartFile fileInput;
@Schema(description = "The angle threshold for the image scan extraction", defaultValue = "5", example = "5")
@Schema(
description = "The angle threshold for the image scan extraction",
defaultValue = "5",
example = "5")
private int angleThreshold = 5;
@Schema(description = "The tolerance for the image scan extraction", defaultValue = "20", example = "20")
@Schema(
description = "The tolerance for the image scan extraction",
defaultValue = "20",
example = "20")
private int tolerance = 20;
@Schema(description = "The minimum area for the image scan extraction", defaultValue = "8000", example = "8000")
@Schema(
description = "The minimum area for the image scan extraction",
defaultValue = "8000",
example = "8000")
private int minArea = 8000;
@Schema(description = "The minimum contour area for the image scan extraction", defaultValue = "500", example = "500")
@Schema(
description = "The minimum contour area for the image scan extraction",
defaultValue = "500",
example = "500")
private int minContourArea = 500;
@Schema(description = "The border size for the image scan extraction", defaultValue = "1", example = "1")
private int borderSize =1;
@Schema(
description = "The border size for the image scan extraction",
defaultValue = "1",
example = "1")
private int borderSize = 1;
}
@@ -3,12 +3,13 @@ package stirling.software.SPDF.model.api.misc;
import java.util.Map;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import stirling.software.SPDF.model.api.PDFFile;
@Data
@EqualsAndHashCode(callSuper=true)
@EqualsAndHashCode(callSuper = true)
public class MetadataRequest extends PDFFile {
@Schema(description = "Delete all metadata if set to true")
@@ -41,6 +42,8 @@ public class MetadataRequest extends PDFFile {
@Schema(description = "The trapped status of the document")
private String trapped;
@Schema(description = "Map list of key and value of custom parameters. Note these must start with customKey and customValue if they are non-standard")
@Schema(
description =
"Map list of key and value of custom parameters. Note these must start with customKey and customValue if they are non-standard")
private Map<String, String> allRequestParams;
}
@@ -1,16 +1,19 @@
package stirling.software.SPDF.model.api.misc;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import stirling.software.SPDF.model.api.PDFFile;
@Data
@EqualsAndHashCode(callSuper=true)
@EqualsAndHashCode(callSuper = true)
public class OptimizePdfRequest extends PDFFile {
@Schema(description = "The level of optimization to apply to the PDF file. Higher values indicate greater compression but may reduce quality.",
allowableValues = { "1", "2", "3", "4", "5" })
@Schema(
description =
"The level of optimization to apply to the PDF file. Higher values indicate greater compression but may reduce quality.",
allowableValues = {"1", "2", "3", "4", "5"})
private Integer optimizeLevel;
@Schema(description = "The expected output size, e.g. '100MB', '25KB', etc.")
@@ -3,23 +3,30 @@ package stirling.software.SPDF.model.api.misc;
import org.springframework.web.multipart.MultipartFile;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import stirling.software.SPDF.model.api.PDFFile;
@Data
@EqualsAndHashCode(callSuper=true)
@EqualsAndHashCode(callSuper = true)
public class OverlayImageRequest extends PDFFile {
@Schema(description = "The image file to be overlaid onto the PDF.")
private MultipartFile imageFile;
@Schema(description = "The x-coordinate at which to place the top-left corner of the image.", example = "0")
@Schema(
description = "The x-coordinate at which to place the top-left corner of the image.",
example = "0")
private float x;
@Schema(description = "The y-coordinate at which to place the top-left corner of the image.", example = "0")
@Schema(
description = "The y-coordinate at which to place the top-left corner of the image.",
example = "0")
private float y;
@Schema(description = "Whether to overlay the image onto every page of the PDF.", example = "false")
@Schema(
description = "Whether to overlay the image onto every page of the PDF.",
example = "false")
private boolean everyPage;
}
@@ -3,12 +3,13 @@ package stirling.software.SPDF.model.api.misc;
import java.util.List;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import stirling.software.SPDF.model.api.PDFFile;
@Data
@EqualsAndHashCode(callSuper=true)
@EqualsAndHashCode(callSuper = true)
public class ProcessPdfWithOcrRequest extends PDFFile {
@Schema(description = "List of languages to use in OCR processing")
@@ -26,10 +27,15 @@ public class ProcessPdfWithOcrRequest extends PDFFile {
@Schema(description = "Clean the final output if set to true")
private boolean cleanFinal;
@Schema(description = "Specify the OCR type, e.g., 'skip-text', 'force-ocr', or 'Normal'", allowableValues = {"skip-text", "force-ocr", "Normal"})
@Schema(
description = "Specify the OCR type, e.g., 'skip-text', 'force-ocr', or 'Normal'",
allowableValues = {"skip-text", "force-ocr", "Normal"})
private String ocrType;
@Schema(description = "Specify the OCR render type, either 'hocr' or 'sandwich'", allowableValues = {"hocr", "sandwich"}, defaultValue = "hocr")
@Schema(
description = "Specify the OCR render type, either 'hocr' or 'sandwich'",
allowableValues = {"hocr", "sandwich"},
defaultValue = "hocr")
private String ocrRenderType = "hocr";
@Schema(description = "Remove images from the output PDF if set to true")
@@ -1,17 +1,24 @@
package stirling.software.SPDF.model.api.misc;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import stirling.software.SPDF.model.api.PDFFile;
@Data
@EqualsAndHashCode(callSuper=true)
@EqualsAndHashCode(callSuper = true)
public class RemoveBlankPagesRequest extends PDFFile {
@Schema(description = "The threshold value to determine blank pages", example = "10", defaultValue = "10")
@Schema(
description = "The threshold value to determine blank pages",
example = "10",
defaultValue = "10")
private int threshold = 10;
@Schema(description = "The percentage of white color on a page to consider it as blank", example = "99.9", defaultValue = "99.9")
@Schema(
description = "The percentage of white color on a page to consider it as blank",
example = "99.9",
defaultValue = "99.9")
private float whitePercent = 99.9f;
}