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); }
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; }
public static int GetIntOrDefault(this PdfDictionary dictionary, CosName firstKey, CosName secondKey) { return(dictionary.GetIntOrDefault(firstKey, secondKey, -1)); }
public static int GetIntOrDefault(this PdfDictionary dictionary, CosName key, int defaultValue) { return(dictionary.GetIntOrDefault(key, null, defaultValue)); }
public static int GetIntOrDefault(this PdfDictionary dictionary, string key, int defaultValue) { return(dictionary.GetIntOrDefault(CosName.Create(key), defaultValue)); }
public static int GetIntOrDefault(this PdfDictionary dictionary, CosName key) { return(dictionary.GetIntOrDefault(key, -1)); }