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


C# Novacode.DocX类代码示例

本文整理汇总了C#中Novacode.DocX的典型用法代码示例。如果您正苦于以下问题:C# DocX类的具体用法?C# DocX怎么用?C# DocX使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DocX类属于Novacode命名空间,在下文中一共展示了DocX类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FamilyPictureDir

        public FamilyPictureDir(Guid id)
        {
            this.id = id;
            dd = DocX.Create("ttt.docx");

            pa = new Parameters()
            {
                PageHeight = 8.5,
                PageWidth = 5.5,
                MarginLeft = .5,
                MarginRight = .3,
                MarginTop = .5,
                MarginBottom = .3,
                FontSizeName = 18.0,
                FontSize = 14,
            };

            pa.CellWidth = pa.PageWidth - pa.MarginLeft - pa.MarginRight;
            pa.RowHeight = pa.PageHeight - pa.MarginTop - pa.MarginBottom;
            pa.MaxPicHeight = pa.RowHeight * .4;

            dd.PageHeight = Pixels(pa.PageHeight);
            dd.PageWidth = Pixels(pa.PageWidth);
            dd.MarginLeft = Pixels(pa.MarginLeft);
            dd.MarginRight = Pixels(pa.MarginRight);
            dd.MarginTop = Pixels(pa.MarginTop);
            dd.MarginBottom = Pixels(pa.MarginBottom);
        }
开发者ID:clearfunction,项目名称:bvcms,代码行数:28,代码来源:FamilyPictureDir.cs

示例2: _Create

 private void _Create(string file, IEnumerable<OXmlElement> elements)
 {
     using (_document = DocX.Create(file))
     {
         foreach (OXmlElement element in elements)
         {
             switch (element.Type)
             {
                 //case zDocXElementType.BeginParagraph:
                 //    _paragraph = _document.InsertParagraph();
                 //    break;
                 //case zDocXElementType.EndParagraph:
                 //    _paragraph = null;
                 //    break;
                 case OXmlElementType.Paragraph:
                     _paragraph = _document.InsertParagraph();
                     break;
                 case OXmlElementType.Text:
                     AddText(element);
                     break;
                 case OXmlElementType.Line:
                     AddLine();
                     break;
                 case OXmlElementType.Picture:
                     AddPicture(element);
                     break;
             }
         }
         _document.Save();
     }
 }
开发者ID:labeuze,项目名称:source,代码行数:31,代码来源:zDocX.cs

示例3: createForParagraph

    private BaseConverter createForParagraph( DocX doc, Paragraph paragraph ) {
      var isList = paragraph.IsListItem;
      if( isList ) return createConverterForList( doc, paragraph );

      var type = Type.GetType( "DocXToMarkdown.Converter." + _converters[paragraph.StyleName] );
      return (BaseConverter)Activator.CreateInstance( type, new object[] { doc, paragraph } );
    }
开发者ID:jiga7,项目名称:DocXToMarkdown,代码行数:7,代码来源:DocXParser.cs

示例4: AssureUpdateField

 private void AssureUpdateField(DocX document)
 {
     if (document.settings.Descendants().Any(x => x.Name.Equals(DocX.w + "updateFields"))) return;
     
     var element = new XElement(XName.Get("updateFields", DocX.w.NamespaceName), new XAttribute(DocX.w + "val", true));
     document.settings.Root.Add(element);
 }
开发者ID:super-rain,项目名称:DocX,代码行数:7,代码来源:TableOfContents.cs

示例5: BaseConverter

 public BaseConverter( DocX d, Paragraph p ) {
   _paragraph = p;
   _document = d;
   _text = Sanitize( _paragraph.Text );
   CheckHiperlinks();
   CheckPictures();
 }
开发者ID:jiga7,项目名称:DocXToMarkdown,代码行数:7,代码来源:BaseConverter.cs

示例6: CreateDoc

        private string CreateDoc( ) {
            var fileName = Seged.Seged.CreateFileName(versenyAdatok.VersenysorozatAzonosito, versenyAdatok.Azonosito,
                DokumentumTipus.Startlista.BeiroLap);
                
            document = DocX.Create( fileName );
            document.MarginBottom = 10;
            document.AddHeaders( );

            #region Cimbekezdes
            var titleFormat = new Formatting {Size = 10D, Position = 1, Spacing = 5, Bold = true};
            var header = document.Headers.odd;
            var title = header.InsertParagraph();

            title.Append( Feliratok.HeadLine.Beirolap);
            title.Alignment = Alignment.center;
            titleFormat.Size = 10D;
            title.AppendLine( Feliratok.Tulajdonos );
            title.AppendLine( );
            title.Bold( );
            titleFormat.Position = 12;
            #endregion

            VersenyTablazat( );
            InduloTablazat( );
            EredmenyTablazat( );
            AlairasTablazat( );

            try { document.Save( ); } catch( System.Exception ) { MessageBox.Show( "A dokumentum meg van nyitva!", "Nevezési lista", MessageBoxButton.OK, MessageBoxImage.Error ); }
            return fileName;
        }
