com.spire.pdf
Class PdfDocumentBase

java.lang.Object
  extended by com.spire.pdf.PdfDocumentBase
Direct Known Subclasses:
PdfNewDocument

public abstract class PdfDocumentBase
extends java.lang.Object

Represent common PdfDocumentBase classes.


Constructor Summary
PdfDocumentBase()
           
 
Method Summary
abstract  PdfForm _getForm()
          Gets the proper PdfForm instance.
 void close()
          Closes the document.
 void dispose()
          Dispose all pending objects.
abstract  PdfAttachmentCollection getAttachments()
          Get the attachments
abstract  PdfBookmarkCollection getBookmarks()
          Gets the bookmarks.
 PdfColorSpace getColorSpace()
          Gets the color space.
 PdfCompressionLevel getCompressionLevel()
          Gets the desired level of stream compression.
abstract  PdfConformanceLevel getConformance()
          Gets the Pdf document's Conformance-level
 PdfDocumentInformation getDocumentInformation()
          Gets document's information and properties.
 PdfFileInfo getFileStructure()
          Gets the internal structure of the PDF file.
 PdfDocumentActions getJavaScripts()
          Gets the additional document's actions.
 PdfPageLabels getPageLabels()
          Get page labels.
 PdfPageCollection getPages()
          Gets the pages.
 PdfPageSettings getPageSettings()
          Gets the setting of page.
 PdfSecurity getSecurity()
          Deprecated. 
 PdfDocumentTemplate getTemplate()
          Gets a template that is applied to all pages in the document.
 PdfUsedFont[] getUsedFonts()
          Gets the m_fonts which are available in the PDF document.
 PdfViewerPreferences getViewerPreferences()
          Gets a viewer preferences object controlling the way the document is to be presented on the screen or in print.
 PdfPageBase importPage(PdfDocumentBase ldDoc, int pageIndex)
          Imports a page.
 PdfPageBase importPage(PdfDocumentBase ldDoc, int pageIndex, int resultPageIndex)
          Imports a page.
 PdfPageBase importPage(PdfDocumentBase ldDoc, PdfPageBase page)
          Imports a page.
 PdfPageBase importPageRange(PdfDocumentBase ldDoc, int startIndex, int endIndex)
          Imports a page range from a loaded document.
 PdfPageBase importPageRange(PdfDocumentBase ldDoc, int startIndex, int endIndex, int resultPageIndex)
          Imports a page range from a loaded document.
static PdfDocumentBase merge(PdfDocumentBase dest, java.lang.Object... sourceDocuments)
          Merges the specified source documents and return destination document.
 void save(java.io.OutputStream stream)
          Saves the document to the specified stream.
 void save(java.lang.String filename)
          Saves the document to the specified filename.
 void save(java.lang.String fileName, FileFormat fileformat)
           
 void saveToXPS(java.lang.String filename)
          Save the document to xps.
 void setColorSpace(PdfColorSpace value)
          Sets the color space for page that will be created.
 void setCompressionLevel(PdfCompressionLevel value)
          Desired level of the new stream compression
abstract  void setConformance(PdfConformanceLevel value)
          Deprecated. 
 void setFileStructure(PdfFileInfo value)
          Sets the internal structure of the PDF file.
 void setPageLabels(PdfPageLabels value)
          Set page labels.
 void setPageSettings(PdfPageSettings value)
          Sets the setting of page.
 void setTemplate(PdfDocumentTemplate value)
          Sets a template that is applied to all pages in the document.
 void setViewerPreferences(PdfViewerPreferences value)
          Sets a viewer preferences object controlling the way the document is to be presented on the screen or in print.
 void split(java.lang.String destFilePattern)
          Splits a PDF file to many PDF files, each of them consists of one page from the source file.
 void split(java.lang.String destFilePattern, int startNumber)
          Splits a PDF file to many PDF files, each of them consists of one page from the source file.
 

Constructor Detail

PdfDocumentBase

public PdfDocumentBase()
Method Detail

getConformance

public abstract PdfConformanceLevel getConformance()
Gets the Pdf document's Conformance-level


setConformance

@Deprecated
public abstract void setConformance(PdfConformanceLevel value)
Deprecated. 

Set the Pdf document's Conformance-level


getAttachments

public abstract PdfAttachmentCollection getAttachments()
Get the attachments


getColorSpace

public PdfColorSpace getColorSpace()
Gets the color space.

Returns:
The color space.

setColorSpace

public void setColorSpace(PdfColorSpace value)
Sets the color space for page that will be created. This property has impact on the new created pages only. If a page was created it remains its colour space obliviously

Parameters:
value - The color space.

_getForm

public abstract PdfForm _getForm()
Gets the proper PdfForm instance.


getPageLabels

public PdfPageLabels getPageLabels()
Get page labels.


setPageLabels

public void setPageLabels(PdfPageLabels value)
Set page labels.


