-
Notifications
You must be signed in to change notification settings - Fork 1.2k
XpsDocument.GetFixedDocumentSequence throws NotSupportedException #1063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment has been minimized.
This comment has been minimized.
Inner exception stack trace:
|
That looks different from what I'd expect for #585 so probably needs a separate investigation. |
@elyoh This seems like something specific to the XPS being displayed or something that has been fixed in Preview8. I tested this against several XPS documents sitting around in our test code and I was able to display them all without an error on Can you test against the latest daily build and, if this still reproduces, supply an XPS document that causes the issue to occur? |
#585 (comment) seems to actually have a similar stack in Preview 8. Using the document from that repro, I get:
@stevenbrix @vatsan-madhavan We should sync up on what we know from #585. CC: @jbartlau since I used your reproduction document to mirror the same failure here. |
This looks like our initialization of TypeFaces is directly calling into an unsupported part of the new zip implementation. Take a look at this stack:
I have a feeling this is going to affect any XPS with local font resources. That's a pretty basic feature of XPS documents that won't work if we don't figure out some way around this. @elyoh does your XPS document contain fonts? |
DeflateStream has this code:
|
Interestingly enough, we have a test XPS document that has embedded fonts, but the entire archive is a flat structure (the fonts are located in the root of the archive). This file displays with no issue. I have to examine what code paths are taken in that instance. |
The workaround here will be fairly straightforward and should follow what I did here: https://github.com/dotnet/wpf/pull/995/files#diff-7b801941d4352acdc7ea9eeaba96fecd |
@stevenbrix Oh I see, so, for instance, I just need to wrap the stream used here instead of the direct cast? EDIT: Ignore the cast comment, it's just about passing the stream downward, got it. |
@rladuca The xps file does reference fonts on the local system. It is a print out of an on screen view written in xaml. I'll get a sample xps file uploaded on Friday. |
@rladuca these stack traces here from @elyoh and in #585 from @jbartlau look different. One stack trace is a managed NotSupportedException from |
@weltkante The second stack I posted is the actual exception stack from loading @jbartlau's file with first chance exceptions turned on. Loading the font when the font is located within the XPS always tries to access position, assuming it doesn't live in the root of the archive. Take a look at the offending code in DeobfuscatingStream and you'll see what I am talking about. I'm pretty sure the root cause of both issues is exactly the same even if the various stacks are slightly different in how we get there. |
@weltkante Ah, I see where I might have conflated the two. I assumed the font loading path would get hit both ways. I'll wait for @elyoh's reproduction XPS first. |
Here is a sample xps file which leads to the error. I tried using the same file in 3.0.100-preview8-013330 and received the same error. |
@elyoh Thanks! I'll have a look today and see what I can figure out. |
@elyoh @weltkante This actually turned out to be the same error, just caught in a slightly different manner. When running with my recent fixes for #585, the document displays correctly. When running without those changes, I get the same error on accessing DeflateStream.Position. The difference here is the call stack that leads to the error has an error trap that re-throws. EDIT: Re-throws isn't the right term, converts the exception to an HR, which then looks like some native call failed on the way back up. See here. In any case, the same workaround will help with your issue as I gave in #585 , open the XPS as read/write. Fixed by #1311 |
Dupe of #585 |
• NET Core Version: 3.0.0-preview6-27804-01 (also in preview 5).
• Windows version: Win10
• Does the bug reproduce also in WPF for .NET Framework 4.8?: No
An attempt is made to read an XPS document from disk:
The following exception is thrown:
Inner exception:
Stack trace:
This appears to be a different issue to #575.
The text was updated successfully, but these errors were encountered: