I've saved a FixedDocument to XPS file for example:
void SaveDocument(FixedDocument document, string filePath)
{
var xps = new XpsDocument(
filePath, FileAccess.Write, CompressionOption.Maximum);
var writer = XpsDocument.CreateXpsDocumentWriter(xps);
writer.Write(document);
xps.Close();
}
Then I've opened XPS file as ZIP archive and saw my images are kept as PNG files. How can I change image file format to JPG?
I had the same problem: my file size was too big because photographs were being embedded as png instead of jpeg. I fixed it by converting all png files to jpeg in the package. I kept the URIs the same to avoid having to update references to the image, but this means the internal URI of your jpegs will end in a misleading ".png". Obviously this gets more complicated if you want to pick and choose which images you convert to jpeg.