getUsedFonts

public PdfUsedFont[] getUsedFonts()
Gets the m_fonts which are available in the PDF document.


getPageSettings

public PdfPageSettings getPageSettings()
Gets the setting of page.


setPageSettings

public void setPageSettings(PdfPageSettings value)
Sets the setting of page.


getTemplate

public PdfDocumentTemplate getTemplate()
Gets a template that is applied to all pages in the document.


setTemplate

public void setTemplate(PdfDocumentTemplate value)
Sets a template that is applied to all pages in the document.


getPages

public PdfPageCollection getPages()
Gets the pages.


getSecurity

@Deprecated
public PdfSecurity getSecurity()
Deprecated. 

Gets the security parameters of the document.


getDocumentInformation

public PdfDocumentInformation getDocumentInformation()
Gets document's information and properties.

/*virtual


getViewerPreferences

public PdfViewerPreferences getViewerPreferences()
Gets a viewer preferences object controlling the way the document is to be presented on the screen or in print.


setViewerPreferences

public void setViewerPreferences(PdfViewerPreferences value)
Sets a viewer preferences object controlling the way the document is to be presented on the screen or in print.


getCompressionLevel

public PdfCompressionLevel getCompressionLevel()
Gets the desired level of stream compression.

See Also:
All new objects should be compressed with this level of the compression.

setCompressionLevel

public void setCompressionLevel(PdfCompressionLevel value)
Desired level of the new stream compression

Parameters:
value -

getFileStructure

public PdfFileInfo getFileStructure()
Gets the internal structure of the PDF file.


setFileStructure

public void setFileStructure(PdfFileInfo value)
Sets the internal structure of the PDF file.


getJavaScripts

public PdfDocumentActions getJavaScripts()
Gets the additional document's actions.


getBookmarks

public abstract PdfBookmarkCollection getBookmarks()
Gets the bookmarks.


split

public void split(java.lang.String destFilePattern)
Splits a PDF file to many PDF files, each of them consists of one page from the source file.

Parameters:
destFilePattern - Template for destination file names. Each destination file will have 'destFileName{0***}' name, where *** is an optional format string for the number of the page inside of the source document.

split

public void split(java.lang.String destFilePattern,
                  int startNumber)
Splits a PDF file to many PDF files, each of them consists of one page from the source file. Template for destination file names. The number that is use as a start point for the page numbering. Each destination file will have 'destFileName{0***}' name, where *** is an optional format string for the number of the page inside of the source document.


merge

public static PdfDocumentBase merge(PdfDocumentBase dest,
                                    java.lang.Object... sourceDocuments)
Merges the specified source documents and return destination document. The destination document, where the other documents are merged into. If it's null a new document object will be created.

Parameters:
sourceDocuments - The source documents.
Returns:
The document containing merged documents.

save

public void save(java.lang.String fileName,
                 FileFormat fileformat)

save

public void save(java.lang.String filename)
Saves the document to the specified filename.

Parameters:
filename - The filename.

save

public void save(java.io.OutputStream stream)
Saves the document to the specified stream.

Parameters:
stream - The stream object where PDF document will be saved.

saveToXPS

public void saveToXPS(java.lang.String filename)
Save the document to xps.

Parameters:
filename - A relative or absolute path for the xps file.

close

public void close()
Closes the document. Releases all common resources.


importPage

public PdfPageBase importPage(PdfDocumentBase ldDoc,
                              PdfPageBase page)
Imports a page.

Parameters:
ldDoc - The loaded document.
page - The page.
Returns:
The page in the result document.

importPage

public PdfPageBase importPage(PdfDocumentBase ldDoc,
                              int pageIndex)
Imports a page.

Parameters:
ldDoc - The loaded document.
pageIndex - Index of the page.
Returns:
The page in the result document.

importPage

public PdfPageBase importPage(PdfDocumentBase ldDoc,
                              int pageIndex,
                              int resultPageIndex)
Imports a page.

Parameters:
ldDoc - The loaded document.
pageIndex - Index of the page.
resultPageIndex - The page index in the result document.
Returns:
The page in the result document.

importPageRange

public PdfPageBase importPageRange(PdfDocumentBase ldDoc,
                                   int startIndex,
                                   int endIndex)
Imports a page range from a loaded document.

Parameters:
ldDoc - The loaded document.
startIndex - The start page index.
endIndex - The end page index.
Returns:
The last created page in the target document.

importPageRange

public PdfPageBase importPageRange(PdfDocumentBase ldDoc,
                                   int startIndex,
                                   int endIndex,
                                   int resultPageIndex)
Imports a page range from a loaded document.

Parameters:
ldDoc - The loaded document.
startIndex - The start page index.
endIndex - The end page index.
resultPageIndex - The page index in the result document when startIndex == endIndex.
Returns:
The last created page in the target document.

dispose

public void dispose()
Dispose all pending objects.