/// <summary> /// Init all managers /// </summary> private void Init(PdfDictionary form) { PdfResources resources = null; if (form != null) { var resourcesDict = form.Elements.GetDictionary(PdfKeys.Resources); resources = new PdfResources(resourcesDict); } extendedStatesManager = new ExtendedStatesManager(); extendedStatesManager.Init(resources); fontManager = new FontManager(); fontManager.Init(resources); patternManager = new PatternManager(); patternManager.Init(resources); colorSpaceManager = new ColorSpaceManager(patternManager); colorSpaceManager.Init(resources); shadingManager = new ShadingManager(); shadingManager.Init(resources); xObjectManager = new XObjectManager(); xObjectManager.Init(resources); }
/// <summary> /// init /// </summary> public void Init(PdfDictionary patternDict) { var shadingDict = patternDict.Elements.GetDictionary(PdfKeys.Shading); shading = ShadingManager.ReadShading(shadingDict); var matrixArray = patternDict.Elements.GetArray(PdfKeys.Matrix); if (matrixArray != null) { matrix = PdfUtilities.GetMatrix(matrixArray); } else { matrix = Matrix.Identity; } // I think we don't need to handle the extGState here // because it can't change anything we are interested in var extGStateDict = patternDict.Elements.GetDictionary(PdfKeys.ExtGState); }