mirror of
				https://github.com/Frooodle/Stirling-PDF.git
				synced 2025-11-01 01:21:18 +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 fitOption = request.getFitOption();
 | 
				
			||||||
        String colorType = request.getColorType();
 | 
					        String colorType = request.getColorType();
 | 
				
			||||||
        boolean autoRotate = request.isAutoRotate();
 | 
					        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
 | 
					        // Convert the file to PDF and get the resulting bytes
 | 
				
			||||||
        byte[] bytes =
 | 
					        byte[] bytes =
 | 
				
			||||||
                PdfUtils.imageToPdf(file, fitOption, autoRotate, colorType, pdfDocumentFactory);
 | 
					                PdfUtils.imageToPdf(file, fitOption, autoRotate, colorType, pdfDocumentFactory);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user