コード例 #1
0
 /// <summary>
 /// Renders a TabStops collection to CSV.
 /// </summary>
 internal override void Render()
 {
     foreach (TabStop tabStop in tabStops)
     {
         RendererFactory.CreateRenderer(tabStop, this.docRenderer).Render();
     }
 }
コード例 #2
0
        /// <summary>
        /// Renders the paragraph content to CSV.
        /// </summary>
        private void RenderContent()
        {
            DocumentElements elements = DocumentRelations.GetParent(this.paragraph) as DocumentElements;

            //First paragraph of a footnote writes the reference symbol:
            if (DocumentRelations.GetParent(elements) is Footnote && this.paragraph == elements.First)
            {
                FootnoteRenderer ftntRenderer = new FootnoteRenderer(DocumentRelations.GetParent(elements) as Footnote, this.docRenderer);
                ftntRenderer.RenderReference();
            }
            foreach (DocumentObject docObj in this.paragraph.Elements)
            {
                if (docObj == paragraph.Elements.LastObject)
                {
                    if (docObj is Character)
                    {
                        if (((Character)docObj).SymbolName == SymbolName.LineBreak)
                        {
                            continue; //Ignore last linebreak.
                        }
                    }
                }
                RendererBase rndrr = RendererFactory.CreateRenderer(docObj, this.docRenderer);
                if (rndrr != null)
                {
                    rndrr.Render();
                }
            }
        }
コード例 #3
0
 /// <summary>
 /// Renders the RTF document area, which is all except the header.
 /// </summary>
 private void RenderDocumentArea()
 {
     RenderInfo();
     foreach (Section sect in this.document.Sections)
     {
         RendererFactory.CreateRenderer(sect, this).Render();
     }
 }
コード例 #4
0
 /// <summary>
 /// Renders the footnote's content.
 /// </summary>
 private void RenderContent()
 {
     this.csvWriter.StartContent();
     foreach (DocumentObject obj in this.footnote.Elements)
     {
         RendererBase rndrr = RendererFactory.CreateRenderer(obj, this.docRenderer);
         if (rndrr != null)
         {
             rndrr.Render();
         }
     }
     this.csvWriter.EndContent();
 }
コード例 #5
0
        /// <summary>
        /// Renders a formatted text to CSV.
        /// </summary>
        internal override void Render()
        {
            useEffectiveValue = true;

            this.csvWriter.StartContent();

            foreach (DocumentObject docObj in this.formattedText.Elements)
            {
                RendererFactory.CreateRenderer(docObj, this.docRenderer).Render();
            }

            this.csvWriter.EndContent();
        }
コード例 #6
0
        /// <summary>
        /// Renders a TextFrame to CSV.
        /// </summary>
        internal override void Render()
        {
            DocumentElements elms = DocumentRelations.GetParent(this.textFrame) as DocumentElements;
            bool             renderInParagraph = RenderInParagraph();

            if (renderInParagraph)
            {
                StartDummyParagraph();
            }

            StartShapeArea();

            //Properties
            RenderNameValuePair("shapeType", "202");//202 entspr. Textrahmen.

            if (this.textFrame.IsNull("Elements") ||
                !CollectionContainsObjectAssignableTo(this.textFrame.Elements,
                                                      typeof(Shape), typeof(Table)))
            {
            }
            else
            {
                TextOrientation orient = this.textFrame.Orientation;
                if (orient != TextOrientation.Horizontal && orient != TextOrientation.HorizontalRotatedFarEast)
                {
                    Trace.WriteLine(Messages.TextframeContentsNotTurned, "warning");
                }
            }
            csvWriter.StartContent();
            csvWriter.StartContent();
            foreach (DocumentObject docObj in this.textFrame.Elements)
            {
                RendererBase rndrr = RendererFactory.CreateRenderer(docObj, this.docRenderer);
                if (rndrr != null)
                {
                    rndrr.Render();
                }
            }
            //Text fields need to close with a paragraph.
            RenderTrailingParagraph(this.textFrame.Elements);

            this.csvWriter.EndContent();
            this.csvWriter.EndContent();
            EndShapeArea();
            if (renderInParagraph)
            {
                RenderLayoutPicture();
                EndDummyParagraph();
            }
        }
