Package org.nuxeo.ecm.platform.pdf
Class PDFMerge
- java.lang.Object
-
- org.nuxeo.ecm.platform.pdf.PDFMerge
-
public class PDFMerge extends Object
Merge several PDFs in one.Basically, the caller adds blobs and then
merge()
. The PDFs are merged in the order they were added.The class accepts misc parameters: Single
Blob
,BlobList
, singleDocumentModel
,DocumentModelList
or a list of IDs ofDocumentModel
Notice: These are nuxeo
Blob
,BlobList
, etc.When a
DocumentModel
is used, the code may expect an xpath to extract the blob from the document. When the xpath parameter is not used (null
or ""), the defaultfile:content
xpath is used.To let the caller be generic, it's ok to pass a null blob, so it is just ignored.
- Since:
- 8.10
-
-
Constructor Summary
Constructors Constructor Description PDFMerge()
PDFMerge(String[] inDocIDs, String inXPath, CoreSession inSession)
PDFMerge(BlobList inBlobs)
PDFMerge(Blob inBlob)
PDFMerge(DocumentModelList inDocs, String inXPath)
PDFMerge(DocumentModel inDoc, String inXPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBlob(Blob inBlob)
void
addBlob(DocumentModel inDoc, String inXPath)
void
addBlobs(String[] inDocIDs, String inXPath, CoreSession inSession)
void
addBlobs(BlobList inBlobs)
void
addBlobs(DocumentModelList inDocs, String inXPath)
Blob
merge(String inFileName)
Merge the PDFs.Blob
merge(String inFileName, String inTitle, String inSubject, String inAuthor)
Merge the PDFs.
-
-
-
Constructor Detail
-
PDFMerge
public PDFMerge()
-
PDFMerge
public PDFMerge(Blob inBlob)
-
PDFMerge
public PDFMerge(BlobList inBlobs)
-
PDFMerge
public PDFMerge(DocumentModel inDoc, String inXPath)
-
PDFMerge
public PDFMerge(DocumentModelList inDocs, String inXPath)
-
PDFMerge
public PDFMerge(String[] inDocIDs, String inXPath, CoreSession inSession)
-
-
Method Detail
-
addBlob
public void addBlob(Blob inBlob)
-
addBlobs
public void addBlobs(BlobList inBlobs)
-
addBlob
public void addBlob(DocumentModel inDoc, String inXPath)
-
addBlobs
public void addBlobs(DocumentModelList inDocs, String inXPath)
-
addBlobs
public void addBlobs(String[] inDocIDs, String inXPath, CoreSession inSession)
-
merge
public Blob merge(String inFileName) throws IOException
Merge the PDFs.- Parameters:
inFileName
- Name of the merged result.- Returns:
- The Blob embedding the PDF resulting form the merge.
- Throws:
IOException
-
merge
public Blob merge(String inFileName, String inTitle, String inSubject, String inAuthor) throws IOException
Merge the PDFs. optionnaly, can set the title, subject and author of the resulting PDF.Notice for title, author and subject: If the value is null or "", it is just ignored.
- Parameters:
inFileName
- Name of the merged result.inTitle
- Title of the resulting PDF.inSubject
- Subject of the resulting PDF.inAuthor
- Author of the resulting PDF.- Returns:
- The Blob embedding the PDF resulting from the merge.
- Throws:
IOException
-
-