Пример #1
0
        /// <summary>
        /// Get the font name and flags of a particular character.
        /// </summary>
        /// <param name="charIndex">Zero-based index of the character.</param>
        /// <returns></returns>
        public string GetFontNameInfo(int charIndex)
        {
            // buffer[] is in UTF - 8 encoding.Return 0 on failure.
            byte[] buffer = new byte[1024 * 768 * 4];
            var    length = PDFium.FPDFText_GetFontInfo(this.Handle, charIndex, buffer, (uint)buffer.Length, out int fontFlags);

            if (length > 0)
            {
                return(Encoding.UTF8.GetString(buffer));
            }

            return(string.Empty);
        }