@@ -57,6 +57,16 @@ namespace iText.Kernel.Pdf.Colorspace {
57
57
/// For mor information see paragraph 8.7 in ISO-32000-1.
58
58
/// </remarks>
59
59
public abstract class PdfPattern : PdfObjectWrapper < PdfDictionary > {
60
+ /// <summary>
61
+ /// Wraps the passed
62
+ /// <see cref="iText.Kernel.Pdf.PdfDictionary"/>
63
+ /// </summary>
64
+ /// <param name="pdfObject">
65
+ /// the
66
+ /// <see cref="iText.Kernel.Pdf.PdfDictionary"/>
67
+ /// that represent Pattern
68
+ /// </param>
69
+ /// <returns>new wrapper instance.</returns>
60
70
protected internal PdfPattern ( PdfDictionary pdfObject )
61
71
: base ( pdfObject ) {
62
72
}
@@ -206,34 +216,82 @@ public Tiling(PdfStream pdfObject)
206
216
: base ( pdfObject ) {
207
217
}
208
218
219
+ /// <summary>Creates a new Tiling Pattern instance.</summary>
220
+ /// <remarks>
221
+ /// Creates a new Tiling Pattern instance.
222
+ /// By default the pattern will be colored.
223
+ /// </remarks>
224
+ /// <param name="width">the width of the pattern cell's bounding box</param>
225
+ /// <param name="height">the height of the pattern cell's bounding box</param>
209
226
public Tiling ( float width , float height )
210
227
: this ( width , height , true ) {
211
228
}
212
229
230
+ /// <summary>Creates a new Tiling Pattern instance.</summary>
231
+ /// <param name="width">the width of the pattern cell's bounding box</param>
232
+ /// <param name="height">the height of the pattern cell's bounding box</param>
233
+ /// <param name="colored">defines whether the Tiling Pattern will be colored or not</param>
213
234
public Tiling ( float width , float height , bool colored )
214
235
: this ( new Rectangle ( width , height ) , colored ) {
215
236
}
216
237
238
+ /// <summary>Creates a new Tiling instance.</summary>
239
+ /// <remarks>
240
+ /// Creates a new Tiling instance.
241
+ /// By default the pattern will be colored.
242
+ /// </remarks>
243
+ /// <param name="bbox">the pattern cell's bounding box</param>
217
244
public Tiling ( Rectangle bbox )
218
245
: this ( bbox , true ) {
219
246
}
220
247
248
+ /// <summary>Creates a new Tiling instance.</summary>
249
+ /// <param name="bbox">the pattern cell's bounding box</param>
250
+ /// <param name="colored">defines whether the Tiling Pattern will be colored or not</param>
221
251
public Tiling ( Rectangle bbox , bool colored )
222
252
: this ( bbox , bbox . GetWidth ( ) , bbox . GetHeight ( ) , colored ) {
223
253
}
224
254
255
+ /// <summary>Creates a new Tiling Pattern instance.</summary>
256
+ /// <remarks>
257
+ /// Creates a new Tiling Pattern instance.
258
+ /// By default the pattern will be colored.
259
+ /// </remarks>
260
+ /// <param name="width">the width of the pattern cell's bounding box</param>
261
+ /// <param name="height">the height of the pattern cell's bounding box</param>
262
+ /// <param name="xStep">the desired horizontal space between pattern cells</param>
263
+ /// <param name="yStep">the desired vertical space between pattern cells</param>
225
264
public Tiling ( float width , float height , float xStep , float yStep )
226
265
: this ( width , height , xStep , yStep , true ) {
227
266
}
228
267
268
+ /// <summary>Creates a new Tiling Pattern instance.</summary>
269
+ /// <param name="width">the width of the pattern cell's bounding box</param>
270
+ /// <param name="height">the height of the pattern cell's bounding box</param>
271
+ /// <param name="xStep">the desired horizontal space between pattern cells</param>
272
+ /// <param name="yStep">the desired vertical space between pattern cells</param>
273
+ /// <param name="colored">defines whether the Tiling Pattern will be colored or not</param>
229
274
public Tiling ( float width , float height , float xStep , float yStep , bool colored )
230
275
: this ( new Rectangle ( width , height ) , xStep , yStep , colored ) {
231
276
}
232
277
278
+ /// <summary>Creates a new Tiling instance.</summary>
279
+ /// <remarks>
280
+ /// Creates a new Tiling instance.
281
+ /// By default the pattern will be colored.
282
+ /// </remarks>
283
+ /// <param name="bbox">the pattern cell's bounding box</param>
284
+ /// <param name="xStep">the desired horizontal space between pattern cells</param>
285
+ /// <param name="yStep">the desired vertical space between pattern cells</param>
233
286
public Tiling ( Rectangle bbox , float xStep , float yStep )
234
287
: this ( bbox , xStep , yStep , true ) {
235
288
}
236
289
290
+ /// <summary>Creates a new Tiling instance.</summary>
291
+ /// <param name="bbox">the pattern cell's bounding box</param>
292
+ /// <param name="xStep">the desired horizontal space between pattern cells</param>
293
+ /// <param name="yStep">the desired vertical space between pattern cells</param>
294
+ /// <param name="colored">defines whether the Tiling Pattern will be colored or not</param>
237
295
public Tiling ( Rectangle bbox , float xStep , float yStep , bool colored )
238
296
: base ( new PdfStream ( ) ) {
239
297
GetPdfObject ( ) . Put ( PdfName . Type , PdfName . Pattern ) ;
@@ -318,24 +376,32 @@ public virtual void SetBBox(Rectangle bbox) {
318
376
SetModified ( ) ;
319
377
}
320
378
379
+ /// <summary>Gets the desired horizontal space between pattern cells</summary>
380
+ /// <returns>the desired horizontal space between pattern cells</returns>
321
381
public virtual float GetXStep ( ) {
322
382
return GetPdfObject ( ) . GetAsNumber ( PdfName . XStep ) . FloatValue ( ) ;
323
383
}
324
384
385
+ /// <summary>Sets the desired horizontal space between pattern cells</summary>
325
386
public virtual void SetXStep ( float xStep ) {
326
387
GetPdfObject ( ) . Put ( PdfName . XStep , new PdfNumber ( xStep ) ) ;
327
388
SetModified ( ) ;
328
389
}
329
390
391
+ /// <summary>Gets the desired vertical space between pattern cells</summary>
392
+ /// <returns>the desired vertical space between pattern cells</returns>
330
393
public virtual float GetYStep ( ) {
331
394
return GetPdfObject ( ) . GetAsNumber ( PdfName . YStep ) . FloatValue ( ) ;
332
395
}
333
396
397
+ /// <summary>Sets the desired vertical space between pattern cells</summary>
334
398
public virtual void SetYStep ( float yStep ) {
335
399
GetPdfObject ( ) . Put ( PdfName . YStep , new PdfNumber ( yStep ) ) ;
336
400
SetModified ( ) ;
337
401
}
338
402
403
+ /// <summary>Gets the Tiling Pattern's resources</summary>
404
+ /// <returns>the Tiling Pattern's resources</returns>
339
405
public virtual PdfResources GetResources ( ) {
340
406
if ( this . resources == null ) {
341
407
PdfDictionary resourcesDict = GetPdfObject ( ) . GetAsDictionary ( PdfName . Resources ) ;
@@ -355,27 +421,84 @@ public override void Flush() {
355
421
}
356
422
}
357
423
424
+ /// <summary>
425
+ /// Shading pattern provides a smooth transition between colors across an area to be painted,
426
+ /// independent of the resolution of any particular output device and without specifying
427
+ /// the number of steps in the color transition.
428
+ /// </summary>
429
+ /// <remarks>
430
+ /// Shading pattern provides a smooth transition between colors across an area to be painted,
431
+ /// independent of the resolution of any particular output device and without specifying
432
+ /// the number of steps in the color transition. Patterns of this type are described
433
+ /// by pattern dictionaries with a pattern type of 2.
434
+ /// </remarks>
358
435
public class Shading : PdfPattern {
436
+ /// <summary>
437
+ /// Creates new instance from the
438
+ /// <see cref="iText.Kernel.Pdf.PdfStream"/>
439
+ /// object.
440
+ /// </summary>
441
+ /// <remarks>
442
+ /// Creates new instance from the
443
+ /// <see cref="iText.Kernel.Pdf.PdfStream"/>
444
+ /// object.
445
+ /// This stream should have PatternType equals to 2.
446
+ /// </remarks>
447
+ /// <param name="pdfObject">
448
+ /// the
449
+ /// <see cref="iText.Kernel.Pdf.PdfStream"/>
450
+ /// that represents Shading Pattern.
451
+ /// </param>
359
452
public Shading ( PdfDictionary pdfObject )
360
453
: base ( pdfObject ) {
361
454
}
362
455
456
+ /// <summary>Creates a new instance of Shading Pattern.</summary>
457
+ /// <param name="shading">
458
+ /// the
459
+ /// <see cref="PdfShading"/>
460
+ /// that specifies the details of a particular
461
+ /// gradient fill
462
+ /// </param>
363
463
public Shading ( PdfShading shading )
364
464
: base ( new PdfDictionary ( ) ) {
365
465
GetPdfObject ( ) . Put ( PdfName . Type , PdfName . Pattern ) ;
366
466
GetPdfObject ( ) . Put ( PdfName . PatternType , new PdfNumber ( 2 ) ) ;
367
467
GetPdfObject ( ) . Put ( PdfName . Shading , shading . GetPdfObject ( ) ) ;
368
468
}
369
469
470
+ /// <summary>
471
+ /// Gets the dictionary of the pattern's
472
+ /// <see cref="PdfShading"/>
473
+ /// </summary>
474
+ /// <returns>
475
+ /// the dictionary of the pattern's
476
+ /// <see cref="PdfShading"/>
477
+ /// </returns>
370
478
public virtual PdfDictionary GetShading ( ) {
371
479
return ( PdfDictionary ) GetPdfObject ( ) . Get ( PdfName . Shading ) ;
372
480
}
373
481
482
+ /// <summary>
483
+ /// Sets the
484
+ /// <see cref="PdfShading"/>
485
+ /// that specifies the details of a particular gradient fill
486
+ /// </summary>
487
+ /// <param name="shading">
488
+ /// the
489
+ /// <see cref="PdfShading"/>
490
+ /// that specifies the details of a particular gradient fill
491
+ /// </param>
374
492
public virtual void SetShading ( PdfShading shading ) {
375
493
GetPdfObject ( ) . Put ( PdfName . Shading , shading . GetPdfObject ( ) ) ;
376
494
SetModified ( ) ;
377
495
}
378
496
497
+ /// <summary>Sets the dictionary which specifies the details of a particular gradient fill</summary>
498
+ /// <param name="shading">
499
+ /// the dictionary of the pattern's
500
+ /// <see cref="PdfShading"/>
501
+ /// </param>
379
502
public virtual void SetShading ( PdfDictionary shading ) {
380
503
GetPdfObject ( ) . Put ( PdfName . Shading , shading ) ;
381
504
SetModified ( ) ;
0 commit comments