I am having trouble writing multiple pages to an xps document. I have a loop that goes through my opened windows and saves the last window. this presents to a pdf fine, however it is just the last window in wpf.
MemoryStream lMemoryStream = new MemoryStream();
Package package = Package.Open(lMemoryStream, FileMode.Create);
XpsDocument doc = new XpsDocument(package);
XpsDocumentWriter writer = XpsDocument.CreateXpsDocumentWriter(doc);
writer.Write(Report.reportWindow);
doc.Close();
package.Close();
var pdfXpsDoc = PdfSharp.Xps.XpsModel.XpsDocument.Open(lMemoryStream);
PdfSharp.Xps.XpsConverter.Convert(pdfXpsDoc, filename, 0);
I have tried changing the FileMode to Append. However, this comes up with an error "Append and Truncate not supported".