mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-07-31 17:38:33 +00:00
ATS-996: TIFF to PDF - invalid output format
This commit is contained in:
@@ -64,6 +64,7 @@ public class AIOTikaTest extends TikaTest
|
|||||||
"page",
|
"page",
|
||||||
"pageLimit",
|
"pageLimit",
|
||||||
"pdfFormat",
|
"pdfFormat",
|
||||||
|
"pdfOrientation",
|
||||||
"resizeHeight",
|
"resizeHeight",
|
||||||
"resizePercentage",
|
"resizePercentage",
|
||||||
"resizeWidth",
|
"resizeWidth",
|
||||||
|
@@ -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;
|
PDRectangle pdRectangle;
|
||||||
switch (pdfFormat.toUpperCase()) {
|
switch (pdfFormat.toUpperCase())
|
||||||
|
{
|
||||||
case "DEFAULT":
|
case "DEFAULT":
|
||||||
pdRectangle = new PDRectangle(actualWidth, actualHeight);
|
pdRectangle = new PDRectangle(defaultWidth, defaultHeight);
|
||||||
break;
|
break;
|
||||||
case "A4":
|
case "A4":
|
||||||
pdRectangle = PDRectangle.A4;
|
pdRectangle = PDRectangle.A4;
|
||||||
@@ -186,11 +187,12 @@ public class ImageToPdfTransformer implements CustomTransformerFileAdaptor
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log.warn("PDF format: '{}' not supported. Maintaining the default one.", pdfFormat);
|
log.warn("PDF format: '{}' not supported. Maintaining the default one.", pdfFormat);
|
||||||
pdRectangle = new PDRectangle(actualWidth, actualHeight);
|
pdRectangle = new PDRectangle(defaultWidth, defaultHeight);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (pdfOrientation.toUpperCase()) {
|
switch (pdfOrientation.toUpperCase())
|
||||||
|
{
|
||||||
case "DEFAULT":
|
case "DEFAULT":
|
||||||
break;
|
break;
|
||||||
case "PORTRAIT":
|
case "PORTRAIT":
|
||||||
|
Reference in New Issue
Block a user