Package de.xima.fc.transform.pdf.convert
Class PageFormatUtils
- java.lang.Object
-
- de.xima.fc.transform.pdf.convert.PageFormatUtils
-
public class PageFormatUtils extends Object
Helper for handling the various page formats used by the PDF converter implementations.- Since:
- 8.4.0
- Author:
- XIMA MEDIA GmbH
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PageFormatUtils.ApachePoiPageFormat
Wraps 'Apache POI' (or to be more precise 'open xml word processing') page format settings.static class
PageFormatUtils.AsposePageFormat
Wraps numeric page format constants used by Aspose, see e.g.static class
PageFormatUtils.IntSize
A 'record' that wraps width and height of a rectangle as integer values.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ETargetPageFormat
pageFormatFrom(PdfConversionParams params, ETargetPageFormat autoOverride)
Reads the value of thePdfConversionParams.ParamNames.TARGET_PAGE_FORMAT
conversion parameter.static PageFormatUtils.ApachePoiPageFormat
toApachePoiFormat(ETargetPageFormat pageFormat, PageFormatUtils.ApachePoiPageFormat dfltFormat)
Returns a page format value usable by Apache POI based converters.static PageFormatUtils.AsposePageFormat
toAsposeCellsFormat(ETargetPageFormat pageFormat, PageFormatUtils.AsposePageFormat dfltFormat)
Returns a page format value usable by Aspose.Cells based converters.static PageFormatUtils.AsposePageFormat
toAsposeWordsFormat(ETargetPageFormat pageFormat, PageFormatUtils.AsposePageFormat dfltFormat)
Returns a page format value usable by Aspose.Words based converters.static org.apache.pdfbox.pdmodel.common.PDRectangle
toPdfBoxFormat(ETargetPageFormat pageFormat, org.apache.pdfbox.pdmodel.common.PDRectangle dfltFormat)
Returns a page format value usable by PDFBox based converters.static PageFormatUtils.IntSize
toSizeInPoints(ETargetPageFormat pageFormat, PageFormatUtils.IntSize dfltFormat)
Returns a page format value usable by converters based on DTP points.
-
-
-
Method Detail
-
pageFormatFrom
public static ETargetPageFormat pageFormatFrom(PdfConversionParams params, ETargetPageFormat autoOverride)
Reads the value of thePdfConversionParams.ParamNames.TARGET_PAGE_FORMAT
conversion parameter.- Parameters:
params
- the PDF conversion parameters to processautoOverride
- value to be returned if the parameter value isETargetPageFormat.AUTO
(depending on the converter implementation this may also beETargetPageFormat.AUTO
)- Returns:
- the parameter value or the provided override
-
toPdfBoxFormat
public static org.apache.pdfbox.pdmodel.common.PDRectangle toPdfBoxFormat(ETargetPageFormat pageFormat, org.apache.pdfbox.pdmodel.common.PDRectangle dfltFormat)
Returns a page format value usable by PDFBox based converters.- Parameters:
pageFormat
- the page format value to be processeddfltFormat
- a format value to be returned if the page format isETargetPageFormat.AUTO
or unhandled- Returns:
- the appropriate format value or the provided default format
-
toAsposeCellsFormat
public static PageFormatUtils.AsposePageFormat toAsposeCellsFormat(ETargetPageFormat pageFormat, PageFormatUtils.AsposePageFormat dfltFormat)
Returns a page format value usable by Aspose.Cells based converters.- Parameters:
pageFormat
- the page format value to be processeddfltFormat
- a format value to be returned if the page format isETargetPageFormat.AUTO
or unhandled- Returns:
- the appropriate format value or the provided default format
-
toAsposeWordsFormat
public static PageFormatUtils.AsposePageFormat toAsposeWordsFormat(ETargetPageFormat pageFormat, PageFormatUtils.AsposePageFormat dfltFormat)
Returns a page format value usable by Aspose.Words based converters.- Parameters:
pageFormat
- the page format value to be processeddfltFormat
- a format value to be returned if the page format isETargetPageFormat.AUTO
or unhandled- Returns:
- the appropriate format value or the provided default format
-
toSizeInPoints
public static PageFormatUtils.IntSize toSizeInPoints(ETargetPageFormat pageFormat, PageFormatUtils.IntSize dfltFormat)
Returns a page format value usable by converters based on DTP points.- Parameters:
pageFormat
- the page format value to be processeddfltFormat
- a format value to be returned if the page format isETargetPageFormat.AUTO
or unhandled- Returns:
- the appropriate format value or the provided default format
-
toApachePoiFormat
public static PageFormatUtils.ApachePoiPageFormat toApachePoiFormat(ETargetPageFormat pageFormat, PageFormatUtils.ApachePoiPageFormat dfltFormat)
Returns a page format value usable by Apache POI based converters.- Parameters:
pageFormat
- the page format value to be processeddfltFormat
- a format value to be returned if the page format isETargetPageFormat.AUTO
or unhandled- Returns:
- the appropriate format value or the provided default format
-
-