This commit is contained in:
Anthony Stirling
2023-09-09 00:25:27 +01:00
parent 264969e80c
commit b1fd798a5c
39 changed files with 468 additions and 195 deletions
@@ -0,0 +1,26 @@
package stirling.software.SPDF.model.api.general;
import lombok.Data;
import stirling.software.SPDF.model.api.PDFFile;
import org.springframework.web.multipart.MultipartFile;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
@Data
public class CropPdfForm extends PDFFile {
@Schema(description = "The x-coordinate of the top-left corner of the crop area", type = "number")
private float x;
@Schema(description = "The y-coordinate of the top-left corner of the crop area", type = "number")
private float y;
@Schema(description = "The width of the crop area", type = "number")
private float width;
@Schema(description = "The height of the crop area", type = "number")
private float height;
}
@@ -0,0 +1,13 @@
package stirling.software.SPDF.model.api.general;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import stirling.software.SPDF.model.api.PDFFile;
@Data
public class MergeMultiplePagesRequest extends PDFFile {
@Schema(description = "The number of pages to fit onto a single sheet in the output PDF.",
type = "integer", allowableValues = {"2", "3", "4", "9", "16"})
private int pagesPerSheet;
}
@@ -0,0 +1,20 @@
package stirling.software.SPDF.model.api.general;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import stirling.software.SPDF.model.api.MultiplePDFFiles;
@Data
public class MergePdfsRequest extends MultiplePDFFiles {
@Schema(description = "The type of sorting to be applied on the input files before merging.",
allowableValues = {
"orderProvided",
"byFileName",
"byDateModified",
"byDateCreated",
"byPDFTitle"
},
defaultValue = "orderProvided")
private String sortType;
}
@@ -0,0 +1,23 @@
package stirling.software.SPDF.model.api.general;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
import stirling.software.SPDF.model.api.PDFFile;
import stirling.software.SPDF.model.api.PDFWithPageNums;
import stirling.software.SPDF.model.SortTypes;
@Data
public class RearrangePagesRequest extends PDFWithPageNums {
@Schema(implementation = SortTypes.class, description = "The custom mode for page rearrangement. Valid values are:\n"
+ "REVERSE_ORDER: Reverses the order of all pages.\n"
+ "DUPLEX_SORT: Sorts pages as if all fronts were scanned then all backs in reverse (1, n, 2, n-1, ...). "
+ "BOOKLET_SORT: Arranges pages for booklet printing (last, first, second, second last, ...).\n"
+ "ODD_EVEN_SPLIT: Splits and arranges pages into odd and even numbered pages.\n"
+ "REMOVE_FIRST: Removes the first page.\n" + "REMOVE_LAST: Removes the last page.\n"
+ "REMOVE_FIRST_AND_LAST: Removes both the first and the last pages.\n")
private String customMode;
}
@@ -0,0 +1,13 @@
package stirling.software.SPDF.model.api.general;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
import stirling.software.SPDF.model.api.PDFFile;
@Data
public class RotatePDFRequest extends PDFFile {
@Schema(description = "The angle by which to rotate the PDF file. This should be a multiple of 90.", example = "90")
private Integer angle;
}
@@ -0,0 +1,20 @@
package stirling.software.SPDF.model.api.general;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
import stirling.software.SPDF.model.api.PDFFile;
@Data
public class ScalePagesRequest extends PDFFile {
@Schema(description = "The scale of pages in the output PDF. Acceptable values are A0-A10, B0-B9, LETTER, TABLOID, LEDGER, LEGAL, EXECUTIVE.",
allowableValues = {
"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10", "B0", "B1", "B2", "B3", "B4",
"B5", "B6", "B7", "B8", "B9", "LETTER", "TABLOID", "LEDGER", "LEGAL", "EXECUTIVE"
})
private String targetPDRectangle;
@Schema(description = "The scale of the content on the pages of the output PDF. Acceptable values are floats.")
private float scaleFactor;
}