iTextSharp.text.pdf.parser.InlineImageUtils.ParseInlineImage C# (CSharp) Метод

ParseInlineImage() публичный статический Метод

public static ParseInlineImage ( PdfContentParser ps, PdfDictionary colorSpaceDic ) : InlineImageInfo
ps iTextSharp.text.pdf.PdfContentParser
colorSpaceDic iTextSharp.text.pdf.PdfDictionary
Результат InlineImageInfo
        public static InlineImageInfo ParseInlineImage(PdfContentParser ps, PdfDictionary colorSpaceDic)
        {
            PdfDictionary inlineImageDictionary = ParseInlineImageDictionary(ps);
            byte[] samples = ParseInlineImageSamples(inlineImageDictionary, colorSpaceDic, ps);
            return new InlineImageInfo(samples, inlineImageDictionary);
        }

Usage Example

        /**
         * Processes PDF syntax.
         * <b>Note:</b> If you re-use a given {@link PdfContentStreamProcessor}, you must call {@link PdfContentStreamProcessor#reset()}
         * @param contentBytes  the bytes of a content stream
         * @param resources     the resources that come with the content stream
         */
        virtual public void ProcessContent(byte[] contentBytes, PdfDictionary resources)
        {
            this.resources.Push(resources);
            PRTokeniser      tokeniser = new PRTokeniser(new RandomAccessFileOrArray(new RandomAccessSourceFactory().CreateSource(contentBytes)));
            PdfContentParser ps        = new PdfContentParser(tokeniser);
            List <PdfObject> operands  = new List <PdfObject>();

            while (ps.Parse(operands).Count > 0)
            {
                PdfLiteral oper = (PdfLiteral)operands[operands.Count - 1];
                if ("BI".Equals(oper.ToString()))
                {
                    // we don't call invokeOperator for embedded images - this is one area of the PDF spec that is particularly nasty and inconsistent
                    PdfDictionary colorSpaceDic = resources != null?resources.GetAsDict(PdfName.COLORSPACE) : null;

                    HandleInlineImage(InlineImageUtils.ParseInlineImage(ps, colorSpaceDic), colorSpaceDic);
                }
                else
                {
                    InvokeOperator(oper, operands);
                }
            }
            this.resources.Pop();
        }
All Usage Examples Of iTextSharp.text.pdf.parser.InlineImageUtils::ParseInlineImage