本文整理汇总了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);
}
示例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();
}
}
示例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 } );
}
示例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);
}
示例5: BaseConverter
public BaseConverter( DocX d, Paragraph p ) {
_paragraph = p;
_document = d;
_text = Sanitize( _paragraph.Text );
CheckHiperlinks();
CheckPictures();
}
示例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;
}
示例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);
}
示例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;
}
示例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));
}
示例10: SeveritySubSectionRenderer
public SeveritySubSectionRenderer(DocX _document, IDocumentIdeaRenderer documentIdeaRenderer)
{
_wordDocument = _document;
_formatting = new FormattingRepository();
_documentIdeaRenderer = documentIdeaRenderer;
}
示例11: DefaultDocumentSectionRenderer
public DefaultDocumentSectionRenderer(DocX _document, IDocumentSubSectionRenderer documentSubSectionRenderer)
{
_wordDocument = _document;
_formatting = new FormattingRepository();
_documentSubSectionRenderer = documentSubSectionRenderer;
}
示例12: BeginProcessing
protected override void BeginProcessing()
{
this.resolvedPath = this.GetUnresolvedProviderPathFromPSPath(this.FilePath);
if (File.Exists(this.resolvedPath))
{
this.wordDocument = DocX.Load(this.resolvedPath);
}
}
示例13: SeverityIdeaRenderer
public SeverityIdeaRenderer(DocX wordDocument)
{
_wordDocument = wordDocument;
_documentTagService = new DocumentTagService(new TagEntityRepository());
_formatting = new FormattingRepository();
}
示例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)));
}
示例15: Load
public TemplGraphic Load(DocX doc)
{
if (!Loaded)
{
Image = doc.AddImage(Data);
Loaded = true;
}
return this;
}