With DocumentPaginator you can control how each element of the document is printed.
If you can identify the ranges of text you want to change, you can replace the glyphs with a black visual one and not add a text range to the resulting document.
...
Hm. When I typed above, it really sounds a little complicated when there are simpler solutions.
- Read the XPS document, convert it to a FlowDocument.
- Allow the user to select ranges of text to change.
- Replace * selected text with โโโโโโโโโโโโโโโโโ (U + 2588, full block).
- Convert the document back to XPS and print.
* When you replace the source text, it will not be available in the copy / paste actions.
There are many guides for each of these steps separately. Let me know if you need more help.
source share