Thank you Thomas, I actually managed to convert the document to FixedDocument, that allows me to search into the document. I will post it maybe it will be useful for someone
Preview.Ddl = Convert.ToString(e.NewValue);
var fixedDocument = (FixedDocument)Preview.Viewer.Document;
// Set up fresh XpsDocument
var stream = new MemoryStream();
var uri = new Uri("pack://document.xps", UriKind.Absolute);
var package = Package.Open(stream, FileMode.Create, FileAccess.ReadWrite);
PackageStore.AddPackage(uri, package);
var xpsDoc = new XpsDocument(package, CompressionOption.SuperFast, uri.AbsoluteUri);
// Write FixedDocument to the XpsDocument
var docWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc);
docWriter.Write(fixedDocument);
FixedDocumentSequence document = xpsDoc.GetFixedDocumentSequence();
// Display XpsDocument in DocumentViewer
Preview.Viewer.Document =document;
Thomas Hoevel wrote:
Hi!
MigraDoc does not have an XPS renderer yet. Neither is there a FixedDocument renderer.
There are no MigraDoc importers for RTF or PDF yet.