示例#1
0
        protected virtual PDFTextReader CreateReader(PDFLayoutContext context, Style fullstyle)
        {
            TextFormat format             = TextFormat.Plain;
            bool       preserveWhitespace = fullstyle.GetValue(StyleKeys.TextWhitespaceKey, false);


            if (this is IPDFTextLiteral)
            {
                format = ((IPDFTextLiteral)this).ReaderFormat;
            }

            return(PDFTextReader.Create(this.BaseText, format, preserveWhitespace, context.TraceLog));
        }
        public virtual PDFTextReader CreateReader(PDFLayoutContext context, Style fullstyle)
        {
            if (string.IsNullOrEmpty(this.Text))
            {
                return(null);
            }

            TextFormat format             = this.ReaderFormat;
            bool       preserveWhitespace = fullstyle.GetValue(StyleKeys.TextWhitespaceKey, false);

            if (preserveWhitespace)
            {
                context.TraceLog.Add("PreFormatted", "Creating a reader with preserved white space");
            }

            return(PDFTextReader.Create(this.Text, format, preserveWhitespace, context.TraceLog));
        }