ATS-996: TIFF to PDF - invalid output format

This commit is contained in:
Krystian Dabrowski
2023-03-27 16:39:35 +02:00
parent b84a5613f3
commit 8c59a96470
2 changed files with 8 additions and 5 deletions

View File

@@ -150,12 +150,13 @@ public class ImageToPdfTransformer implements CustomTransformerFileAdaptor
}
}
private PDRectangle resolvePdfFormat(final String pdfFormat, final String pdfOrientation, final int actualWidth, final int actualHeight)
private PDRectangle resolvePdfFormat(final String pdfFormat, final String pdfOrientation, final int defaultWidth, final int defaultHeight)
{
PDRectangle pdRectangle;
switch (pdfFormat.toUpperCase()) {
switch (pdfFormat.toUpperCase())
{
case "DEFAULT":
pdRectangle = new PDRectangle(actualWidth, actualHeight);
pdRectangle = new PDRectangle(defaultWidth, defaultHeight);
break;
case "A4":
pdRectangle = PDRectangle.A4;
@@ -186,11 +187,12 @@ public class ImageToPdfTransformer implements CustomTransformerFileAdaptor
break;
default:
log.warn("PDF format: '{}' not supported. Maintaining the default one.", pdfFormat);
pdRectangle = new PDRectangle(actualWidth, actualHeight);
pdRectangle = new PDRectangle(defaultWidth, defaultHeight);
break;
}
switch (pdfOrientation.toUpperCase()) {
switch (pdfOrientation.toUpperCase())
{
case "DEFAULT":
break;
case "PORTRAIT":