Skip to content

Commit d5d7681

Browse files
nikitakovaliov92iText-CI
authored andcommitted
Add javadocs for PdfDashPattern and PdfCatalog
DEVSIX-4983 Autoported commit. Original commit hash: [98cecf0ed]
1 parent 5e343e4 commit d5d7681

File tree

3 files changed

+143
-6
lines changed

3 files changed

+143
-6
lines changed

itext/itext.kernel/itext/kernel/pdf/PdfCatalog.cs

Lines changed: 120 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,30 @@ source product.
5252
using iText.Kernel.Pdf.Navigation;
5353

5454
namespace 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;

itext/itext.kernel/itext/kernel/pdf/PdfDashPattern.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ source product.
4242
4343
*/
4444
namespace iText.Kernel.Pdf {
45+
/// <summary>Represents the line dash pattern.</summary>
46+
/// <remarks>
47+
/// Represents the line dash pattern. The line dash pattern shall control the pattern
48+
/// of dashes and gaps used to stroke paths. It shall be specified by a dash, gap and
49+
/// a dash phase.
50+
/// </remarks>
4551
public class PdfDashPattern {
4652
/// <summary>This is the length of a dash.</summary>
4753
private float dash = -1;
@@ -52,31 +58,47 @@ public class PdfDashPattern {
5258
/// <summary>This is the phase.</summary>
5359
private float phase = -1;
5460

61+
/// <summary>Creates a new line dash pattern.</summary>
5562
public PdfDashPattern() {
5663
}
5764

65+
/// <summary>Creates a new line dash pattern.</summary>
66+
/// <param name="dash">length of dash</param>
5867
public PdfDashPattern(float dash) {
5968
this.dash = dash;
6069
}
6170

71+
/// <summary>Creates a new line dash pattern.</summary>
72+
/// <param name="dash">length of dash</param>
73+
/// <param name="gap">length of gap</param>
6274
public PdfDashPattern(float dash, float gap) {
6375
this.dash = dash;
6476
this.gap = gap;
6577
}
6678

79+
/// <summary>Creates a new line dash pattern.</summary>
80+
/// <param name="dash">length of dash</param>
81+
/// <param name="gap">length of gap</param>
82+
/// <param name="phase">this is the phase</param>
6783
public PdfDashPattern(float dash, float gap, float phase)
6884
: this(dash, gap) {
6985
this.phase = phase;
7086
}
7187

88+
/// <summary>Gets dash of PdfDashPattern.</summary>
89+
/// <returns>float value.</returns>
7290
public virtual float GetDash() {
7391
return dash;
7492
}
7593

94+
/// <summary>Gets gap of PdfDashPattern.</summary>
95+
/// <returns>float value.</returns>
7696
public virtual float GetGap() {
7797
return gap;
7898
}
7999

100+
/// <summary>Gets phase of PdfDashPattern.</summary>
101+
/// <returns>float value.</returns>
80102
public virtual float GetPhase() {
81103
return phase;
82104
}

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
eba1dc6f2b51c7e40028226c3f0ec1fd79125b81
1+
98cecf0ed71fbf2a8f688a815bf97c1bab16216a

0 commit comments

Comments
 (0)