misc beginings

This commit is contained in:
Anthony Stirling
2023-09-09 18:21:55 +01:00
parent db70d67180
commit 872f562aad
25 changed files with 221 additions and 73 deletions
@@ -0,0 +1,12 @@
package stirling.software.SPDF.model.api.misc;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import stirling.software.SPDF.model.api.PDFFile;
@Data
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")
private boolean duplexMode;
}
@@ -0,0 +1,12 @@
package stirling.software.SPDF.model.api.misc;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import stirling.software.SPDF.model.api.PDFFile;
@Data
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")
private Boolean useFirstTextAsFallback;
}
@@ -0,0 +1,27 @@
package stirling.software.SPDF.model.api.misc;
import org.springframework.web.multipart.MultipartFile;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
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")
private int angleThreshold;
@Schema(description = "The tolerance for the image scan extraction", defaultValue = "20", example = "20")
private int tolerance;
@Schema(description = "The minimum area for the image scan extraction", defaultValue = "8000", example = "8000")
private int minArea;
@Schema(description = "The minimum contour area for the image scan extraction", defaultValue = "500", example = "500")
private int minContourArea;
@Schema(description = "The border size for the image scan extraction", defaultValue = "1", example = "1")
private int borderSize;
}
@@ -0,0 +1,16 @@
package stirling.software.SPDF.model.api.misc;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import stirling.software.SPDF.model.api.PDFFile;
@Data
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" })
private Integer optimizeLevel;
@Schema(description = "The expected output size, e.g. '100MB', '25KB', etc.")
private String expectedOutputSizeString;
}
@@ -0,0 +1,15 @@
package stirling.software.SPDF.model.api.misc;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import stirling.software.SPDF.model.api.PDFFile;
@Data
public class RemoveBlankPagesRequest extends PDFFile {
@Schema(description = "The threshold value to determine blank pages", example = "10", defaultValue = "10")
private int threshold;
@Schema(description = "The percentage of white color on a page to consider it as blank", example = "99.9", defaultValue = "99.9")
private float whitePercent;
}