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, 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 Details

  • Method Details

    • 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