Ejemplo n.º 1
0
 public override bool Equals(PDFTextOp other)
 {
     if (base.Equals(other))
     {
         PDFTextFontOp op = other as PDFTextFontOp;
         if (String.Equals(op.FontStyle, this.FontStyle) && op.ApplyStyle == this.ApplyStyle)
         {
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 2
0
        public override bool Read()
        {
            PDFTextOp op = null;
            string    style;

            while (this.MoveToNext())
            {
                if (this.InnerReader.NodeType == XmlNodeType.Element)
                {
                    if (this.InnerReader.Name.Equals("br", StringComparison.CurrentCultureIgnoreCase))
                    {
                        op = new PDFTextNewLineOp();
                        break;
                    }
                    else if (this.IsFontStyleOp(this.InnerReader.Name, out style))
                    {
                        op = new PDFTextFontOp(style, true);
                        break;
                    }
                    else if (this.InnerReader.Name.Equals("span", StringComparison.CurrentCultureIgnoreCase))
                    {
                        throw new NotSupportedException("Span is not a currently supported Component");
                    }
                }
                else if (this.InnerReader.NodeType == XmlNodeType.Text)
                {
                    string text = this.StripWhiteSpace(this.InnerReader.Value.Trim(), op != null);
                    op = new PDFTextDrawOp(text);
                    break;
                }
                else if (this.InnerReader.NodeType == XmlNodeType.EndElement)
                {
                    if (this.IsFontStyleOp(this.InnerReader.Name, out style))
                    {
                        op = new PDFTextFontOp(style, false);

                        break;
                    }
                }
            }
            this._op = op;

            return(op != null);
        }