I tried to convert png to xps. I fallow this answer . My code:
XpsDocument xpsDocument = new XpsDocument(@"C:\pathRoot\fileName.xps", FileAccess.ReadWrite);
XpsDocumentWriter xpsDocumentWriter = XpsDocument.CreateXpsDocumentWriter(xpsDocument);
xpsDocumentWriter.Write(@"C:\pathRoot\fileName.png");
Here I got an exception
System.IO.FileFormatException: 'File contains corrupted data.'
I assumed that answer's author by saying "YourImageYouWishToWrite" means a path to png file like 'C:\pathRoot\fileName.png'. Or I am getting it completely wrong.
the easiest way to do this through printing all Images into Microsoft XPS Writer Printer , then you can merge the output individual XPS files , like :