コード例 #1
0
ファイル: Renderer.cs プロジェクト: gvamsilatha/CorePDFSample
        /// <summary>
        /// Creates a fitting renderer for the given document object for formatting.
        /// </summary>
        /// <param name="gfx">The XGraphics object to do measurements on.</param>
        /// <param name="documentRenderer">The document renderer.</param>
        /// <param name="documentObject">the document object to format.</param>
        /// <param name="fieldInfos">The field infos.</param>
        /// <returns>The fitting Renderer.</returns>
        internal static Renderer Create(XGraphics gfx, DocumentRenderer documentRenderer, DocumentObject documentObject, FieldInfos fieldInfos)
        {
            Renderer renderer = null;

            if (documentObject is Paragraph)
            {
                renderer = new ParagraphRenderer(gfx, (Paragraph)documentObject, fieldInfos);
            }
            else if (documentObject is Table)
            {
                renderer = new TableRenderer(gfx, (Table)documentObject, fieldInfos);
            }
            else if (documentObject is PageBreak)
            {
                renderer = new PageBreakRenderer(gfx, (PageBreak)documentObject, fieldInfos);
            }
            else if (documentObject is TextFrame)
            {
                renderer = new TextFrameRenderer(gfx, (TextFrame)documentObject, fieldInfos);
            }
            else if (documentObject is Chart)
            {
                renderer = new ChartRenderer(gfx, (Chart)documentObject, fieldInfos);
            }
            else if (documentObject is Image)
            {
                renderer = new ImageRenderer(gfx, (Image)documentObject, fieldInfos);
            }

            if (renderer != null)
            {
                renderer.documentRenderer = documentRenderer;
            }

            return(renderer);
        }
コード例 #2
0
 internal FormattedDocument(Document document, DocumentRenderer documentRenderer)
 {
     this.document         = document;
     this.documentRenderer = documentRenderer;
 }
コード例 #3
0
 internal TopDownFormatter(IAreaProvider areaProvider, DocumentRenderer documentRenderer, DocumentElements elements)
 {
     this.documentRenderer = documentRenderer;
     this.areaProvider     = areaProvider;
     this.elements         = elements;
 }
コード例 #4
0
 internal FormattedTextArea(DocumentRenderer documentRenderer, TextArea textArea, FieldInfos fieldInfos)
 {
     this.textArea         = textArea;
     this.fieldInfos       = fieldInfos;
     this.documentRenderer = documentRenderer;
 }
コード例 #5
0
 internal FormattedTextFrame(TextFrame textframe, DocumentRenderer documentRenderer, FieldInfos fieldInfos)
 {
     this.textframe        = textframe;
     this.fieldInfos       = fieldInfos;
     this.documentRenderer = documentRenderer;
 }
コード例 #6
0
 internal FormattedHeaderFooter(HeaderFooter headerFooter, DocumentRenderer documentRenderer, FieldInfos fieldInfos)
 {
     this.headerFooter     = headerFooter;
     this.fieldInfos       = fieldInfos;
     this.documentRenderer = documentRenderer;
 }