// 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);
        }