コード例 #1
0
        private static FontFlags GetFlags(PdfDictionary dictionary, bool isLenientParsing)
        {
            var flags = dictionary.GetIntOrDefault(CosName.FLAGS, -1);

            if (flags == -1)
            {
                if (isLenientParsing)
                {
                    flags = 0;
                }
                else
                {
                    throw new InvalidOperationException("Font flags were not set correctly for the font descriptor: " + dictionary);
                }
            }

            return((FontFlags)flags);
        }
コード例 #2
0
ファイル: Pages.cs プロジェクト: AnilAwadh/Pdf
        internal Pages(ILog log, Catalog catalog, IPdfObjectParser pdfObjectParser, IPageFactory pageFactory,
                       IRandomAccessRead reader, bool isLenientParsing)
        {
            if (catalog == null)
            {
                throw new ArgumentNullException(nameof(catalog));
            }

            rootPageDictionary = catalog.PagesDictionary;

            Count = rootPageDictionary.GetIntOrDefault(CosName.COUNT);

            this.log              = log;
            this.catalog          = catalog;
            this.pdfObjectParser  = pdfObjectParser;
            this.pageFactory      = pageFactory;
            this.reader           = reader;
            this.isLenientParsing = isLenientParsing;
        }
コード例 #3
0
 public static int GetIntOrDefault(this PdfDictionary dictionary, CosName firstKey, CosName secondKey)
 {
     return(dictionary.GetIntOrDefault(firstKey, secondKey, -1));
 }
コード例 #4
0
 public static int GetIntOrDefault(this PdfDictionary dictionary, CosName key, int defaultValue)
 {
     return(dictionary.GetIntOrDefault(key, null, defaultValue));
 }
コード例 #5
0
 public static int GetIntOrDefault(this PdfDictionary dictionary, string key, int defaultValue)
 {
     return(dictionary.GetIntOrDefault(CosName.Create(key), defaultValue));
 }
コード例 #6
0
 public static int GetIntOrDefault(this PdfDictionary dictionary, CosName key)
 {
     return(dictionary.GetIntOrDefault(key, -1));
 }