示例#1
0
文件: WordUtils.cs 项目: waodng/VSIX
 /// <summary>
 /// Inserts a watermark into a document header.
 /// </summary>
 /// <param name="watermarkPara"></param>
 /// <param name="sect"></param>
 /// <param name="headerType"></param>
 public static void InsertWatermarkIntoHeader(Aspose.Words.Paragraph watermarkPara, Aspose.Words.Section sect, Aspose.Words.HeaderFooterType headerType)
 {
     Aspose.Words.HeaderFooter header = sect.HeadersFooters[headerType];
     if (null == header)
     {
         // There is no header of the specified type in the current section, create it.
         header = new Aspose.Words.HeaderFooter(sect.Document, headerType);
         sect.HeadersFooters.Add(header);
     }
     // Insert a clone of the watermark into the header.
     header.AppendChild(watermarkPara.Clone(true));
 }