I am using source code from the Aspose.PDF-for-.NET github repository.
In particular I am using the PrintoXPSPrinter.Run() method, which opens a PDF file and then prints it to the Microsoft XPS Document Writer.
The source pdf contains text, but when I open the XPS file created by the printer driver, it contains no XPS <Glyphs> records at all. Every glyph from the source document is rendered instead as an XPS <Path> record.
Some implications of this are:
- If you subsequently open the XPS file in an XPS viewer, no text can be selected, because the XPS viewer looks for <Glyphs> records.
- the XPS is much larger than it needs to be. There is no <Path> reuse, so instead of rendering say 40 <Path> items, one for each glyph shape, the XPS contains thousands of <Path> items, many of which are duplicates.
You will be able to demonstrate this reported behaviour immediately using the unmodified source code from your github repo.
My question is: what changes do I have to make to the supplied PrintoXPSPrinter.Run() method so that the generated XPS file contains <Glyphs> records instead of <Path> records?