mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2024-12-21 19:08:24 +01:00
Add default to convert image to pdf api
This commit is contained in:
parent
e9f80d03ea
commit
12d86049f6
@ -210,7 +210,13 @@ public class ConvertImgPDFController {
|
||||
String fitOption = request.getFitOption();
|
||||
String colorType = request.getColorType();
|
||||
boolean autoRotate = request.isAutoRotate();
|
||||
|
||||
// Handle Null entries for formdata
|
||||
if (colorType == null || colorType.isBlank()) {
|
||||
colorType = "color";
|
||||
}
|
||||
if (fitOption == null || fitOption.isEmpty()) {
|
||||
fitOption = "fitDocumentToImage";
|
||||
}
|
||||
// Convert the file to PDF and get the resulting bytes
|
||||
byte[] bytes =
|
||||
PdfUtils.imageToPdf(file, fitOption, autoRotate, colorType, pdfDocumentFactory);
|
||||
|
Loading…
Reference in New Issue
Block a user