XpsSaveOptions Constructor |
Namespace: Aspose.Words.Saving
// Open the document Document doc = new Document(MyDir + "Rendering.docx"); // Save document to file in the XPS format with default options doc.Save(ArtifactsDir + "Rendering.SaveAsXps.DefaultOptions.xps"); // Save document to stream in the XPS format with default options FileStream docStream = new FileStream(ArtifactsDir + "Rendering.SaveAsXps.FromStream.xps", FileMode.Create); doc.Save(docStream, SaveFormat.Xps); docStream.Close(); // Save document to file in the XPS format with specified options // Render 3 pages starting from page 2; pages 2, 3 and 4 XpsSaveOptions xpsOptions = new XpsSaveOptions(); xpsOptions.SaveFormat = SaveFormat.Xps; xpsOptions.PageIndex = 1; xpsOptions.PageCount = 3; // All paragraphs in the "Heading 1" style will be included in the outline but "Heading 2" and onwards won't xpsOptions.OutlineOptions.HeadingsOutlineLevels = 1; doc.Save(ArtifactsDir + "Rendering.SaveAsXps.PartialDocument.xps", xpsOptions);