DynamicPDF by ceTe Software

com.cete.dynamicpdf.merger
Class MergeDocument

java.lang.Object
  extended by com.cete.dynamicpdf.Document
      extended by com.cete.dynamicpdf.merger.MergeDocument

public class MergeDocument
extends Document

This is the primary class used to merge or append entire PDF documents or certain pages from existing documents. The merge document can be output to any object derived from the java.io.* class that supports writing and can easily be integrated with SERVLETS/JSP to stream the document to Internet Information Server's HTTP output stream.

Licensing:
This class is a DynamicPDF Merger Standard Edition feature. One of the following licenses is required for non-evaluation usage:

View Example


Constructor Summary
MergeDocument()
          Initializes a new instance of the MergeDocument class.
MergeDocument(PdfDocument pdfDocument)
          Initializes a new instance of the MergeDocument class.
MergeDocument(PdfDocument pdfDocument, int startPage, int pageCount)
          Initializes a new instance of the MergeDocument class.
MergeDocument(PdfDocument pdfDocument, int startPage, int pageCount, MergeOptions options)
          Initializes a new instance of the MergeDocument class.
MergeDocument(PdfDocument pdfDocument, MergeOptions options)
          Initializes a new instance of the MergeDocument class.
MergeDocument(java.lang.String filePath)
          Initializes a new instance of the MergeDocument class.
MergeDocument(java.lang.String filePath, int startPage, int pageCount)
          Initializes a new instance of the MergeDocument class.
MergeDocument(java.lang.String filePath, int startPage, int pageCount, MergeOptions options)
          Initializes a new instance of the MergeDocument class.
MergeDocument(java.lang.String filePath, MergeOptions options)
          Initializes a new instance of the MergeDocument class.
 
Method Summary
 AppendedPage[] append(PdfDocument pdfDocument)
          Appends a PDF document to the current document.
 AppendedPage[] append(PdfDocument pdfDocument, int startPage, int pageCount)
          Appends a PDF document to the current document.
 AppendedPage[] append(PdfDocument pdfDocument, int startPage, int pageCount, MergeOptions options)
          Appends a PDF document to the current document.
 AppendedPage[] append(PdfDocument pdfDocument, MergeOptions options)
          Appends a PDF document to the current document.
 AppendedPage[] append(java.lang.String filePath)
          Appends a PDF document to the current document.
 AppendedPage[] append(java.lang.String filePath, int startPage, int pageCount)
          Appends a PDF document to the current document.
 AppendedPage[] append(java.lang.String filePath, int startPage, int pageCount, MergeOptions options)
          Appends a PDF document to the current document.
 AppendedPage[] append(java.lang.String filePath, MergeOptions options)
          Appends a PDF document to the current document.
protected  void drawRootEntries(DocumentWriter writer)
          Outputs the catalog entries to the .
 int getInitialPage()
          Gets a value indicating the initial page of the Document.
 PageZoom getInitialPageZoom()
          Gets or sets a value indicating the initial zoom of the Document.
 XmpMetadata getXmpMetadata()
          Gets the Xmp metadata for the PDF document.
static MergeDocument merge(PdfDocument firstDocument, MergeOptions firstDocumentOptions, PdfDocument secondDocument, MergeOptions secondDocumentOptions)
          Merges two PDF documents together.
static MergeDocument merge(PdfDocument firstDocument, PdfDocument secondDocument)
          Merges two PDF documents together.
static MergeDocument merge(java.lang.String firstDocumentFilePath, MergeOptions firstDocumentOptions, java.lang.String secondDocumentFilePath, MergeOptions secondDocumentOptions)
          Merges two PDF documents together.
static MergeDocument merge(java.lang.String firstDocumentFilePath, java.lang.String secondDocumentFilePath)
          Merges two PDF documents together.
 void setInitialPage(int value)
          Sets a value indicating the initial page of the Document.
 void setInitialPageZoom(PageZoom value)
          Sets a value indicating the initial zoom of the Document.
 void setXmpMetadata(XmpMetadata value)
          Sets the Xmp metadata for the PDF document.
 
Methods inherited from class com.cete.dynamicpdf.Document
addLicense, certify, certify, certify, draw, draw, draw, drawToWeb, drawToWeb, drawToWeb, drawToWeb, fromHtml, fromHtml, fromHtml, fromHtml, fromHtml, fromHtml, getAuthor, getCompressionLevel, getCreator, getCustomProperties, getDefaultPdfFormat, getDefaultPdfVersion, getEmbeddedFiles, getForm, getFormFlattening, getInitialPageLayout, getInitialPageMode, getJavaScripts, getKeywords, getLanguage, getOptimization, getOutlines, getOutputIntents, getPackage, getPages, getPdfFormat, getPdfVersion, getPdfXVersion, getProducer, getProductBuildNumber, getProductVersion, getReaderEvents, getSections, getSecurity, getStampTemplate, getSubject, getTag, getTemplate, getTitle, getTrapped, getViewerPreferences, requireLicense, requireLicense, setAuthor, setCompressionLevel, setCreator, setDefaultPdfFormat, setDefaultPdfVersion, setFormFlattening, setInitialPageLayout, setInitialPageMode, setKeywords, setLanguage, setOptimization, setPackage, setPdfFormat, setPdfVersion, setPdfXVersion, setProducer, setSecurity, setStampTemplate, setSubject, setTag, setTemplate, setTitle, setTrapped, sign, sign, sign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergeDocument

