Exemplo n.º 1
0
 /**
  * <summary>Creates a new predefined stamp on the specified page.</summary>
  * <param name="page">Page where this stamp has to be placed.</param>
  * <param name="location">Position where this stamp has to be centered.</param>
  * <param name="size">Dimension of the stamp:
  *  <list type="bullet">
  *    <item><c>null</c> to apply the natural size</item>
  *    <item><c>size(0, height)</c> to scale the width proportionally to the height</item>
  *    <item><c>size(width, 0)</c> to scale the height proportionally to the width</item>
  *  </list>
  * </param>
  * <param name="text">Annotation text.</param>
  * <param name="type">Predefined stamp type.</param>
  */
 public Stamp(Page page, SKPoint location, SKSize?size, string text, StandardStampEnum type)
     : base(page,
            PdfName.Stamp,
            GeomUtils.Align(size.HasValue
               ? SKRect.Create(0, 0,
                               size.Value.Width > 0 ? size.Value.Width : size.Value.Height * type.GetAspect(),
                               size.Value.Height > 0 ? size.Value.Height : size.Value.Width / type.GetAspect())
               : SKRect.Create(0, 0, 40 * type.GetAspect(), 40),
                            location,
                            new SKPoint(0, 0)),
            text)
 {
     TypeName = type.GetName().StringValue;
 }
Exemplo n.º 2
0
 public static PdfName GetName(this StandardStampEnum type)
 {
     return(codes[type].Code);
 }
Exemplo n.º 3
0
 /**
  * <summary>Gets the aspect ratio of the original Acrobat standard stamp.</summary>
  */
 public static float GetAspect(this StandardStampEnum type)
 {
     return(codes[type].Aspect);
 }