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 inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapplyImageWatermark
(Blob input, Blob watermark, WatermarkProperties properties) Add an Image watermark to the input PDF blobapplyTextWatermark
(Blob input, String text, WatermarkProperties properties) Add a text watermark to the input PDF blobcomputeTranslationVector
(double pageWidth, double watermarkWidth, double pageHeight, double watermarkHeight, WatermarkProperties properties) 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
getApplicationStartedOrder
-
Field Details
-
MIME_TYPE
- See Also:
-
-
Constructor Details
-
PDFTransformationServiceImpl
public PDFTransformationServiceImpl()
-
-
Method Details
-
getDefaultProperties
- Specified by:
getDefaultProperties
in interfacePDFTransformationService
- Returns:
- the watermark default properties
-
applyTextWatermark
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
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
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
- Throws:
IOException
-