// Token: 0x06006835 RID: 26677 RVA: 0x001D5B40 File Offset: 0x001D3D40
        internal PageBreakRecord FormatFinite(Size pageSize, Thickness pageMargin, PageBreakRecord breakRecord)
        {
            Invariant.Assert(!this.IsDisposed);
            this._formattedLinesCount = 0;
            TextDpi.EnsureValidPageSize(ref pageSize);
            TextDpi.EnsureValidPageMargin(ref pageMargin, pageSize);
            double num = PtsHelper.CalculatePageMarginAdjustment(this._structuralCache, pageSize.Width - (pageMargin.Left + pageMargin.Right));

            if (!DoubleUtil.IsZero(num))
            {
                pageMargin.Right += num - num / 100.0;
            }
            this._pageMargin = pageMargin;
            base.SetSize(pageSize);
            base.SetContentBox(new Rect(pageMargin.Left, pageMargin.Top, pageSize.Width - (pageMargin.Left + pageMargin.Right), pageSize.Height - (pageMargin.Top + pageMargin.Bottom)));
            using (this._structuralCache.SetDocumentFormatContext(this))
            {
                this.OnBeforeFormatPage();
                if (this._ptsPage.PrepareForFiniteUpdate(breakRecord))
                {
                    this._structuralCache.CurrentFormatContext.PushNewPageData(pageSize, this._pageMargin, true, true);
                    this._ptsPage.UpdateFinitePage(breakRecord);
                }
                else
                {
                    this._structuralCache.CurrentFormatContext.PushNewPageData(pageSize, this._pageMargin, false, true);
                    this._ptsPage.CreateFinitePage(breakRecord);
                }
                this._structuralCache.CurrentFormatContext.PopPageData();
                this.OnAfterFormatPage();
                this._structuralCache.DetectInvalidOperation();
            }
            return(this._ptsPage.BreakRecord);
        }
 // Token: 0x06006834 RID: 26676 RVA: 0x001D5968 File Offset: 0x001D3B68
 internal void FormatBottomless(Size pageSize, Thickness pageMargin)
 {
     Invariant.Assert(!this.IsDisposed);
     this._formattedLinesCount = 0;
     TextDpi.EnsureValidPageSize(ref pageSize);
     this._pageMargin = pageMargin;
     base.SetSize(pageSize);
     if (!DoubleUtil.AreClose(this._lastFormatWidth, pageSize.Width) || !DoubleUtil.AreClose(this._pageMargin.Left, pageMargin.Left) || !DoubleUtil.AreClose(this._pageMargin.Right, pageMargin.Right))
     {
         this._structuralCache.InvalidateFormatCache(false);
     }
     this._lastFormatWidth = pageSize.Width;
     using (this._structuralCache.SetDocumentFormatContext(this))
     {
         this.OnBeforeFormatPage();
         if (this._ptsPage.PrepareForBottomlessUpdate())
         {
             this._structuralCache.CurrentFormatContext.PushNewPageData(pageSize, this._pageMargin, true, false);
             this._ptsPage.UpdateBottomlessPage();
         }
         else
         {
             this._structuralCache.CurrentFormatContext.PushNewPageData(pageSize, this._pageMargin, false, false);
             this._ptsPage.CreateBottomlessPage();
         }
         pageSize         = this._ptsPage.CalculatedSize;
         pageSize.Width  += pageMargin.Left + pageMargin.Right;
         pageSize.Height += pageMargin.Top + pageMargin.Bottom;
         base.SetSize(pageSize);
         base.SetContentBox(new Rect(pageMargin.Left, pageMargin.Top, this._ptsPage.CalculatedSize.Width, this._ptsPage.CalculatedSize.Height));
         this._structuralCache.CurrentFormatContext.PopPageData();
         this.OnAfterFormatPage();
         this._structuralCache.DetectInvalidOperation();
     }
 }