コード例 #7
0
        /// <summary>
        /// Renders a section to CSV
        /// </summary>
        internal override void Render()
        {
            this.useEffectiveValue = true;

            Sections secs = DocumentRelations.GetParent(this.section) as Sections;

            if (this.section != secs.First)
            {
            }

            object pageStp = this.section.PageSetup;

            if (pageStp != null)
            {
                RendererFactory.CreateRenderer((PageSetup)pageStp, this.docRenderer).Render();
            }

            object hdrs = GetValueAsIntended("Headers");

            if (hdrs != null)
            {
                HeadersFootersRenderer hfr = new HeadersFootersRenderer(hdrs as HeadersFooters, this.docRenderer);
                //PageSetup muss hier gesetzt werden, da die HeaderFooter anderem Abschnitt gehören können als das PageSetup
                hfr.PageSetup = (PageSetup)pageStp;
                hfr.Render();
            }

            object ftrs = GetValueAsIntended("Footers");

            if (ftrs != null)
            {
                HeadersFootersRenderer hfr = new HeadersFootersRenderer(ftrs as HeadersFooters, this.docRenderer);
                hfr.PageSetup = (PageSetup)pageStp;
                hfr.Render();
            }

            if (!section.IsNull("Elements"))
            {
                foreach (DocumentObject docObj in this.section.Elements)
                {
                    RendererBase rndrr = RendererFactory.CreateRenderer(docObj, this.docRenderer);
                    if (rndrr != null)
                    {
                        rndrr.Render();
                    }
                }
            }
        }
コード例 #8
0
        /// <summary>
        /// Renders a single Header or Footer.
        /// </summary>
        internal override void Render()
        {
            StringCollection hdrFtrCtrls = GetHeaderFooterControls();

            foreach (string hdrFtrCtrl in hdrFtrCtrls)
            {
                this.csvWriter.StartContent();
                //REM: Could be optimized by storing rendering results in a strings.
                foreach (DocumentObject docObj in this.headerFooter.Elements)
                {
                    RendererBase rndrr = RendererFactory.CreateRenderer(docObj, this.docRenderer);
                    if (rndrr != null)
                    {
                        rndrr.Render();
                    }
                }
                this.csvWriter.EndContent();
            }
        }
コード例 #9
0
        /// <summary>
        /// Renders a hyperlink to CSV.
        /// </summary>
        internal override void Render()
        {
            useEffectiveValue = true;
            this.csvWriter.StartContent();
            this.csvWriter.StartContent();
            this.csvWriter.WriteText("HYPERLINK ");
            string name = this.hyperlink.Name;

            if (this.hyperlink.IsNull("Type") || this.hyperlink.Type == HyperlinkType.Local)
            {
                name = BookmarkFieldRenderer.MakeValidBookmarkName(this.hyperlink.Name);
                this.csvWriter.WriteText(@"\l ");
            }
            else if (this.hyperlink.Type == HyperlinkType.File)
            {
                /*
                 * string workingDirectory = this.docRenderer.WorkingDirectory;
                 * if (workingDirectory != null)
                 *  name = Path.Combine(this.docRenderer.WorkingDirectory, name);
                 *
                 * name = name.Replace(@"\", @"\\");
                 */
            }

            this.csvWriter.WriteText("\"" + name + "\"");
            this.csvWriter.EndContent();
            this.csvWriter.StartContent();
            this.csvWriter.StartContent();

            if (!this.hyperlink.IsNull("Elements"))
            {
                foreach (DocumentObject domObj in hyperlink.Elements)
                {
                    RendererFactory.CreateRenderer(domObj, this.docRenderer).Render();
                }
            }
            this.csvWriter.EndContent();
            this.csvWriter.EndContent();
            this.csvWriter.EndContent();
        }
コード例 #10
0
        internal override void Render()
        {
            useEffectiveValue = true;
            Cell cvrgCell = this.cellList.GetCoveringCell(this.cell);

            if (this.cell.Column.Index != cvrgCell.Column.Index)
            {
                return;
            }

            if (this.cell.Column.Index != 0)
            {
                this.csvWriter.WriteSeparator();
            }

            if (!this.cell.IsNull("Elements"))
            {
                if (this.cell == cvrgCell)
                {
                    foreach (DocumentObject docObj in this.cell.Elements)
                    {
                        RendererBase rndrr = RendererFactory.CreateRenderer(docObj, this.docRenderer);
                        if (rndrr != null)
                        {
                            rndrr.Render();
                        }
                    }
                }
            }

            // Add separators for merged cells
            for (int m = 0; m < cell.MergeRight; m++)
            {
                csvWriter.WriteSeparator();
            }
        }