iTextSharp.text.pdf.ICC_Profile.GetInstance C# (CSharp) Метод

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

public static GetInstance ( byte data ) : ICC_Profile
data byte
Результат ICC_Profile
        public static ICC_Profile GetInstance(byte[] data)
        {
            int numComponents;
            if (!cstags.TryGetValue(Encoding.ASCII.GetString(data, 16, 4), out numComponents)) {
                numComponents = 0;
            }
            return GetInstance(data, numComponents);
        }

Same methods

ICC_Profile::GetInstance ( Stream file ) : ICC_Profile
ICC_Profile::GetInstance ( String fname ) : ICC_Profile
ICC_Profile::GetInstance ( byte data, int numComponents ) : ICC_Profile

Usage Example

Пример #1
0
        protected override void ReadColorProfile()
        {
            PdfObject outputIntents = reader.Catalog.GetAsArray(PdfName.OUTPUTINTENTS);

            if (outputIntents != null && ((PdfArray)outputIntents).Size > 0)
            {
                PdfStream iccProfileStream = null;
                for (int i = 0; i < ((PdfArray)outputIntents).Size; i++)
                {
                    PdfDictionary outputIntentDictionary = ((PdfArray)outputIntents).GetAsDict(i);
                    if (outputIntentDictionary != null)
                    {
                        PdfName gts = outputIntentDictionary.GetAsName(PdfName.S);
                        if (iccProfileStream == null || PdfName.GTS_PDFA1.Equals(gts))
                        {
                            iccProfileStream = outputIntentDictionary.GetAsStream(PdfName.DESTOUTPUTPROFILE);
                            if (iccProfileStream != null && PdfName.GTS_PDFA1.Equals(gts))
                            {
                                break;
                            }
                        }
                    }
                }
                if (iccProfileStream is PRStream)
                {
                    colorProfile = ICC_Profile.GetInstance(PdfReader.GetStreamBytes((PRStream)iccProfileStream));
                }
            }
        }