// Initialize PDF output stream using (System.IO.Stream pdfStream = System.IO.File.Open("XPStoDOCX.pdf", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write)) { // Initialize XPS input stream System.IO.Stream xpsStream = System.IO.File.Open("sample.xps", System.IO.FileMode.Open); // Load input XPS document XpsDocument document = new XpsDocument(xpsStream, new XpsLoadOptions()); // Initialize options object with necessary parameters PdfSaveOptions options = new PdfSaveOptions() { JpegQualityLevel = 100, ImageCompression = PdfImageCompression.Jpeg, }; // Create rendering device for PDF format PdfDevice device = new PdfDevice(pdfStream); // Save output PDF file document.Save(device, options); } // Load the intermediate PDF file Document pdfDocument = new Document("XPStoDOCX.pdf"); // Save the output DOCX file pdfDocument.Save("test.docx" , SaveFormat.DocX);