public MergeDocument()
Initializes a new instance of the MergeDocument class.


MergeDocument

public MergeDocument(java.lang.String filePath)
Initializes a new instance of the MergeDocument class.

Parameters:
filePath - The physical file path of the PDF to import.

MergeDocument

public MergeDocument(PdfDocument pdfDocument)
Initializes a new instance of the MergeDocument class.

Parameters:
pdfDocument - The PdfDocument to import.
See Also:
PdfDocument

MergeDocument

public MergeDocument(java.lang.String filePath,
                     MergeOptions options)
Initializes a new instance of the MergeDocument class.

Parameters:
filePath - The physical file path of the PDF to import.
options - A MergeOptions object specifying the merge options.
See Also:
MergeOptions

MergeDocument

public MergeDocument(PdfDocument pdfDocument,
                     MergeOptions options)
Initializes a new instance of the MergeDocument class.

Parameters:
pdfDocument - The PdfDocument to import.
options - A MergeOptions object specifying the merge options.
See Also:
PdfDocument, MergeOptions

MergeDocument

public MergeDocument(java.lang.String filePath,
                     int startPage,
                     int pageCount)
Initializes a new instance of the MergeDocument class.

Parameters:
filePath - The physical file path of the PDF to import.
startPage - The page to start importing from.
pageCount - The number of pages to import.

MergeDocument

public MergeDocument(PdfDocument pdfDocument,
                     int startPage,
                     int pageCount)
Initializes a new instance of the MergeDocument class.

Parameters:
pdfDocument - The PdfDocument to import.
startPage - The page to start importing from.
pageCount - The number of pages to import.
See Also:
PdfDocument

MergeDocument

public MergeDocument(java.lang.String filePath,
                     int startPage,
                     int pageCount,
                     MergeOptions options)
Initializes a new instance of the MergeDocument class.

Parameters:
filePath - The physical file path of the PDF to import.
startPage - The page to start importing from.
pageCount - The number of pages to import.
options - A MergeOptions object specifying the merge options.
See Also:
MergeOptions

MergeDocument

public MergeDocument(PdfDocument pdfDocument,
                     int startPage,
                     int pageCount,
                     MergeOptions options)
Initializes a new instance of the MergeDocument class.

Parameters:
pdfDocument - The PdfDocument to import.
startPage - The page to start importing from.
pageCount - The number of pages to import.
options - A MergeOptions object specifying the merge options.
See Also:
PdfDocument, MergeOptions
Method Detail

append

public AppendedPage[] append(java.lang.String filePath)
Appends a PDF document to the current document.

Parameters:
filePath - The physical file path of the PDF to import.
Returns:
An array of com.cete.dynamicpdf.Pages that were appended to the document.
See Also:
ImportedPage

append

public AppendedPage[] append(PdfDocument pdfDocument)
Appends a PDF document to the current document.

Parameters:
pdfDocument - The PdfDocument to import.
Returns:
An array of com.cete.dynamicpdf.Pages that were appended to the document.
See Also:
PdfDocument, ImportedPage

append

public AppendedPage[] append(java.lang.String filePath,
                             MergeOptions options)
Appends a PDF document to the current document.

Parameters:
filePath - The physical file path of the PDF to import.
options - A MergeOptions object specifying the merge options.
Returns:
An array of com.cete.dynamicpdf.Pages that were appended to the document.
See Also:
MergeOptions, ImportedPage

append

public AppendedPage[] append(PdfDocument pdfDocument,
                             MergeOptions options)
Appends a PDF document to the current document.

Parameters:
pdfDocument - The PdfDocument to import.
options - A MergeOptions object specifying the merge options.
Returns:
An array of com.cete.dynamicpdf.Pages that were appended to the document.
See Also:
PdfDocument, MergeOptions, ImportedPage

append

public AppendedPage[] append(java.lang.String filePath,
                             int startPage,
                             int pageCount)
Appends a PDF document to the current document.

Parameters:
filePath - The physical file path of the PDF to import.
startPage - The page to start importing from.
pageCount - The number of pages to import.
Returns:
An array of com.cete.dynamicpdf.Pages that were appended to the document.
See Also:
ImportedPage

append

public AppendedPage[] append(PdfDocument pdfDocument,
                             int startPage,
                             int pageCount)
Appends a PDF document to the current document.

