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


C# OpenXmlElement.AppendChild方法代码示例

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


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

示例1: SetMarginBottom

        private void SetMarginBottom(OpenXmlElement parent)
        {
            Paragraph para = parent.AppendChild(new Paragraph());
            para.ParagraphProperties = new ParagraphProperties();

            DocxMargin.SetBottomMargin(defaultDLMargin, para.ParagraphProperties);
        }
开发者ID:kannan-ar,项目名称:MariGold.OpenXHTML,代码行数:7,代码来源:DocxDL.cs

示例2: CreateParagraph

 private Paragraph CreateParagraph(DocxNode node, OpenXmlElement parent)
 {
     Paragraph para = parent.AppendChild(new Paragraph());
     OnParagraphCreated(node, para);
     OnOLParagraphCreated(this, new ParagraphEventArgs(para));
     return para;
 }
开发者ID:kannan-ar,项目名称:MariGold.OpenXHTML,代码行数:7,代码来源:DocxOL.cs

示例3: AddImageToBody

        private static void AddImageToBody(OpenXmlElement mainElement, string relationshipId, Image image)
        {
            long cx = (long)image.Width * (long)((float)914400 / image.HorizontalResolution);
            long cy = (long)image.Height * (long)((float)914400 / image.VerticalResolution);

            // Define the reference of the image.
            var element =
                 new Drawing(
                     new DW.Inline(
                         new DW.Extent() { Cx = cx, Cy = cy },
                         new DW.EffectExtent()
                         {
                             LeftEdge = 0L,
                             TopEdge = 0L,
                             RightEdge = 0L,
                             BottomEdge = 0L
                         },
                         new DW.DocProperties()
                         {
                             Id = (UInt32Value)1U,
                             Name = System.Guid.NewGuid().ToString()
                         },
                         new DW.NonVisualGraphicFrameDrawingProperties(
                             new A.GraphicFrameLocks() { NoChangeAspect = true }),
                         new A.Graphic(
                             new A.GraphicData(
                                 new PIC.Picture(
                                     new PIC.NonVisualPictureProperties(
                                         new PIC.NonVisualDrawingProperties()
                                         {
                                             Id = (UInt32Value)0U,
                                             Name = System.Guid.NewGuid().ToString() + ".png"
                                         },
                                         new PIC.NonVisualPictureDrawingProperties()),
                                     new PIC.BlipFill(
                                         new A.Blip(
                                             new A.BlipExtensionList(
                                                 new A.BlipExtension()
                                                 {
                                                     Uri =
                                                       "{" + System.Guid.NewGuid().ToString() + "}"
                                                 })
                                         )
                                         {
                                             Embed = relationshipId,
                                             CompressionState =
                                             A.BlipCompressionValues.Print
                                         },
                                         new A.Stretch(
                                             new A.FillRectangle())),
                                     new PIC.ShapeProperties(
                                         new A.Transform2D(
                                             new A.Offset() { X = 0L, Y = 0L },
                                             new A.Extents() { Cx = cx, Cy = cy }),
                                         new A.PresetGeometry(
                                             new A.AdjustValueList()
                                         ) { Preset = A.ShapeTypeValues.Rectangle }))
                             ) { Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture" })
                     ));

            // Append the reference to body, the element should be in a Run.
            mainElement.AppendChild(new Paragraph(new Run(element)));
        }
开发者ID:JCanhoto,项目名称:ToolsQtools,代码行数:63,代码来源:DocumentHelper.cs


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