當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。