Example #1
0
        protected virtual void CreateBlockRegions(PDFLayoutBlock containerBlock, PDFPositionOptions position, PDFColumnOptions columnOptions)
        {
            PDFRect unused  = containerBlock.CurrentRegion.UnusedBounds;
            PDFUnit yoffset = containerBlock.CurrentRegion.Height;

            PDFRect total = new PDFRect(PDFUnit.Zero, yoffset, unused.Width, unused.Height);

            if (position.Width.HasValue)
            {
                total.Width = position.Width.Value;
            }
            //ADDED for min/max sizes. Include the margins as we are making this the available width.
            else if (position.MaximumWidth.HasValue)
            {
                total.Width = position.MaximumWidth.Value + position.Margins.Left + position.Margins.Right;
            }


            if (position.Height.HasValue)
            {
                total.Height = position.Height.Value;
            }
            //ADDED for min/max sizes. Include the margins as we are making this the available height.
            else if (position.MaximumHeight.HasValue)
            {
                total.Height = position.MaximumHeight.Value + position.Margins.Top + position.Margins.Bottom;
            }

            CurrentBlock.InitRegions(total, position, columnOptions, this.Context);
        }