当前位置: 首页>>代码示例>>C#>>正文


C# RenderingContext.IsCellRenderedOnPage方法代码示例

本文整理汇总了C#中RenderingContext.IsCellRenderedOnPage方法的典型用法代码示例。如果您正苦于以下问题:C# RenderingContext.IsCellRenderedOnPage方法的具体用法?C# RenderingContext.IsCellRenderedOnPage怎么用?C# RenderingContext.IsCellRenderedOnPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RenderingContext的用法示例。


在下文中一共展示了RenderingContext.IsCellRenderedOnPage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderCells

        protected internal void RenderCells(RenderingContext ctx, ArrayList cells, bool hasToFit)
        {
            if (hasToFit) {
                foreach (PdfCell cell in cells) {
                    if (!cell.Header) {
                        if (cell.Bottom < IndentBottom) return;
                    }
                }
            }
            foreach (PdfCell cell in cells) {
                if (!ctx.IsCellRenderedOnPage(cell, PageNumber)) {

                    float correction = 0;
                    if (ctx.NumCellRendered(cell) >= 1) {
                        correction = 1.0f;
                    }

                    lines = cell.GetLines(ctx.pagetop, IndentBottom - correction);

                    // if there is still text to render we render it
                    if (lines != null && lines.Count > 0) {

                        // we write the text
                        float cellTop = cell.GetTop(ctx.pagetop - ctx.oldHeight);
                        text.MoveText(0, cellTop);
                        float cellDisplacement = FlushLines() - cellTop;

                        text.MoveText(0, cellDisplacement);
                        if (ctx.oldHeight + cellDisplacement > currentHeight) {
                            currentHeight = ctx.oldHeight + cellDisplacement;
                        }

                        ctx.CellRendered(cell, PageNumber);
                    }

                    float indentBottom = Math.Max(cell.Bottom, IndentBottom);

                    Rectangle tableRect = ctx.table.GetRectangle(ctx.pagetop, IndentBottom);

                    indentBottom = Math.Max(tableRect.Bottom, indentBottom);

                    // we paint the borders of the cells
                    Rectangle cellRect = cell.GetRectangle(tableRect.Top, indentBottom);
                    //cellRect.Bottom = cellRect.Bottom;
                    if (cellRect.Height > 0) {
                        ctx.lostTableBottom = indentBottom;
                        ctx.cellGraphics.Rectangle(cellRect);
                    }

                    // and additional graphics
                    ArrayList images = cell.GetImages(ctx.pagetop, IndentBottom);
                    foreach (Image image in images) {
                        graphics.AddImage(image);
                    }
                }
            }
        }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:57,代码来源:PdfDocument.cs


注:本文中的RenderingContext.IsCellRenderedOnPage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。