Parameters:
pdfDocument - The PdfDocument to import.
startPage - The page to start appending from.
pageCount - The number of pages to append.
Returns:
An array of com.cete.dynamicpdf.Pages that were appended to the document.
See Also:
PdfDocument, ImportedPage

append

public AppendedPage[] append(java.lang.String filePath,
                             int startPage,
                             int pageCount,
                             MergeOptions options)
Appends a PDF document to the current document.

Parameters:
filePath - The physical file path of the PDF to import.
startPage - The page to start importing from.
pageCount - The number of pages to import.
options - A MergeOptions object specifying the merge options.
Returns:
An array of com.cete.dynamicpdf.Pages that were appended to the document.
See Also:
MergeOptions, ImportedPage

append

public AppendedPage[] append(PdfDocument pdfDocument,
                             int startPage,
                             int pageCount,
                             MergeOptions options)
Appends a PDF document to the current document.

Parameters:
pdfDocument - The PdfDocument to import.
startPage - The page to start appending from.
pageCount - The number of pages to append.
options - Specifies the merge options.
Returns:
An array of com.cete.dynamicpdf.merger.ImportedPages that were appended to the document.
See Also:
PdfDocument, MergeOptions, ImportedPage

merge

public static MergeDocument merge(java.lang.String firstDocumentFilePath,
                                  java.lang.String secondDocumentFilePath)
Merges two PDF documents together.

Parameters:
firstDocumentFilePath - The physical file path to the first PDF document.
secondDocumentFilePath - The physical file path to the second PDF document.
Returns:
A MergeDocument containing the pages from both PDF documents.

merge

public static MergeDocument merge(PdfDocument firstDocument,
                                  PdfDocument secondDocument)
Merges two PDF documents together.

Parameters:
firstDocument - A PdfDocument class representing the first PDF document.
secondDocument - A PdfDocument class representing the second PDF document.
Returns:
A MergeDocument containing the pages from both PDF documents.
See Also:
PdfDocument

merge

public static MergeDocument merge(java.lang.String firstDocumentFilePath,
                                  MergeOptions firstDocumentOptions,
                                  java.lang.String secondDocumentFilePath,
                                  MergeOptions secondDocumentOptions)
Merges two PDF documents together.

Parameters:
firstDocumentFilePath - The physical file path to the first PDF document.
firstDocumentOptions - A MergeOptions object specifying the merge options for the first PDF document.
secondDocumentFilePath - The physical file path to the second PDF document.
secondDocumentOptions - A MergeOptions object specifying the merge options for the second PDF document.
Returns:
A MergeDocument containing the pages from both PDF documents.
See Also:
MergeOptions

merge

public static MergeDocument merge(PdfDocument firstDocument,
                                  MergeOptions firstDocumentOptions,
                                  PdfDocument secondDocument,
                                  MergeOptions secondDocumentOptions)
Merges two PDF documents together.

Parameters:
firstDocument - A PdfDocument class representing the first PDF document.
firstDocumentOptions - A MergeOptions object specifying the merge options for the first PDF document.
secondDocument - A PdfDocument class representing the second PDF document.
secondDocumentOptions - A MergeOptions object specifying the merge options for the second PDF document.
Returns:
A MergeDocument containing the pages from both PDF documents.
See Also:
PdfDocument, MergeOptions

getInitialPage

public int getInitialPage()
Gets a value indicating the initial page of the Document.

Overrides:
getInitialPage in class Document
Returns:
the integer value indicating the documents initial page.

setInitialPage

public void setInitialPage(int value)
Sets a value indicating the initial page of the Document.

Overrides:
setInitialPage in class Document
Parameters:
value - the initial page of the Document.

getInitialPageZoom

public PageZoom getInitialPageZoom()
Gets or sets a value indicating the initial zoom of the Document.

Overrides:
getInitialPageZoom in class Document
Returns:
the PageZoom of the document
See Also:
PageZoom

setInitialPageZoom

public void setInitialPageZoom(PageZoom value)
Sets a value indicating the initial zoom of the Document.

Overrides:
setInitialPageZoom in class Document
Parameters:
value - the initial zoom of the Document.
See Also:
PageZoom

getXmpMetadata

public XmpMetadata getXmpMetadata()
Gets the Xmp metadata for the PDF document.

Licensing:
This class is a DynamicPDF Merger Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:

Overrides:
getXmpMetadata in class Document
Returns:
the Xmp metadata for the PDF document.

setXmpMetadata

public void setXmpMetadata(XmpMetadata value)
Sets the Xmp metadata for the PDF document.

Licensing:
This class is a DynamicPDF Merger Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:

Overrides:
setXmpMetadata in class Document
Parameters:
value -

drawRootEntries

protected void drawRootEntries(DocumentWriter writer)
Outputs the catalog entries to the .

Overrides:
drawRootEntries in class Document
Parameters:
writer - DocumentWriter object to write the catalog entries.
See Also:
DocumentWriter

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.07 for Java generated on Aug 12, 2020
© Copyright 2020, ceTe Software