Ejemplo n.º 1
0
 public Rectangle(double left, double top, double width, double height)
     : this(new PdfArray(new PdfDirectObject[]
 {
     PdfReal.Get(left),         // Left (X).
     PdfReal.Get(top - height), // Bottom (Y).
     PdfReal.Get(left + width), // Right.
     PdfReal.Get(top)           // Top.
 }
                         )
            )
 {
 }
Ejemplo n.º 2
0
        /**
         * <summary>Gets the object equivalent to the given value.</summary>
         */
        public static PdfDirectObject Get(object value)
        {
            if (value == null)
            {
                return(null);
            }

            if (value is int intValue)
            {
                return(PdfInteger.Get(intValue));
            }
            else if (value is double doubleValue)
            {
                return(PdfReal.Get(doubleValue));
            }
            else if (value is float singleValue)
            {
                return(PdfReal.Get(singleValue));
            }
            else if (value is string stringValue)
            {
                return(PdfTextString.Get(stringValue));
            }
            else if (value is DateTime dateTimeValue)
            {
                return(PdfDate.Get(dateTimeValue));
            }
            else if (value is bool booleanValue)
            {
                return(PdfBoolean.Get(booleanValue));
            }
            else if (value is long longValue)
            {
                return(PdfInteger.Get((int)longValue));
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 3
0
 public virtual PdfObject Visit(PdfReal obj, object data)
 {
     return(obj);
 }
Ejemplo n.º 4
0
 public void SetDouble(int index, double?value)
 {
     this[index] = PdfReal.Get(value);
 }
Ejemplo n.º 5
0
 public void SetFloat(int index, float?value)
 {
     this[index] = PdfReal.Get(value);
 }