本文整理汇总了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();
}
}
示例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);
}