java.lang.Object
org.sejda.sambox.pdmodel.PDDocumentCatalog
- All Implemented Interfaces:
COSObjectable
The Document Catalog of a PDF.
- Author:
- Ben Litchfield
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.PDDocumentCatalog(PDDocument doc, COSDictionary rootDictionary) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOutputIntent(PDOutputIntent outputIntent) Add an OutputIntent to the list.findNamedDestinationPage(PDNamedDestination namedDest) Looks up for thePDPageDestinationreferenced by the givenPDNamedDestinationGet the documents AcroForm.getAcroForm(PDDocumentFixup acroFormFixup) Get the documents AcroForm.Convert this standard java object to a COS object.getDests()Get the outline associated with this document or null if it does not exist.Returns the language for the document, or null.Get info about doc's usage of tagged features.Get the metadata that is part of the document catalog.getNames()Get the optional content properties dictionary associated with this document.Get the Document Open Action for this object.Get the list of OutputIntents defined in the document.Returns the page labels descriptor of the document.Returns the page layout.Returns the page display mode.getPages()Returns all pages in the document, as a page tree.Get the document's structure tree root, or null if none exists.Returns the document's article threads.getURI()Returns the document-level URI.Returns the PDF specification version this document conforms to.Get the viewer preferences associated with this document or null if they do not exist.voidsetAcroForm(PDAcroForm acroForm) sets the acroform for this catalog.voidSets the additional actions for the document.voidsetDocumentOutline(PDDocumentOutline outlines) Sets the document outlines.voidsetLanguage(String language) Sets the Language for the document.voidsetMarkInfo(PDMarkInfo markInfo) Set information about the doc's usage of tagged features.voidsetMetadata(PDMetadata meta) Sets the metadata for this object.voidsetNames(PDDocumentNameDictionary names) Sets the names dictionary for the document.voidsetOCProperties(PDOptionalContentProperties ocProperties) Sets the optional content properties dictionary.voidsetOpenAction(PDDestinationOrAction action) Sets the Document Open Action for this object.voidsetOutputIntents(List<PDOutputIntent> outputIntents) Replace the list of OutputIntents of the document.voidsetPageLabels(PDPageLabels labels) Sets the page label descriptor for the document.voidsetPageLayout(PageLayout layout) Sets the page layout.voidsetPageMode(PageMode mode) Sets the page mode.voidsetStructureTreeRoot(PDStructureTreeRoot treeRoot) Sets the document's structure tree root.voidsetThreads(List<PDThread> threads) Sets the list of threads for this pdf document.voidsetURI(PDURIDictionary uri) Sets the document level URI.voidsetVersion(String version) Sets the PDF specification version this document conforms to.voidSets the viewer preferences.
-
Constructor Details
-
PDDocumentCatalog
Constructor. AcroForm.- Parameters:
doc- The document that this catalog is part of.
-
PDDocumentCatalog
Constructor.- Parameters:
doc- The document that this catalog is part of.rootDictionary- The root dictionary that this object wraps.
-
-
Method Details
-
getCOSObject
Convert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The cos object that matches this Java object.
-
getAcroForm
Get the documents AcroForm. This will return null if no AcroForm is part of the document.- Returns:
- The document's AcroForm.
-
getAcroFromWithFixups
-
getAcroForm
Get the documents AcroForm. This will return null if no AcroForm is part of the document. Dependent on settingacroFormFixupsome fixing/changes will be done to the AcroForm. If you need to ensure that there are no fixes applied callgetAcroFormwithnull. UsinggetAcroForm(PDDocumentFixup acroFormFixup)might change the original content and subsequent calls withgetAcroForm(null)will return the changed content.- Parameters:
acroFormFixup- the fix up action or null- Returns:
- The document's AcroForm.
-
setAcroForm
sets the acroform for this catalog.- Parameters:
acroForm- the new acroform.
-
getPages
Returns all pages in the document, as a page tree. -
getViewerPreferences
Get the viewer preferences associated with this document or null if they do not exist.- Returns:
- The document's viewer preferences.
-
setViewerPreferences
Sets the viewer preferences.- Parameters:
prefs- The new viewer preferences.
-
getDocumentOutline
Get the outline associated with this document or null if it does not exist.- Returns:
- The document's outline.
-
getThreads
Returns the document's article threads. -
setThreads
Sets the list of threads for this pdf document.- Parameters:
threads- The list of threads, or null to clear it.
-
getMetadata
Get the metadata that is part of the document catalog. This will return null if there is no meta data for this object.- Returns:
- The metadata for this object.
-
setMetadata
Sets the metadata for this object. This can be null.- Parameters:
meta- The meta data for this object.
-
setOpenAction
Sets the Document Open Action for this object.- Parameters:
action- The action you want to perform.
-
getOpenAction
Get the Document Open Action for this object.- Returns:
- The action to perform when the document is opened.
- Throws:
IOException
-
getActions
- Returns:
- The Additional Actions for this Document
-
setActions
Sets the additional actions for the document.- Parameters:
actions- The actions that are associated with this document.
-
getNames
- Returns:
- The names dictionary for this document or null if none exist.
-
getDests
- Returns:
- The named destinations dictionary for this document or null if none exists.
-
setNames
Sets the names dictionary for the document.- Parameters:
names- The names dictionary that is associated with this document.
-
getMarkInfo
Get info about doc's usage of tagged features. This will return null if there is no information.- Returns:
- The new mark info.
-
setMarkInfo
Set information about the doc's usage of tagged features.- Parameters:
markInfo- The new MarkInfo data.
-
getOutputIntents
Get the list of OutputIntents defined in the document.- Returns:
- The list of PDOutputIntent
-
addOutputIntent
Add an OutputIntent to the list. If there is not OutputIntent, the list is created and the first element added.- Parameters:
outputIntent- the OutputIntent to add.
-
setOutputIntents
Replace the list of OutputIntents of the document.- Parameters:
outputIntents- the list of OutputIntents, if the list is empty all OutputIntents are removed.
-
getPageMode
Returns the page display mode. -
setPageMode
Sets the page mode.- Parameters:
mode- The new page mode.
-
getPageLayout
Returns the page layout. -
setPageLayout
Sets the page layout.- Parameters:
layout- The new page layout.
-
getURI
Returns the document-level URI. -
setURI
Sets the document level URI.- Parameters:
uri- The new document level URI.
-
getStructureTreeRoot
Get the document's structure tree root, or null if none exists. -
setStructureTreeRoot
Sets the document's structure tree root.- Parameters:
treeRoot- The new structure tree.
-
getLanguage
Returns the language for the document, or null. -
setLanguage
Sets the Language for the document.- Parameters:
language- The new document language.
-
getVersion
Returns the PDF specification version this document conforms to.- Returns:
- the PDF version (e.g. "1.4")
-
setVersion
Sets the PDF specification version this document conforms to.- Parameters:
version- the PDF version
-
getPageLabels
Returns the page labels descriptor of the document.- Returns:
- the page labels descriptor of the document.
- Throws:
IOException- If there is a problem retrieving the page labels.
-
setPageLabels
Sets the page label descriptor for the document.- Parameters:
labels- the new page label descriptor to set.
-
getOCProperties
Get the optional content properties dictionary associated with this document.- Returns:
- the optional properties dictionary or null if it is not present
-
setOCProperties
Sets the optional content properties dictionary.- Parameters:
ocProperties- the optional properties dictionary
-