public class PdfCatalog extends PdfObjectWrapper<PdfDictionary>
Modifier and Type | Field and Description |
---|---|
protected Map<PdfName,PdfNameTree> |
nameTrees |
protected PdfOCProperties |
ocProperties |
protected PdfNumTree |
pageLabels |
Modifier | Constructor and Description |
---|---|
protected |
PdfCatalog(PdfDictionary pdfObject) |
protected |
PdfCatalog(PdfDocument pdfDocument) |
Modifier and Type | Method and Description |
---|---|
void |
addDeveloperExtension(PdfDeveloperExtension extension) |
void |
flush()
PdfCatalog will be flushed in PdfDocument.close().
|
PdfDocument |
getDocument() |
PdfString |
getLang() |
PdfString |
getLang(PdfName lang)
Deprecated.
|
PdfNameTree |
getNameTree(PdfName treeType)
This method gets Names tree from the catalog.
|
PdfOCProperties |
getOCProperties(boolean createIfNotExists)
Use this method to get the Optional Content Properties Dictionary.
|
PdfNumTree |
getPageLabelsTree(boolean createIfNotExists)
This method returns the NumberTree of Page Labels
|
PdfName |
getPageLayout() |
PdfName |
getPageMode() |
PdfViewerPreferences |
getViewerPreferences() |
protected boolean |
isOCPropertiesMayHaveChanged()
True indicates that getOCProperties() was called, may have been modified, and thus its dictionary needs to be reconstructed.
|
protected boolean |
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.
|
PdfCatalog |
put(PdfName key, PdfObject value) |
PdfCatalog |
remove(PdfName key) |
PdfCatalog |
setAdditionalAction(PdfName key, PdfAction action) |
PdfCatalog |
setCollection(PdfCollection collection)
Sets collection dictionary that a conforming reader shall use to enhance the presentation of file attachments stored in the PDF document.
|
void |
setLang(PdfString lang)
An entry specifying the natural language, and optionally locale.
|
PdfCatalog |
setOpenAction(PdfAction action) |
PdfCatalog |
setOpenAction(PdfDestination destination) |
PdfCatalog |
setPageLayout(PdfName pageLayout)
This method sets a page layout of the document
|
PdfCatalog |
setPageMode(PdfName pageMode)
This method sets a page mode of the document.
|
PdfCatalog |
setViewerPreferences(PdfViewerPreferences preferences)
This method sets the document viewer preferences, specifying the way the document shall be displayed on the screen
|
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
protected Map<PdfName,PdfNameTree> nameTrees
protected PdfNumTree pageLabels
protected PdfOCProperties ocProperties
protected PdfCatalog(PdfDictionary pdfObject)
protected PdfCatalog(PdfDocument pdfDocument)
public PdfOCProperties getOCProperties(boolean createIfNotExists)
PdfCatalog pdfCatalog = pdfDoc.getCatalog(); PdfDictionary ocProps = pdfCatalog.getAsDictionary(PdfName.OCProperties); // manipulate with ocProps.
Also note that this method is implicitly called when creating a new PdfLayer instance, so you should either use hi-level logic of operating with layers, or manipulate low-level Pdf objects by yourself.
createIfNotExists
- true to create new /OCProperties entry in catalog if not exists, false to return null if /OCProperties entry in catalog is not present.
public PdfDocument getDocument()
public void flush()
flush
in class PdfObjectWrapper<PdfDictionary>
public PdfCatalog setOpenAction(PdfDestination destination)
public PdfCatalog setOpenAction(PdfAction action)
public PdfCatalog setAdditionalAction(PdfName key, PdfAction action)
public PdfCatalog setPageMode(PdfName pageMode)
PdfName.UseNone
, PdfName.UseOutlines
, PdfName.UseThumbs
, PdfName.FullScreen
, PdfName.UseOC
, PdfName.UseAttachments
.
pageMode
- page mode.
public PdfName getPageMode()
public PdfCatalog setPageLayout(PdfName pageLayout)
pageLayout
-
public PdfName getPageLayout()
public PdfCatalog setViewerPreferences(PdfViewerPreferences preferences)
preferences
-
public PdfViewerPreferences getViewerPreferences()
public PdfNameTree getNameTree(PdfName treeType)
treeType
- type of the tree (Dests, AP, EmbeddedFiles etc).
PdfNameTree
public PdfNumTree getPageLabelsTree(boolean createIfNotExists)
PdfNumTree
public void setLang(PdfString lang)
public PdfString getLang()
@Deprecated public PdfString getLang(PdfName lang)
public void addDeveloperExtension(PdfDeveloperExtension extension)
public PdfCatalog setCollection(PdfCollection collection)
collection
-
public PdfCatalog put(PdfName key, PdfObject value)
public PdfCatalog remove(PdfName key)
protected boolean isWrappedObjectMustBeIndirect()
PdfObjectWrapper
isWrappedObjectMustBeIndirect
in class PdfObjectWrapper<PdfDictionary>
protected boolean isOCPropertiesMayHaveChanged()
Copyright © 1998–2017 iText Group NV. All rights reserved.