Пример #1
0
        private void CreateOrUpdateHeader(IPage page, PageNumber previousSectionLastPage, PageMargin previousSectionMargin)
        {
            if (!_headers.ContainsKey(page.PageNumber))
            {
                var header = previousSectionLastPage == page.PageNumber
                    ? HeaderFactory.CreateInheritedHeader(previousSectionMargin)
                    : _properties.HeaderFooterConfiguration
                             .FindHeader(page.PageNumber)
                             .CreateHeader(_properties.Margin, _imageAccessor, _styleFactory);

                _headers.Add(page.PageNumber, header);
            }

            _headers[page.PageNumber].Prepare(page);
        }