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


C# XpsDocument.AddFixedDocumentSequence方法代码示例

本文整理汇总了C#中XpsDocument.AddFixedDocumentSequence方法的典型用法代码示例。如果您正苦于以下问题:C# XpsDocument.AddFixedDocumentSequence方法的具体用法?C# XpsDocument.AddFixedDocumentSequence怎么用?C# XpsDocument.AddFixedDocumentSequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XpsDocument的用法示例。


在下文中一共展示了XpsDocument.AddFixedDocumentSequence方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnXmlWriter_Click

 private void btnXmlWriter_Click(object sender, RoutedEventArgs e)
 {
     using (XpsDocument xpsDoc = new XpsDocument("Out.xps", FileAccess.Write))
     {
         IXpsFixedDocumentSequenceWriter sequenceWriter =
         xpsDoc.AddFixedDocumentSequence();
         IXpsFixedDocumentWriter docWriter =
         sequenceWriter.AddFixedDocument();
         IXpsFixedPageWriter pageWriter = docWriter.AddFixedPage();
         XmlWriter xmlWriter = pageWriter.XmlWriter;
         xmlWriter.WriteStartElement("FixedPage");
         xmlWriter.WriteAttributeString("xmlns",
                      "http://schemas.microsoft.com/xps/2005/06");
         xmlWriter.WriteAttributeString("Width", "600");
         xmlWriter.WriteAttributeString("Height", "400");
         xmlWriter.WriteAttributeString("xml:lang", "ko-KR");
         xmlWriter.WriteStartElement("Path");
         xmlWriter.WriteAttributeString("Data",
                             "M 10,10 L 150,200 500,300 555,387 z");
         xmlWriter.WriteAttributeString("Fill", "#ffff0000");
         xmlWriter.WriteEndElement();
         xmlWriter.WriteEndElement();
         pageWriter.Commit();
         docWriter.Commit();
         sequenceWriter.Commit();
     }
 }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:27,代码来源:Window3.xaml.cs

示例2: XpsDocumentHelper

        /// <summary>
        /// Creates a new XPS Diagram from scratch
        /// </summary>
        /// <param name="fileName">Name of the file. Important: If the file already exists, it will be deleted</param>
        /// <param name="format">Format of the page</param>
        public XpsDocumentHelper(string fileName, PageFormat format)
        {
            // Initialize teh Dictionaries for fonts and images
            _embeddedFonts = new Dictionary<string, Uri>();
            _embeddedImages = new Dictionary<string, ImageInfo>();

            // The file is created from scratch so if it already exists it will be removed.
            if (File.Exists(fileName))
                File.Delete(fileName);

            // Create the new package with all internal things that are required
            _package = Package.Open(fileName);
            _document = new XpsDocument(_package);
            _xpsDocSeqWriter = _document.AddFixedDocumentSequence();
            _xpsDocWriter = _xpsDocSeqWriter.AddFixedDocument();
            _xpsPageWriter = _xpsDocWriter.AddFixedPage();
            _xmlWriter = _xpsPageWriter.XmlWriter;

            // Write the document header, I fixed everything to the the en-US culture here.
            StartPage(format);
        }
开发者ID:kneitzel,项目名称:Blog-Code,代码行数:26,代码来源:XpsDocumentHelper.cs


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