cleanup and defaults

This commit is contained in:
Anthony Stirling
2023-09-11 23:42:18 +01:00
parent 1404e33386
commit 24e665bfd5
52 changed files with 28 additions and 139 deletions

View File

@@ -18,5 +18,5 @@ public class MergePdfsRequest extends MultiplePDFFiles {
"byPDFTitle"
},
defaultValue = "orderProvided")
private String sortType;
private String sortType = "orderProvided";
}

View File

@@ -13,17 +13,17 @@ public class ExtractImageScansRequest {
private MultipartFile fileInput;
@Schema(description = "The angle threshold for the image scan extraction", defaultValue = "5", example = "5")
private int angleThreshold;
private int angleThreshold = 5;
@Schema(description = "The tolerance for the image scan extraction", defaultValue = "20", example = "20")
private int tolerance;
private int tolerance = 20;
@Schema(description = "The minimum area for the image scan extraction", defaultValue = "8000", example = "8000")
private int minArea;
private int minArea = 8000;
@Schema(description = "The minimum contour area for the image scan extraction", defaultValue = "500", example = "500")
private int minContourArea;
private int minContourArea = 500;
@Schema(description = "The border size for the image scan extraction", defaultValue = "1", example = "1")
private int borderSize;
private int borderSize =1;
}

View File

@@ -30,7 +30,7 @@ public class ProcessPdfWithOcrRequest extends PDFFile {
private String ocrType;
@Schema(description = "Specify the OCR render type, either 'hocr' or 'sandwich'", allowableValues = {"hocr", "sandwich"}, defaultValue = "hocr")
private String ocrRenderType;
private String ocrRenderType = "hocr";
@Schema(description = "Remove images from the output PDF if set to true")
private Boolean removeImagesAfter;

View File

@@ -10,8 +10,8 @@ import stirling.software.SPDF.model.api.PDFFile;
public class RemoveBlankPagesRequest extends PDFFile {
@Schema(description = "The threshold value to determine blank pages", example = "10", defaultValue = "10")
private int threshold;
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")
private float whitePercent;
private float whitePercent = 99.9f;
}

View File

@@ -16,7 +16,7 @@ public class AddPasswordRequest extends PDFFile {
private String password;
@Schema(description = "The length of the encryption key", allowableValues = {"40", "128", "256"}, defaultValue = "256")
private int keyLength;
private int keyLength = 256;
@Schema(description = "Whether the document assembly is allowed", example = "false")
private boolean canAssembleDocument;

View File

@@ -11,7 +11,9 @@ import stirling.software.SPDF.model.api.PDFFile;
@EqualsAndHashCode(callSuper=true)
public class AddWatermarkRequest extends PDFFile {
@Schema(description = "The watermark type (text or image)", required = true)
@Schema(description = "The watermark type (text or image)",
allowableValues = {"text", "image"},
required = true)
private String watermarkType;
@Schema(description = "The watermark text")
@@ -23,13 +25,13 @@ public class AddWatermarkRequest extends PDFFile {
@Schema(description = "The selected alphabet",
allowableValues = {"roman", "arabic", "japanese", "korean", "chinese"},
defaultValue = "roman")
private String alphabet;
private String alphabet = "roman";
@Schema(description = "The font size of the watermark text", example = "30")
private float fontSize;
private float fontSize = 30;
@Schema(description = "The rotation of the watermark in degrees", example = "0")
private float rotation;
private float rotation = 0;
@Schema(description = "The opacity of the watermark (0.0 - 1.0)", example = "0.5")
private float opacity;

View File

@@ -19,7 +19,7 @@ public class RedactPdfRequest extends PDFFile {
private boolean wholeWordSearch;
@Schema(description = "The color for redaction", defaultValue = "#000000")
private String redactColor;
private String redactColor = "#000000";
@Schema(description = "Custom padding for redaction", type = "number")
private float customPadding;