开发者ID:belinyak,项目名称:Ijasz2,代码行数:30,代码来源:Beirolap.cs

示例7: CreateList

 private static void CreateList(DocX doc)
 {
     var list = doc.AddList("Properly structured and follow all good OOP practices", 0, ListItemType.Bulleted);
     doc.AddListItem(list, "Awesome");
     doc.AddListItem(list, "..Very Awesome");
     doc.InsertList(list);
 }
开发者ID:nok32,项目名称:SoftUny-HW,代码行数:7,代码来源:Generator.cs

示例8: TemplBuilder

 /// <summary>
 /// Start with filename
 /// </summary>
 /// <param name="filename"></param>
 /// <param name="defaultModules"></param>
 public TemplBuilder(string filename, bool defaultModules = true)
     : this(defaultModules)
 {
     Doc = DocX.Load(filename);
     Doc.SaveAs(Stream);
     Filename = filename;
 }
开发者ID:ichpuchtli,项目名称:templ-dot-net,代码行数:12,代码来源:Builder.cs

示例9: MergeField

        public override void MergeField(DocX doc)
        {
            base.MergeField(doc);

            doc.AddCustomProperty(new Novacode.CustomProperty("ProductPart.LabelsPerRoll", this.LabelsPerRoll??0));
            doc.AddCustomProperty(new Novacode.CustomProperty("ProductPart.SoulDiameter", this.SoulDiameter ?? 0));
            doc.AddCustomProperty(new Novacode.CustomProperty("ProductPart.MaxDiameter", this.MaxDiameter ?? 0));
        }
开发者ID:algola,项目名称:backup,代码行数:8,代码来源:ProductPartSingleLabelRollEx.cs

示例10: SeveritySubSectionRenderer

        public SeveritySubSectionRenderer(DocX _document, IDocumentIdeaRenderer documentIdeaRenderer)
        {
            _wordDocument = _document;

            _formatting = new FormattingRepository();

            _documentIdeaRenderer = documentIdeaRenderer;
        }
开发者ID:boro2g,项目名称:Idea8Ball,代码行数:8,代码来源:SeveritySubSectionRenderer.cs

示例11: DefaultDocumentSectionRenderer

        public DefaultDocumentSectionRenderer(DocX _document, IDocumentSubSectionRenderer documentSubSectionRenderer)
        {
            _wordDocument = _document;

            _formatting = new FormattingRepository();

            _documentSubSectionRenderer = documentSubSectionRenderer;
        }
开发者ID:boro2g,项目名称:Idea8Ball,代码行数:8,代码来源:DefaultDocumentSectionRenderer.cs

示例12: BeginProcessing

 protected override void BeginProcessing()
 {
     this.resolvedPath = this.GetUnresolvedProviderPathFromPSPath(this.FilePath);
     if (File.Exists(this.resolvedPath))
     {
         this.wordDocument = DocX.Load(this.resolvedPath);
     }
 }
开发者ID:guidooliveira,项目名称:PSWord,代码行数:8,代码来源:ProtectWordDocument.cs

示例13: SeverityIdeaRenderer

        public SeverityIdeaRenderer(DocX wordDocument)
        {
            _wordDocument = wordDocument;

            _documentTagService = new DocumentTagService(new TagEntityRepository());

            _formatting = new FormattingRepository();
        }
开发者ID:boro2g,项目名称:Idea8Ball,代码行数:8,代码来源:SeverityIdeaRenderer.cs

示例14: Cell

        internal Cell(DocX document, XElement xml)
        {
            this.document = document;
            this.xml = xml;

            XElement properties = xml.Element(XName.Get("tcPr", DocX.w.NamespaceName));

            p = new Paragraph(document, 0, xml.Element(XName.Get("p", DocX.w.NamespaceName)));
        }
开发者ID:JonKruger,项目名称:DocX,代码行数:9,代码来源:Table.cs

示例15: Load

 public TemplGraphic Load(DocX doc)
 {
     if (!Loaded)
     {
         Image = doc.AddImage(Data);
         Loaded = true;
     }
     return this;
 }
开发者ID:ichpuchtli,项目名称:templ-dot-net,代码行数:9,代码来源:Graphic.cs


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