/// <summary>
        /// Adds a new page
        /// </summary>
        public void NextPage()
        {
            if (!AllowAddingPages)
            {
                throw new InvalidOperationException("Adding pages is not supported by this Document printer");
            }

            if (CurrentPage == pages.Count)
            {
                Page p = new Page(this);
                p.Config        = GetPageConfiguration(MinimumConfigurationRequirements);
                p.ContentArea   = ContentArea;
                p.PageRectangle = PageRectangle;
                NewPageEventArgs e = new NewPageEventArgs(CurrentPage + 1, p.Config);
                OnQueryNewPageSettings(e);
                pages.Add(p);
                CurrentPage++;
                //renderContext.ContentRect = ContentArea;
                renderContext.CurrentYPos = ContentArea.Top;
                OnNewPage(e);
                renderContext.PrintHeaders();
            }
            else
            {
                throw new InvalidOperationException("Unable to perform a NextPage operation in this status!");
            }
        }
 /// <summary>
 /// Raises the QueryNewPageSettings event
 /// </summary>
 /// <param name="e">the arguments for the NewPage event</param>
 protected virtual void OnQueryNewPageSettings(NewPageEventArgs e)
 {
     QueryNewPageSettings?.Invoke(this, e);
 }
 /// <summary>
 /// Raises the NewPage event
 /// </summary>
 /// <param name="e">the arguments for the NewPage event</param>
 protected virtual void OnNewPage(NewPageEventArgs e)
 {
     NewPage?.Invoke(this, e);
 }