Class PDFTransformationServiceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.platform.pdf.service.PDFTransformationServiceImpl
-
- All Implemented Interfaces:
PDFTransformationService
,Adaptable
,Component
,Extensible
,TimestampedService
public class PDFTransformationServiceImpl extends DefaultComponent implements PDFTransformationService
- Since:
- 8.10
-
-
Field Summary
Fields Modifier and Type Field Description protected static Log
log
protected static String
MIME_TYPE
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description PDFTransformationServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Blob
applyImageWatermark(Blob input, Blob watermark, WatermarkProperties properties)
Add an Image watermark to the input PDF blobBlob
applyTextWatermark(Blob input, String text, WatermarkProperties properties)
Add a text watermark to the input PDF blobPoint2D
computeTranslationVector(double pageWidth, double watermarkWidth, double pageHeight, double watermarkHeight, WatermarkProperties properties)
WatermarkProperties
getDefaultProperties()
Blob
overlayPDF(Blob input, Blob overlayBlob)
Overlay a PDF file on top of the input Blobprotected Blob
saveInTempFile(org.apache.pdfbox.pdmodel.PDDocument PdfDoc)
-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
MIME_TYPE
protected static final String MIME_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PDFTransformationServiceImpl
public PDFTransformationServiceImpl()
-
-
Method Detail
-
getDefaultProperties
public WatermarkProperties getDefaultProperties()
- Specified by:
getDefaultProperties
in interfacePDFTransformationService
- Returns:
- the watermark default properties
-
applyTextWatermark
public Blob applyTextWatermark(Blob input, String text, WatermarkProperties properties)
Description copied from interface:PDFTransformationService
Add a text watermark to the input PDF blob- Specified by:
applyTextWatermark
in interfacePDFTransformationService
- Parameters:
input
- A PDF blobtext
- The text to use for the watermarkproperties
- the properties of the watermark- Returns:
- a new PDF file
-
applyImageWatermark
public Blob applyImageWatermark(Blob input, Blob watermark, WatermarkProperties properties)
Description copied from interface:PDFTransformationService
Add an Image watermark to the input PDF blob- Specified by:
applyImageWatermark
in interfacePDFTransformationService
- Parameters:
input
- A PDF blobwatermark
- The image to use for the watermarkproperties
- the properties of the watermark- Returns:
- a new PDF file
-
overlayPDF
public Blob overlayPDF(Blob input, Blob overlayBlob)
Description copied from interface:PDFTransformationService
Overlay a PDF file on top of the input Blob- Specified by:
overlayPDF
in interfacePDFTransformationService
- Parameters:
input
- The original PDF fileoverlayBlob
- The PDF file to overlay on top inBlob- Returns:
- a new PDF file
-
computeTranslationVector
public Point2D computeTranslationVector(double pageWidth, double watermarkWidth, double pageHeight, double watermarkHeight, WatermarkProperties properties)
-
saveInTempFile
protected Blob saveInTempFile(org.apache.pdfbox.pdmodel.PDDocument PdfDoc) throws IOException
- Throws:
IOException
-
-