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 Loglogprotected static StringMIME_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 BlobapplyImageWatermark(Blob input, Blob watermark, WatermarkProperties properties)Add an Image watermark to the input PDF blobBlobapplyTextWatermark(Blob input, String text, WatermarkProperties properties)Add a text watermark to the input PDF blobPoint2DcomputeTranslationVector(double pageWidth, double watermarkWidth, double pageHeight, double watermarkHeight, WatermarkProperties properties)WatermarkPropertiesgetDefaultProperties()BloboverlayPDF(Blob input, Blob overlayBlob)Overlay a PDF file on top of the input Blobprotected BlobsaveInTempFile(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:
getDefaultPropertiesin interfacePDFTransformationService- Returns:
- the watermark default properties
-
applyTextWatermark
public Blob applyTextWatermark(Blob input, String text, WatermarkProperties properties)
Description copied from interface:PDFTransformationServiceAdd a text watermark to the input PDF blob- Specified by:
applyTextWatermarkin 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:PDFTransformationServiceAdd an Image watermark to the input PDF blob- Specified by:
applyImageWatermarkin 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:PDFTransformationServiceOverlay a PDF file on top of the input Blob- Specified by:
overlayPDFin 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
-
-