BibliographyStylesProvider

FieldOptions.BibliographyStylesProvider property

获取或设置返回 的参考书目样式的提供程序FieldBibliographyFieldCitation字段.

public IBibliographyStylesProvider BibliographyStylesProvider { get; set; }

例子

展示如何覆盖内置样式或提供自定义样式。

public void ChangeBibliographyStyles()
{            
    Document doc = new Document(MyDir + "Bibliography.docx");

    doc.FieldOptions.BibliographyStylesProvider = new BibliographyStylesProvider();
    doc.UpdateFields();

    doc.Save(ArtifactsDir + "Field.ChangeBibliographyStyles.docx");
}

public class BibliographyStylesProvider : IBibliographyStylesProvider
{
    Stream IBibliographyStylesProvider.GetStyle(string styleFileName)
    {
        return File.OpenRead(MyDir + "Bibliography custom style.xsl");
    }
}

也可以看看