@@ -52,16 +52,30 @@ source product.
5252using iText . Kernel . Pdf . Navigation ;
5353
5454namespace iText . Kernel . Pdf {
55+ /// <summary>The root of a document’s object hierarchy.</summary>
5556 public class PdfCatalog : PdfObjectWrapper < PdfDictionary > {
5657 private static readonly ILog LOGGER = LogManager . GetLogger ( typeof ( iText . Kernel . Pdf . PdfCatalog ) ) ;
5758
5859 private readonly PdfPagesTree pageTree ;
5960
61+ /// <summary>
62+ /// Map of the
63+ /// <see cref="PdfNameTree"/>.
64+ /// </summary>
65+ /// <remarks>
66+ /// Map of the
67+ /// <see cref="PdfNameTree"/>
68+ /// . Used for creation
69+ /// <c>name tree</c>
70+ /// dictionary.
71+ /// </remarks>
6072 protected internal IDictionary < PdfName , PdfNameTree > nameTrees = new LinkedDictionary < PdfName , PdfNameTree
6173 > ( ) ;
6274
75+ /// <summary>Defining the page labelling for the document.</summary>
6376 protected internal PdfNumTree pageLabels ;
6477
78+ /// <summary>The document’s optional content properties dictionary.</summary>
6579 protected internal PdfOCProperties ocProperties ;
6680
6781 private const String OutlineRoot = "Outlines" ;
@@ -83,6 +97,12 @@ public class PdfCatalog : PdfObjectWrapper<PdfDictionary> {
8397 < PdfName > ( JavaUtil . ArraysAsList ( PdfName . SinglePage , PdfName . OneColumn , PdfName . TwoColumnLeft , PdfName .
8498 TwoColumnRight , PdfName . TwoPageLeft , PdfName . TwoPageRight ) ) ) ;
8599
100+ /// <summary>
101+ /// Create
102+ /// <see cref="PdfCatalog"/>
103+ /// dictionary.
104+ /// </summary>
105+ /// <param name="pdfObject">the dictionary to be wrapped</param>
86106 protected internal PdfCatalog ( PdfDictionary pdfObject )
87107 : base ( pdfObject ) {
88108 if ( pdfObject == null ) {
@@ -94,16 +114,38 @@ protected internal PdfCatalog(PdfDictionary pdfObject)
94114 pageTree = new PdfPagesTree ( this ) ;
95115 }
96116
117+ /// <summary>
118+ /// Create
119+ /// <see cref="PdfCatalog"/>
120+ /// to
121+ /// <see cref="PdfDocument"/>.
122+ /// </summary>
123+ /// <param name="pdfDocument">
124+ /// A
125+ /// <see cref="PdfDocument"/>
126+ /// object representing the document
127+ /// to which redaction applies
128+ /// </param>
97129 protected internal PdfCatalog ( PdfDocument pdfDocument )
98130 : this ( ( PdfDictionary ) new PdfDictionary ( ) . MakeIndirect ( pdfDocument ) ) {
99131 }
100132
101133 /// <summary>Use this method to get the <b>Optional Content Properties Dictionary</b>.</summary>
102134 /// <remarks>
103135 /// Use this method to get the <b>Optional Content Properties Dictionary</b>.
104- /// Note that if you call this method, then the PdfDictionary with OCProperties will be
105- /// generated from PdfOCProperties object right before closing the PdfDocument,
106- /// so if you want to make low-level changes in Pdf structures themselves (PdfArray, PdfDictionary, etc),
136+ /// Note that if you call this method, then the
137+ /// <see cref="PdfDictionary"/>
138+ /// with OCProperties will be
139+ /// generated from
140+ /// <see cref="iText.Kernel.Pdf.Layer.PdfOCProperties"/>
141+ /// object right before closing the
142+ /// <see cref="PdfDocument"/>
143+ /// ,
144+ /// so if you want to make low-level changes in Pdf structures themselves (
145+ /// <see cref="PdfArray"/>
146+ /// ,
147+ /// <see cref="PdfDictionary"/>
148+ /// , etc),
107149 /// then you should address directly those objects, e.g.:
108150 /// <c>
109151 /// PdfCatalog pdfCatalog = pdfDoc.getCatalog();
@@ -140,6 +182,12 @@ public virtual PdfOCProperties GetOCProperties(bool createIfNotExists) {
140182 return ocProperties ;
141183 }
142184
185+ /// <summary>
186+ /// Get
187+ /// <see cref="PdfDocument"/>
188+ /// with indirect reference associated with the object.
189+ /// </summary>
190+ /// <returns>the resultant dictionary</returns>
143191 public virtual PdfDocument GetDocument ( ) {
144192 return GetPdfObject ( ) . GetIndirectReference ( ) . GetDocument ( ) ;
145193 }
@@ -151,14 +199,46 @@ public override void Flush() {
151199 logger . Warn ( "PdfCatalog cannot be flushed manually" ) ;
152200 }
153201
202+ /// <summary>A value specifying a destination that shall be displayed when the document is opened.</summary>
203+ /// <remarks>
204+ /// A value specifying a destination that shall be displayed when the document is opened.
205+ /// See ISO 32000-1, Table 28 – Entries in the catalog dictionary.
206+ /// </remarks>
207+ /// <param name="destination">
208+ /// instance of
209+ /// <see cref="iText.Kernel.Pdf.Navigation.PdfDestination"/>.
210+ /// </param>
211+ /// <returns>destination</returns>
154212 public virtual iText . Kernel . Pdf . PdfCatalog SetOpenAction ( PdfDestination destination ) {
155213 return Put ( PdfName . OpenAction , destination . GetPdfObject ( ) ) ;
156214 }
157215
216+ /// <summary>A value specifying an action that shall be performed when the document is opened.</summary>
217+ /// <remarks>
218+ /// A value specifying an action that shall be performed when the document is opened.
219+ /// See ISO 32000-1, Table 28 – Entries in the catalog dictionary.
220+ /// </remarks>
221+ /// <param name="action">
222+ /// instance of
223+ /// <see cref="iText.Kernel.Pdf.Action.PdfAction"/>.
224+ /// </param>
225+ /// <returns>action</returns>
158226 public virtual iText . Kernel . Pdf . PdfCatalog SetOpenAction ( PdfAction action ) {
159227 return Put ( PdfName . OpenAction , action . GetPdfObject ( ) ) ;
160228 }
161229
230+ /// <summary>The actions that shall be taken in response to various trigger events affecting the document as a whole.
231+ /// </summary>
232+ /// <remarks>
233+ /// The actions that shall be taken in response to various trigger events affecting the document as a whole.
234+ /// See ISO 32000-1, Table 28 – Entries in the catalog dictionary.
235+ /// </remarks>
236+ /// <param name="key">the key of which the associated value needs to be returned</param>
237+ /// <param name="action">
238+ /// instance of
239+ /// <see cref="iText.Kernel.Pdf.Action.PdfAction"/>.
240+ /// </param>
241+ /// <returns>additional action</returns>
162242 public virtual iText . Kernel . Pdf . PdfCatalog SetAdditionalAction ( PdfName key , PdfAction action ) {
163243 PdfAction . SetAdditionalAction ( this , key , action ) ;
164244 return this ;
@@ -190,6 +270,11 @@ public virtual iText.Kernel.Pdf.PdfCatalog SetPageMode(PdfName pageMode) {
190270 return this ;
191271 }
192272
273+ /// <summary>Get page mode of the document.</summary>
274+ /// <returns>
275+ /// current instance of
276+ /// <see cref="PdfCatalog"/>
277+ /// </returns>
193278 public virtual PdfName GetPageMode ( ) {
194279 return GetPdfObject ( ) . GetAsName ( PdfName . PageMode ) ;
195280 }
@@ -208,6 +293,8 @@ public virtual iText.Kernel.Pdf.PdfCatalog SetPageLayout(PdfName pageLayout) {
208293 return this ;
209294 }
210295
296+ /// <summary>Get page layout of the document.</summary>
297+ /// <returns>name object of page layout that shall be used when document is opened</returns>
211298 public virtual PdfName GetPageLayout ( ) {
212299 return GetPdfObject ( ) . GetAsName ( PdfName . PageLayout ) ;
213300 }
@@ -229,6 +316,8 @@ public virtual iText.Kernel.Pdf.PdfCatalog SetViewerPreferences(PdfViewerPrefere
229316 return Put ( PdfName . ViewerPreferences , preferences . GetPdfObject ( ) ) ;
230317 }
231318
319+ /// <summary>Get viewer preferences of the document.</summary>
320+ /// <returns>dictionary of viewer preferences</returns>
232321 public virtual PdfViewerPreferences GetViewerPreferences ( ) {
233322 PdfDictionary viewerPreferences = GetPdfObject ( ) . GetAsDictionary ( PdfName . ViewerPreferences ) ;
234323 if ( viewerPreferences != null ) {
@@ -285,10 +374,25 @@ public virtual void SetLang(PdfString lang) {
285374 Put ( PdfName . Lang , lang ) ;
286375 }
287376
377+ /// <summary>Get natural language.</summary>
378+ /// <returns>natural language</returns>
288379 public virtual PdfString GetLang ( ) {
289380 return GetPdfObject ( ) . GetAsString ( PdfName . Lang ) ;
290381 }
291382
383+ /// <summary>
384+ /// Add an extensions dictionary containing developer prefix identification and version
385+ /// numbers for developer extensions that occur in this document.
386+ /// </summary>
387+ /// <remarks>
388+ /// Add an extensions dictionary containing developer prefix identification and version
389+ /// numbers for developer extensions that occur in this document.
390+ /// See ISO 32000-1, Table 28 – Entries in the catalog dictionary.
391+ /// </remarks>
392+ /// <param name="extension">
393+ /// enables developers to identify their own extension
394+ /// relative to a base version of PDF
395+ /// </param>
292396 public virtual void AddDeveloperExtension ( PdfDeveloperExtension extension ) {
293397 PdfDictionary extensions = GetPdfObject ( ) . GetAsDictionary ( PdfName . Extensions ) ;
294398 if ( extensions == null ) {
@@ -347,12 +451,23 @@ public virtual iText.Kernel.Pdf.PdfCatalog SetCollection(PdfCollection collectio
347451 return this ;
348452 }
349453
454+ /// <summary>
455+ /// Add key and value to
456+ /// <see cref="PdfCatalog"/>
457+ /// dictionary.
458+ /// </summary>
459+ /// <param name="key">the dictionary key corresponding with the PDF object</param>
460+ /// <param name="value">the value of key</param>
461+ /// <returns>the key and value</returns>
350462 public virtual iText . Kernel . Pdf . PdfCatalog Put ( PdfName key , PdfObject value ) {
351463 GetPdfObject ( ) . Put ( key , value ) ;
352464 SetModified ( ) ;
353465 return this ;
354466 }
355467
468+ /// <summary>Remove key from catalog dictionary.</summary>
469+ /// <param name="key">the dictionary key corresponding with the PDF object</param>
470+ /// <returns>the key</returns>
356471 public virtual iText . Kernel . Pdf . PdfCatalog Remove ( PdfName key ) {
357472 GetPdfObject ( ) . Remove ( key ) ;
358473 SetModified ( ) ;
@@ -459,7 +574,7 @@ internal virtual bool IsOutlineMode() {
459574 }
460575
461576 /// <summary>This method removes all outlines associated with a given page</summary>
462- /// <param name="page"/ >
577+ /// <param name="page">the page to remove outlines</param >
463578 internal virtual void RemoveOutlines ( PdfPage page ) {
464579 if ( GetDocument ( ) . GetWriter ( ) == null ) {
465580 return ;
@@ -477,7 +592,7 @@ internal virtual void RemoveOutlines(PdfPage page) {
477592 }
478593
479594 /// <summary>This method sets the root outline element in the catalog.</summary>
480- /// <param name="outline"/ >
595+ /// <param name="outline">the outline dictionary that shall be the root of the document’s outline hierarchy</param >
481596 internal virtual void AddRootOutline ( PdfOutline outline ) {
482597 if ( ! outlineMode ) {
483598 return ;
0 commit comments