Package org.nuxeo.ecm.platform.pdf
Class PDFMerge
java.lang.Object
org.nuxeo.ecm.platform.pdf.PDFMerge
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
, single
DocumentModel
, DocumentModelList
or a list of IDs of DocumentModel
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 default file: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
ConstructorDescriptionPDFMerge()
PDFMerge
(String[] inDocIDs, String inXPath, CoreSession inSession) PDFMerge
(DocumentModelList inDocs, String inXPath) PDFMerge
(DocumentModel inDoc, String inXPath) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addBlob
(DocumentModel inDoc, String inXPath) void
addBlobs
(String[] inDocIDs, String inXPath, CoreSession inSession) void
void
addBlobs
(DocumentModelList inDocs, String inXPath) Merge the PDFs.Merge the PDFs. optionnaly, can set the title, subject and author of the resulting PDF.
-
Constructor Details
-
PDFMerge
public PDFMerge() -
PDFMerge
-
PDFMerge
-
PDFMerge
-
PDFMerge
-
PDFMerge
-
-
Method Details
-
addBlob
-
addBlobs
-
addBlob
-
addBlobs
-
addBlobs
-
merge
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
-