我正在尝试以横向模式显示 XpsDocument,但查看器始终以纵向显示它:
MemoryStream memoryStream = new MemoryStream();
memoryStream.Write(protectionInfo.Data, 0, protectionInfo.Data.Length);
XpsDocument xpsDocument = XpsHelper.CreateXpsDocument(memoryStream);
FixedDocumentSequence sequence = xpsDocument.GetFixedDocumentSequence();
DocumentViewer viewer = new DocumentViewer();
viewer.Document = sequence;
Window window = new Window();
window.Content = viewer;
window.ShowDialog();
有任何想法吗?
编辑:
我使用 Word 应用程序来配置文档(纵向/横向 + PageSize),然后将其导出到 XpsDocument。通过这种方式效果很好。