Package com.nuix.nx.export
Class CombinedPdfExporter
- java.lang.Object
-
- com.nuix.nx.export.CombinedPdfExporter
-
public class CombinedPdfExporter extends java.lang.Object
This class assists in generating combined PDFs outside of Nuix using iText.
-
-
Constructor Summary
Constructors Constructor Description CombinedPdfExporter(java.io.File tempDirectory)
Creates a new instance.CombinedPdfExporter(java.lang.String tempDirectory)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exportItems(java.io.File destination, java.util.List<nuix.Item> items, java.util.Map<java.lang.String,java.lang.Object> settings)
Creates a single PDF from several different items by exporting a PDF for each item then concatenating them and finally cleaning up the temporary PDF files.void
exportItems(java.lang.String destination, java.util.List<nuix.Item> items, java.util.Map<java.lang.String,java.lang.Object> settings)
Creates a single PDF from several different items by exporting a PDF for each item then concatenating them and finally cleaning up the temporary PDF files.java.io.File
getTempDirectory()
Gets the temporary directory used to house the per item temporary PDF files.static void
mergeExistingPdfFiles(java.io.File destination, java.util.List<java.io.File> sources)
This method generates a new PDF by concatenating several existing PDFs.void
setTempDirectory(java.io.File tempDirectory)
Sets the temporary directory used to house the per item temporary PDF files.void
setTempDirectory(java.lang.String tempDirectory)
Sets the temporary directory used to house the per item temporary PDF files.
-
-
-
Constructor Detail
-
CombinedPdfExporter
public CombinedPdfExporter(java.lang.String tempDirectory)
Creates a new instance.- Parameters:
tempDirectory
- The temporary directory which will be used to produce the per item PDFs.
-
CombinedPdfExporter
public CombinedPdfExporter(java.io.File tempDirectory)
Creates a new instance.- Parameters:
tempDirectory
- The temporary directory which will be used to produce the per item PDFs.
-
-
Method Detail
-
mergeExistingPdfFiles
public static void mergeExistingPdfFiles(java.io.File destination, java.util.List<java.io.File> sources) throws com.itextpdf.text.DocumentException, java.io.IOException
This method generates a new PDF by concatenating several existing PDFs.- Parameters:
destination
- The destination to where the new PDF should be written.sources
- List of source PDFs to combine, in order they should be combined in.- Throws:
com.itextpdf.text.DocumentException
- Possibly thrown by iTextjava.io.IOException
- Possibly thrown on IO error
-
getTempDirectory
public java.io.File getTempDirectory()
Gets the temporary directory used to house the per item temporary PDF files.- Returns:
- The temporary directory
-
setTempDirectory
public void setTempDirectory(java.io.File tempDirectory)
Sets the temporary directory used to house the per item temporary PDF files.- Parameters:
tempDirectory
- The temporary directory
-
setTempDirectory
public void setTempDirectory(java.lang.String tempDirectory)
Sets the temporary directory used to house the per item temporary PDF files.- Parameters:
tempDirectory
- The temporary directory
-
exportItems
public void exportItems(java.lang.String destination, java.util.List<nuix.Item> items, java.util.Map<java.lang.String,java.lang.Object> settings) throws java.io.IOException, com.itextpdf.text.DocumentException
Creates a single PDF from several different items by exporting a PDF for each item then concatenating them and finally cleaning up the temporary PDF files. them together usingmergeExistingPdfFiles(File, List)
. See Nuix documentation here and here for more information about supported settings.- Parameters:
destination
- The destination path for the final combined PDFitems
- A list of items to create a combined PDF for, in the order to combine them in.settings
- Optional settings map (can be null)- Throws:
java.io.IOException
- Thrown if there is an IO errorcom.itextpdf.text.DocumentException
- Thrown if iText has an error
-
exportItems
public void exportItems(java.io.File destination, java.util.List<nuix.Item> items, java.util.Map<java.lang.String,java.lang.Object> settings) throws java.io.IOException, com.itextpdf.text.DocumentException
Creates a single PDF from several different items by exporting a PDF for each item then concatenating them and finally cleaning up the temporary PDF files. them together usingmergeExistingPdfFiles(File, List)
. See Nuix documentation here and here for more information about supported settings.- Parameters:
destination
- The destination path for the final combined PDFitems
- A list of items to create a combined PDF for, in the order to combine them in.settings
- Optional settings map (can be null)- Throws:
java.io.IOException
- Thrown if there is an IO errorcom.itextpdf.text.DocumentException
- Thrown if iText has an error
-
-