@@ -48,6 +48,18 @@ source product.
48
48
using iText . Kernel . Pdf . Navigation ;
49
49
50
50
namespace iText . Kernel . Pdf . Annot {
51
+ /// <summary>
52
+ /// A link annotation represents either a hypertext link to a destination elsewhere in the document
53
+ /// or an
54
+ /// <see cref="iText.Kernel.Pdf.Action.PdfAction"/>
55
+ /// to be performed.
56
+ /// </summary>
57
+ /// <remarks>
58
+ /// A link annotation represents either a hypertext link to a destination elsewhere in the document
59
+ /// or an
60
+ /// <see cref="iText.Kernel.Pdf.Action.PdfAction"/>
61
+ /// to be performed. See also ISO-320001 12.5.6.5, "Link Annotations".
62
+ /// </remarks>
51
63
public class PdfLinkAnnotation : PdfAnnotation {
52
64
private static readonly ILog logger = LogManager . GetLogger ( typeof ( iText . Kernel . Pdf . Annot . PdfLinkAnnotation
53
65
) ) ;
@@ -62,7 +74,7 @@ public class PdfLinkAnnotation : PdfAnnotation {
62
74
public static readonly PdfName Push = PdfName . P ;
63
75
64
76
/// <summary>
65
- /// Instantiates a new
77
+ /// Creates a new
66
78
/// <see cref="PdfLinkAnnotation"/>
67
79
/// instance based on
68
80
/// <see cref="iText.Kernel.Pdf.PdfDictionary"/>
@@ -78,6 +90,18 @@ protected internal PdfLinkAnnotation(PdfDictionary pdfObject)
78
90
: base ( pdfObject ) {
79
91
}
80
92
93
+ /// <summary>
94
+ /// Creates a new
95
+ /// <see cref="PdfLinkAnnotation"/>
96
+ /// instance based on
97
+ /// <see cref="iText.Kernel.Geom.Rectangle"/>
98
+ /// instance, that define the location of the annotation on the page in default user space units.
99
+ /// </summary>
100
+ /// <param name="rect">
101
+ /// the
102
+ /// <see cref="iText.Kernel.Geom.Rectangle"/>
103
+ /// that define the location of the annotation
104
+ /// </param>
81
105
public PdfLinkAnnotation ( Rectangle rect )
82
106
: base ( rect ) {
83
107
}
@@ -86,10 +110,49 @@ public override PdfName GetSubtype() {
86
110
return PdfName . Link ;
87
111
}
88
112
113
+ /// <summary>
114
+ /// Gets the annotation destination as
115
+ /// <see cref="iText.Kernel.Pdf.PdfObject"/>
116
+ /// instance.
117
+ /// </summary>
118
+ /// <remarks>
119
+ /// Gets the annotation destination as
120
+ /// <see cref="iText.Kernel.Pdf.PdfObject"/>
121
+ /// instance.
122
+ /// <para />
123
+ /// Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.
124
+ /// </remarks>
125
+ /// <returns>
126
+ /// the annotation destination as
127
+ /// <see cref="iText.Kernel.Pdf.PdfObject"/>
128
+ /// instance
129
+ /// </returns>
89
130
public virtual PdfObject GetDestinationObject ( ) {
90
131
return GetPdfObject ( ) . Get ( PdfName . Dest ) ;
91
132
}
92
133
134
+ /// <summary>
135
+ /// Sets the annotation destination as
136
+ /// <see cref="iText.Kernel.Pdf.PdfObject"/>
137
+ /// instance.
138
+ /// </summary>
139
+ /// <remarks>
140
+ /// Sets the annotation destination as
141
+ /// <see cref="iText.Kernel.Pdf.PdfObject"/>
142
+ /// instance.
143
+ /// <para />
144
+ /// Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.
145
+ /// </remarks>
146
+ /// <param name="destination">
147
+ /// the destination to be set as
148
+ /// <see cref="iText.Kernel.Pdf.PdfObject"/>
149
+ /// instance
150
+ /// </param>
151
+ /// <returns>
152
+ /// this
153
+ /// <see cref="PdfLinkAnnotation"/>
154
+ /// instance
155
+ /// </returns>
93
156
public virtual iText . Kernel . Pdf . Annot . PdfLinkAnnotation SetDestination ( PdfObject destination ) {
94
157
if ( GetPdfObject ( ) . ContainsKey ( PdfName . A ) ) {
95
158
GetPdfObject ( ) . Remove ( PdfName . A ) ;
@@ -102,10 +165,43 @@ public virtual iText.Kernel.Pdf.Annot.PdfLinkAnnotation SetDestination(PdfObject
102
165
return ( iText . Kernel . Pdf . Annot . PdfLinkAnnotation ) Put ( PdfName . Dest , destination ) ;
103
166
}
104
167
168
+ /// <summary>
169
+ /// Sets the annotation destination as
170
+ /// <see cref="iText.Kernel.Pdf.Navigation.PdfDestination"/>
171
+ /// instance.
172
+ /// </summary>
173
+ /// <remarks>
174
+ /// Sets the annotation destination as
175
+ /// <see cref="iText.Kernel.Pdf.Navigation.PdfDestination"/>
176
+ /// instance.
177
+ /// <para />
178
+ /// Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.
179
+ /// </remarks>
180
+ /// <param name="destination">
181
+ /// the destination to be set as
182
+ /// <see cref="iText.Kernel.Pdf.Navigation.PdfDestination"/>
183
+ /// instance
184
+ /// </param>
185
+ /// <returns>
186
+ /// this
187
+ /// <see cref="PdfLinkAnnotation"/>
188
+ /// instance
189
+ /// </returns>
105
190
public virtual iText . Kernel . Pdf . Annot . PdfLinkAnnotation SetDestination ( PdfDestination destination ) {
106
191
return SetDestination ( destination . GetPdfObject ( ) ) ;
107
192
}
108
193
194
+ /// <summary>Removes the annotation destination.</summary>
195
+ /// <remarks>
196
+ /// Removes the annotation destination.
197
+ /// <para />
198
+ /// Destination shall be displayed when the annotation is activated. See also ISO-320001, Table 173.
199
+ /// </remarks>
200
+ /// <returns>
201
+ /// this
202
+ /// <see cref="PdfLinkAnnotation"/>
203
+ /// instance
204
+ /// </returns>
109
205
public virtual iText . Kernel . Pdf . Annot . PdfLinkAnnotation RemoveDestination ( ) {
110
206
GetPdfObject ( ) . Remove ( PdfName . Dest ) ;
111
207
return this ;
@@ -120,7 +216,7 @@ public virtual iText.Kernel.Pdf.Annot.PdfLinkAnnotation RemoveDestination() {
120
216
/// <returns>
121
217
///
122
218
/// <see cref="iText.Kernel.Pdf.PdfDictionary"/>
123
- /// which defines the characteristics and behaviour of an action.
219
+ /// which defines the characteristics and behaviour of an action
124
220
/// </returns>
125
221
public virtual PdfDictionary GetAction ( ) {
126
222
return GetPdfObject ( ) . GetAsDictionary ( PdfName . A ) ;
@@ -135,12 +231,12 @@ public virtual PdfDictionary GetAction() {
135
231
/// <param name="action">
136
232
///
137
233
/// <see cref="iText.Kernel.Pdf.PdfDictionary"/>
138
- /// that represents action to set to this annotation.
234
+ /// that represents action to set to this annotation
139
235
/// </param>
140
236
/// <returns>
141
237
/// this
142
238
/// <see cref="PdfLinkAnnotation"/>
143
- /// instance.
239
+ /// instance
144
240
/// </returns>
145
241
public virtual iText . Kernel . Pdf . Annot . PdfLinkAnnotation SetAction ( PdfDictionary action ) {
146
242
return ( iText . Kernel . Pdf . Annot . PdfLinkAnnotation ) Put ( PdfName . A , action ) ;
@@ -154,12 +250,12 @@ public virtual iText.Kernel.Pdf.Annot.PdfLinkAnnotation SetAction(PdfDictionary
154
250
/// <param name="action">
155
251
///
156
252
/// <see cref="iText.Kernel.Pdf.Action.PdfAction"/>
157
- /// to set to this annotation.
253
+ /// to set to this annotation
158
254
/// </param>
159
255
/// <returns>
160
256
/// this
161
257
/// <see cref="PdfLinkAnnotation"/>
162
- /// instance.
258
+ /// instance
163
259
/// </returns>
164
260
public virtual iText . Kernel . Pdf . Annot . PdfLinkAnnotation SetAction ( PdfAction action ) {
165
261
if ( GetDestinationObject ( ) != null ) {
@@ -169,27 +265,115 @@ public virtual iText.Kernel.Pdf.Annot.PdfLinkAnnotation SetAction(PdfAction acti
169
265
return ( iText . Kernel . Pdf . Annot . PdfLinkAnnotation ) Put ( PdfName . A , action . GetPdfObject ( ) ) ;
170
266
}
171
267
268
+ /// <summary>
269
+ /// Removes a
270
+ /// <see cref="iText.Kernel.Pdf.Action.PdfAction"/>
271
+ /// from this annotation.
272
+ /// </summary>
273
+ /// <returns>
274
+ /// this
275
+ /// <see cref="PdfLinkAnnotation"/>
276
+ /// instance
277
+ /// </returns>
172
278
public virtual iText . Kernel . Pdf . Annot . PdfLinkAnnotation RemoveAction ( ) {
173
279
GetPdfObject ( ) . Remove ( PdfName . A ) ;
174
280
return this ;
175
281
}
176
282
283
+ /// <summary>Gets the annotation highlight mode.</summary>
284
+ /// <remarks>
285
+ /// Gets the annotation highlight mode.
286
+ /// <para />
287
+ /// The annotation’s highlighting mode is the visual effect that shall be used when the mouse
288
+ /// button is pressed or held down inside its active area. See also ISO-320001, Table 173.
289
+ /// </remarks>
290
+ /// <returns>the name of visual effect</returns>
177
291
public virtual PdfName GetHighlightMode ( ) {
178
292
return GetPdfObject ( ) . GetAsName ( PdfName . H ) ;
179
293
}
180
294
295
+ /// <summary>Sets the annotation highlight mode.</summary>
296
+ /// <remarks>
297
+ /// Sets the annotation highlight mode.
298
+ /// <para />
299
+ /// The annotation’s highlighting mode is the visual effect that shall be used when the mouse
300
+ /// button is pressed or held down inside its active area. See also ISO-320001, Table 173.
301
+ /// </remarks>
302
+ /// <param name="hlMode">the name of visual effect to be set</param>
303
+ /// <returns>
304
+ /// this
305
+ /// <see cref="PdfLinkAnnotation"/>
306
+ /// instance
307
+ /// </returns>
181
308
public virtual iText . Kernel . Pdf . Annot . PdfLinkAnnotation SetHighlightMode ( PdfName hlMode ) {
182
309
return ( iText . Kernel . Pdf . Annot . PdfLinkAnnotation ) Put ( PdfName . H , hlMode ) ;
183
310
}
184
311
312
+ /// <summary>
313
+ /// Gets the annotation URI action as
314
+ /// <see cref="iText.Kernel.Pdf.PdfDictionary"/>.
315
+ /// </summary>
316
+ /// <remarks>
317
+ /// Gets the annotation URI action as
318
+ /// <see cref="iText.Kernel.Pdf.PdfDictionary"/>.
319
+ /// <para />
320
+ /// When Web Capture (see ISO-320001 14.10, “Web Capture”) changes an annotation from a URI to a
321
+ /// go-to action, it uses this entry to save the data from the original URI action so that it can
322
+ /// be changed back in case the target page for the go-to action is subsequently deleted. See also
323
+ /// ISO-320001, Table 173.
324
+ /// </remarks>
325
+ /// <returns>the URI action as pdfDictionary</returns>
185
326
public virtual PdfDictionary GetUriActionObject ( ) {
186
327
return GetPdfObject ( ) . GetAsDictionary ( PdfName . PA ) ;
187
328
}
188
329
330
+ /// <summary>
331
+ /// Sets the annotation URI action as
332
+ /// <see cref="iText.Kernel.Pdf.PdfDictionary"/>
333
+ /// instance.
334
+ /// </summary>
335
+ /// <remarks>
336
+ /// Sets the annotation URI action as
337
+ /// <see cref="iText.Kernel.Pdf.PdfDictionary"/>
338
+ /// instance.
339
+ /// <para />
340
+ /// When Web Capture (see ISO-320001 14.10, “Web Capture”) changes an annotation from a URI to a
341
+ /// go-to action, it uses this entry to save the data from the original URI action so that it can
342
+ /// be changed back in case the target page for the go-to action is subsequently deleted. See also
343
+ /// ISO-320001, Table 173.
344
+ /// </remarks>
345
+ /// <param name="action">the action to be set</param>
346
+ /// <returns>
347
+ /// this
348
+ /// <see cref="PdfLinkAnnotation"/>
349
+ /// instance
350
+ /// </returns>
189
351
public virtual iText . Kernel . Pdf . Annot . PdfLinkAnnotation SetUriAction ( PdfDictionary action ) {
190
352
return ( iText . Kernel . Pdf . Annot . PdfLinkAnnotation ) Put ( PdfName . PA , action ) ;
191
353
}
192
354
355
+ /// <summary>
356
+ /// Sets the annotation URI action as
357
+ /// <see cref="iText.Kernel.Pdf.Action.PdfAction"/>
358
+ /// instance.
359
+ /// </summary>
360
+ /// <remarks>
361
+ /// Sets the annotation URI action as
362
+ /// <see cref="iText.Kernel.Pdf.Action.PdfAction"/>
363
+ /// instance.
364
+ /// <para />
365
+ /// A URI action (see ISO-320001 12.6.4.7, “URI Actions”) formerly associated with this annotation.
366
+ /// When Web Capture (see ISO-320001 14.10, “Web Capture”) changes an annotation from a URI to a
367
+ /// go-to action, it uses this entry to save the data from the original URI action so that it can
368
+ /// be changed back in case the target page for the go-to action is subsequently deleted. See also
369
+ /// ISO-320001, Table 173.
370
+ /// </remarks>
371
+ /// <param name="action">the action to be set</param>
372
+ /// <returns>
373
+ /// this
374
+ /// <see cref="PdfLinkAnnotation"/>
375
+ /// instance
376
+ /// </returns>
193
377
public virtual iText . Kernel . Pdf . Annot . PdfLinkAnnotation SetUriAction ( PdfAction action ) {
194
378
return ( iText . Kernel . Pdf . Annot . PdfLinkAnnotation ) Put ( PdfName . PA , action . GetPdfObject ( ) ) ;
195
379
}
0 commit comments