iTextSharp.text.pdf.PdfDictionary.GetAsString C# (CSharp) Method

GetAsString() public method

public GetAsString ( PdfName key ) : PdfString
key PdfName
return PdfString
        public PdfString GetAsString(PdfName key)
        {
            PdfString str = null;
            PdfObject orig = GetDirectObject(key);
            if (orig != null && orig.IsString())
                str = (PdfString) orig;
            return str;
        }

Usage Example

        internal static String GetCOName(PdfReader reader, PRIndirectReference refi)
        {
            String name = "";

            while (refi != null)
            {
                PdfObject obj = PdfReader.GetPdfObject(refi);
                if (obj == null || obj.Type != PdfObject.DICTIONARY)
                {
                    break;
                }
                PdfDictionary dic = (PdfDictionary)obj;
                PdfString     t   = dic.GetAsString(PdfName.T);
                if (t != null)
                {
                    name = t.ToUnicodeString() + "." + name;
                }
                refi = (PRIndirectReference)dic.Get(PdfName.PARENT);
            }
            if (name.EndsWith("."))
            {
                name = name.Substring(0, name.Length - 1);
            }
            return(name);
        }
All Usage Examples Of iTextSharp.text.pdf.PdfDictionary::GetAsString