public PdfRectangleF() { point1 = new PdfReal(); point2 = new PdfReal(); point3 = new PdfReal(); point4 = new PdfReal(); Init(); }
public DeviceCMYKColor(double c, double m, double y, double k) : this( new PdfArray( PdfReal.Get(NormalizeComponent(c)), PdfReal.Get(NormalizeComponent(m)), PdfReal.Get(NormalizeComponent(y)), PdfReal.Get(NormalizeComponent(k)))) { }
public Line(Page page, SKPoint startPoint, SKPoint endPoint, string text, DeviceRGBColor color) : base(page, PdfName.Line, SKRect.Create(startPoint.X, startPoint.Y, endPoint.X - startPoint.X, endPoint.Y - startPoint.Y), text) { BaseDataObject[PdfName.L] = new PdfArray(new PdfDirectObject[] { PdfReal.Get(0), PdfReal.Get(0), PdfReal.Get(0), PdfReal.Get(0) }); StartPoint = startPoint; EndPoint = endPoint; Color = color; }
public PdfRectangleF(PdfReal point1, PdfReal point2, PdfReal point3, PdfReal point4) { this.point1 = point1; this.point2 = point2; this.point3 = point3; this.point4 = point4; Init(); }
/* * TODO:colors MUST be instantiated only indirectly by the ColorSpace.getColor method! * This method MUST be made internal and its color space MUST be passed as argument! */ public LabColor(double l, double a, double b) : this( new PdfArray( PdfReal.Get(NormalizeComponent(l)),//TODO:normalize using the actual color space ranges!!! PdfReal.Get(NormalizeComponent(a)), PdfReal.Get(NormalizeComponent(b)) ) ) { }
public CalGrayColor( double g ) : this( new List <PdfDirectObject>( new PdfDirectObject[] { PdfReal.Get(NormalizeComponent(g)) } ) ) { }
public CalRGBColor(double r, double g, double b) : this(new PdfArray( PdfReal.Get(NormalizeComponent(r)), PdfReal.Get(NormalizeComponent(g)), PdfReal.Get(NormalizeComponent(b)) ) ) { }
public DeviceRGBColor(double r, double g, double b) : this(new PdfDirectObject[] { PdfReal.Get(NormalizeComponent(r)), PdfReal.Get(NormalizeComponent(g)), PdfReal.Get(NormalizeComponent(b)) }) { }
public SetCharSpace(double value) : base( OperatorKeyword, new List <PdfDirectObject>( new PdfDirectObject[] { PdfReal.Get(value) } ) ) { }
/** * <param name="pointX">Current point X.</param> * <param name="pointY">Current point Y.</param> */ public BeginSubpath(double pointX, double pointY) : base(OperatorKeyword, new List <PdfDirectObject>(new PdfDirectObject[] { PdfReal.Get(pointX), PdfReal.Get(pointY) } ) ) { }
private void EnsureSpaceOperation( ) { if (@operator.Equals(SimpleOperatorKeyword)) { @operator = SpaceOperatorKeyword; operands.Insert(0, PdfReal.Get(0)); operands.Insert(1, PdfReal.Get(0)); } }
private static IList <PdfDirectObject> GetComponentValues(params double[] components) {// TODO:normalize parameters! IList <PdfDirectObject> componentValues = new List <PdfDirectObject>(); foreach (double component in components) { componentValues.Add(PdfReal.Get((component))); } return(componentValues); }
public TranslateTextRelative( double offsetX, double offsetY, bool leadSet ) : base( leadSet ? LeadOperatorKeyword : SimpleOperatorKeyword, PdfReal.Get(offsetX), PdfReal.Get(offsetY) ) { }
public SetTextMatrix(double a, double b, double c, double d, double e, double f) : base(OperatorKeyword, PdfReal.Get(a), PdfReal.Get(b), PdfReal.Get(c), PdfReal.Get(d), PdfReal.Get(e), PdfReal.Get(f) ) { }
/** * <param name="text">Text encoded using current font's encoding.</param> * <param name="wordSpace">Word spacing.</param> * <param name="charSpace">Character spacing.</param> */ public ShowTextToNextLine( byte[] text, double wordSpace, double charSpace ) : base( SpaceOperatorKeyword, PdfReal.Get(wordSpace), PdfReal.Get(charSpace), new PdfByteString(text) ) { }
public SeparationColor( double intensity ) : this( new List <PdfDirectObject>( new PdfDirectObject[] { PdfReal.Get(intensity) //TODO:normalize value (see devicecolor)! } ) ) { }
public DeviceCMYKColor(double c, double m, double y, double k) : this( new List <PdfDirectObject>( new PdfDirectObject[] { PdfReal.Get(NormalizeComponent(c)), PdfReal.Get(NormalizeComponent(m)), PdfReal.Get(NormalizeComponent(y)), PdfReal.Get(NormalizeComponent(k)) } ) ) { }
/** * <summary>Creates a partially-explicit curve.</summary> * <param name="point">Final endpoint.</param> * <param name="control">Explicit control point.</param> * <param name="operator">Operator (either <code>InitialOperator</code> or <code>FinalOperator</code>). * It defines how to interpret the <code>control</code> parameter.</param> */ public DrawCurve(SKPoint point, SKPoint control, string @operator) : base(@operator.Equals(InitialOperatorKeyword, StringComparison.Ordinal) ? InitialOperatorKeyword : FinalOperatorKeyword, new List <PdfDirectObject>(new PdfDirectObject[] { PdfReal.Get(control.X), PdfReal.Get(control.Y), PdfReal.Get(point.X), PdfReal.Get(point.Y) } ) ) { }
/** * <summary>Creates a fully-explicit curve.</summary> */ public DrawCurve(double pointX, double pointY, double control1X, double control1Y, double control2X, double control2Y) : base(FullOperatorKeyword, new List <PdfDirectObject>(new PdfDirectObject[] { PdfReal.Get(control1X), PdfReal.Get(control1Y), PdfReal.Get(control2X), PdfReal.Get(control2Y), PdfReal.Get(pointX), PdfReal.Get(pointY) } ) ) { }
/* * TODO:colors MUST be instantiated only indirectly by the ColorSpace.getColor method! * This method MUST be made internal and its color space MUST be passed as argument! */ public LabColor( double l, double a, double b ) : this( new List <PdfDirectObject>( new PdfDirectObject[] { PdfReal.Get(NormalizeComponent(l)),//TODO:normalize using the actual color space ranges!!! PdfReal.Get(NormalizeComponent(a)), PdfReal.Get(NormalizeComponent(b)) } ) ) { }
public CalRGBColor( double r, double g, double b ) : this( new List <PdfDirectObject>( new PdfDirectObject[] { PdfReal.Get(NormalizeComponent(r)), PdfReal.Get(NormalizeComponent(g)), PdfReal.Get(NormalizeComponent(b)) } ) ) { }
public ModifyCTM(double a, double b, double c, double d, double e, double f) : base(OperatorKeyword, new List <PdfDirectObject>( new PdfDirectObject[] { PdfReal.Get(a), PdfReal.Get(b), PdfReal.Get(c), PdfReal.Get(d), PdfReal.Get(e), PdfReal.Get(f) } ) ) { }
private IPdfElement ParseNumber() { long startPosition = _streamPosition; bool valid = false; int dotCount = 0; StringBuilder sbNumber = new StringBuilder(); if (PeekChar() == '-') { sbNumber.Append('-'); NextChar(); } else if (PeekChar() == '+') { NextChar(); } while (IsDigit(PeekChar()) || PeekChar() == '.') { if (PeekChar() == '.') { sbNumber.Append(_decimalSeparator); dotCount++; } else { sbNumber.Append((char)PeekChar()); } NextChar(); valid = true; } if (valid && dotCount <= 1) { if (dotCount == 0) { PdfInteger obj = new PdfInteger(); obj.Value = Convert.ToInt32(sbNumber.ToString()); return(obj); } if (dotCount == 1) { PdfReal obj = new PdfReal(); obj.Value = Convert.ToDouble(sbNumber.ToString(), CultureInfo.InvariantCulture); return(obj); } } throw new Exception(string.Format("Expected number at {0}, found \"{1}\"", startPosition, sbNumber.ToString())); }
/** * <summary>Creates a partially-explicit curve.</summary> * <param name="point">Final endpoint.</param> * <param name="control">Explicit control point.</param> * <param name="operator">Operator (either <code>InitialOperator</code> or <code>FinalOperator</code>). * It defines how to interpret the <code>control</code> parameter.</param> */ public DrawCurve( PointF point, PointF control, string @operator ) : base( @operator.Equals(InitialOperatorKeyword) ? InitialOperatorKeyword : FinalOperatorKeyword, new List <PdfDirectObject>( new PdfDirectObject[] { PdfReal.Get(control.X), PdfReal.Get(control.Y), PdfReal.Get(point.X), PdfReal.Get(point.Y) } ) ) { }
/** * <summary>Gets the result of the calculation applied by this function * to the specified input values.</summary> * <param name="inputs">Input values.</param> */ public IList <PdfDirectObject> Calculate(IList <PdfDirectObject> inputs) { IList <PdfDirectObject> outputs = new List <PdfDirectObject>(); { double[] inputValues = new double[inputs.Count]; for (int index = 0, length = inputValues.Length; index < length; index++) { inputValues[index] = ((IPdfNumber)inputs[index]).RawValue; } double[] outputValues = Calculate(inputValues); for (int index = 0, length = outputValues.Length; index < length; index++) { outputs.Add(PdfReal.Get(outputValues[index])); } } return(outputs); }
public DrawRectangle( double x, double y, double width, double height ) : base( OperatorKeyword, new List <PdfDirectObject>( new PdfDirectObject[] { PdfReal.Get(x), PdfReal.Get(y), PdfReal.Get(width), PdfReal.Get(height) } ) ) { }
public CalloutLine(Page page, SKPoint start, SKPoint?knee, SKPoint end) : base(new PdfArray()) { SKMatrix matrix = page.InRotateMatrix; PdfArray baseDataObject = BaseDataObject; { start = matrix.MapPoint(start); baseDataObject.Add(PdfReal.Get(start.X)); baseDataObject.Add(PdfReal.Get(start.Y)); if (knee.HasValue) { knee = matrix.MapPoint(knee.Value); baseDataObject.Add(PdfReal.Get(knee.Value.X)); baseDataObject.Add(PdfReal.Get(knee.Value.Y)); } end = matrix.MapPoint(end); baseDataObject.Add(PdfReal.Get(end.X)); baseDataObject.Add(PdfReal.Get(end.Y)); } }
public Line( Page page, PointF startPoint, PointF endPoint, string text ) : base( page, PdfName.Line, new RectangleF( startPoint.X, startPoint.Y, endPoint.X - startPoint.X, endPoint.Y - startPoint.Y ), text ) { BaseDataObject[PdfName.L] = new PdfArray(new PdfDirectObject[] { PdfReal.Get(0), PdfReal.Get(0), PdfReal.Get(0), PdfReal.Get(0) }); StartPoint = startPoint; EndPoint = endPoint; }
public CalloutLine( Page page, PointF start, PointF?knee, PointF end ) : base(new PdfArray()) { this.page = page; PdfArray baseDataObject = BaseDataObject; { double pageHeight = page.Box.Height; baseDataObject.Add(PdfReal.Get(start.X)); baseDataObject.Add(PdfReal.Get(pageHeight - start.Y)); if (knee.HasValue) { baseDataObject.Add(PdfReal.Get(knee.Value.X)); baseDataObject.Add(PdfReal.Get(pageHeight - knee.Value.Y)); } baseDataObject.Add(PdfReal.Get(end.X)); baseDataObject.Add(PdfReal.Get(pageHeight - end.Y)); } }
/// <summary> /// Writes the specified value to the PDF stream. /// </summary> public void Write(PdfReal value) { WriteSeparator(CharCat.Character); WriteRaw(value.Value.ToString(Config.SignificantFigures7, CultureInfo.InvariantCulture)); _lastCat = CharCat.Character; }
protected void SetComponentValue( int index, double value ) { Components[index] = new PdfReal(NormalizeComponent(value)); }
public virtual PdfObject Visit( PdfReal obj, object data ) { return obj; }
/// <summary> /// Writes the specified value to the PDF stream. /// </summary> public void Write(PdfReal value) { WriteSeparator(CharCat.Character); WriteRaw(value.Value.ToString("0.###", CultureInfo.InvariantCulture)); this.lastCat = CharCat.Character; }