Click here to Skip to main content
15,904,638 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I found a FlowDocument conversion that passes to XPS and then puts it in my FixedDocument so I can view and print it, it was working perfectly. But now the images no longer appear in the print what could it be?


Thanks in advance for all the help.

What I have tried:

FlowDocument doc = new FlowDocument(); //FlowDocument with a image

var paginator = ((IDocumentPaginatorSource)doc).DocumentPaginator;
var package = Package.Open(new MemoryStream(), FileMode.Create, FileAccess.ReadWrite);
var packUri = new Uri("pack://temp.xps");
PackageStore.RemovePackage(packUri);
PackageStore.AddPackage(packUri, package);
var xps = new XpsDocument(package, CompressionOption.NotCompressed, packUri.ToString());
XpsDocument.CreateXpsDocumentWriter(xps).Write(paginator);
FixedDocument TESTE = xps.GetFixedDocumentSequence().References[0].GetDocument(true);
Posted
Comments
[no name] 5-Jan-23 11:18am    
You're not showing any use of "content"; you're simply pushing around a bunch of empty objects. (e.g. new FlowDocument()).
Rodrigo_F_P 6-Jan-23 6:28am    
The FlowDocument is populated with a layout with data and images, it was working correctly, but now the images stop appearing.
[no name] 6-Jan-23 12:55pm    
You should be looking at the contents of the FlowDocument. We see no "images" or anything else.
Rodrigo_F_P 6-Jan-23 14:01pm    
I just put the code as an empty FlowDocument for demonstration, I've already tested it and I know that in my FlowDocument the images appear, they only disappear when I convert to XPS.
Seraphim1980 12-Jan-23 5:58am    
Hmm that's strange. I have exactly the same behaviour and it also occurred recently, about a week or two ago. Before, everything was working perfectly and now the pictures are missing.
Was there any update that caused this behaviour?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900